   ;; C-h erases previous character
   (global-set-key (kbd "C-h") 'delete-backward-char)
   (define-key isearch-mode-map (kbd "C-h") 'isearch-del-char)
-  (global-set-key (kbd "RET") 'my/open-line-below)
-  (global-set-key (kbd "C-o") 'my/open-line-above))
+  (global-set-key (kbd "<C-return>") 'my/open-line-below)
+  (global-set-key (kbd "<S-return>") 'my/open-line-above)
+  (global-set-key (kbd "s-k") 'evil-scroll-line-up)
+  (global-set-key (kbd "s-j") 'evil-scroll-line-down))
+
+(defun my/save-buffers-and-goes-to-normal-mode ()
+  (interactive)
+  (save-some-buffers 'no-confirm)
+  (message "buffers has been saved")
+  (evil-normal-state))
+
+(defun disable-key-chord-mode ()
+  (set (make-local-variable 'input-method-function) nil))
 
 (defun my/open-line-below ()
   (interactive)

(setq gnutls-min-prime-bits 4096)
;; Enable deletion of selected text
(delete-selection-mode t)
;; CUA mode
(cua-mode t)
;; Disable backup
(setq-default make-backup-files nil)
;; Disable auto saving
(setq auto-save-default nil)
;; Default indentation

  (setq which-key-idle-delay 0.5)
  (add-hook 'after-init-hook 'which-key-mode))

(use-package evil
  :init (setq evil-magic 'very-magic
              evil-want-C-u-scroll t)
  :config
  (evil-mode t)
  (evil-set-initial-state 'term-mode 'emacs)
  (define-key evil-visual-state-map "p" 'evil-paste-after-from-0)
  (define-key evil-normal-state-map (kbd "C-l") 'evil-window-right)
  (define-key evil-normal-state-map (kbd "C-h") 'evil-window-left)
  (define-key evil-normal-state-map (kbd "C-j") 'evil-window-down)
  (define-key evil-normal-state-map (kbd "C-k") 'evil-window-up)
  (define-key evil-motion-state-map (kbd "C-]") nil)
  (define-key evil-motion-state-map (kbd "K") nil)
  (define-key evil-insert-state-map (kbd "C-d") 'delete-char)
  (define-key evil-insert-state-map (kbd "C-e") 'end-of-line)
  (define-key evil-motion-state-map (kbd "C-e") 'end-of-line)

  (use-package evil-leader
    :config
    (global-evil-leader-mode)
    (evil-leader/set-leader "<SPC>")
    (evil-leader/set-key
     "o" 'my/fzf
     "r" 'avy-goto-char-timer
     "s" 'avy-goto-char-timer))

  (use-package evil-visualstar
    :config (global-evil-visualstar-mode t))
  (use-package evil-matchit
    :config (global-evil-matchit-mode t)))

(use-package key-chord
  :init
  (add-hook 'after-init-hook (lambda () (key-chord-mode t)))
  :config
  (key-chord-define-global ",b" 'ido-switch-buffer)
  (key-chord-define-global ",s" 'my/save-buffers-and-goes-to-normal-mode)
  (key-chord-define-global ",v" 'split-window-horizontally)
  (key-chord-define-global ",q" 'my/delete-window-maybe-kill-buffer)
  (key-chord-define-global ",w" 'delete-other-windows)
  (key-chord-define-global ",c" 'comment-dwim)
  (key-chord-define-global ",d" 'idomenu)
  (key-chord-define-global ",a" 'my/fzf-git-grep)

  (add-hook 'minibuffer-setup-hook #'disable-key-chord-mode))

(use-package ido
  :commands ido-switch-buffer
