   (when (eq 1 (length (get-buffer-window-list)))
     (kill-this-buffer))
   (delete-window))
+
+(defun evil-paste-after-from-0 ()
+  (interactive)
+  (let ((evil-this-register ?0))
+    (call-interactively 'evil-paste-after)))
 
 (defun my/fzf-init ()
 

        gofmt-command "goimports")
  (add-hook 'before-save-hook 'gofmt-before-save)
  (setq go-mode-hook (lambda ()
                       (setq imenu-generic-expression
                             '((nil "func *\\(.*\\) {" 1)))
                       (go-eldoc-setup)

  (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
