 ;; Meta+X is too cumbersome. Bind to `.
 (define-key evil-normal-state-map "`" 'execute-extended-command)
 (define-key evil-visual-state-map "`" 'execute-extended-command)
+
+(defun eval-region-and-move-to-normal-state ()
+  "In visual mode, eval the highlighted region and then move to normal mode."
+  (interactive)
+  (eval-region evil-visual-beginning evil-visual-end)
+  (evil-normal-state))
+(define-key evil-normal-state-map (kbd "C-e") 'eval-last-sexp)
+(define-key evil-visual-state-map (kbd "C-e") 'eval-region-and-move-to-normal-state)
 (define-key evil-normal-state-map (kbd "C-j") 'move-text-down)
 (define-key evil-normal-state-map (kbd "C-k") 'move-text-up)
 (define-key evil-normal-state-map (kbd "C-d") 'kill-line)


;; Prefer vertical splits to horizontal splits.
(setq split-height-threshold nil)
(setq split-width-threshold 80)

;;;;;;;;;;;;;;;;;; Comma based commands ;;;;;;;;;;;;;;;;;;;;;;;
(define-key evil-normal-state-map ",," 'next-real-buffer)

(define-key evil-normal-state-map ",t" 'google-rotate-among-files)
(define-key evil-normal-state-map "w1" 'delete-other-windows)
(define-key evil-insert-state-map (kbd "C-h") 'backward-kill-word)
(define-key evil-normal-state-map (kbd "C-h") 'previous-multiframe-window)
(define-key evil-visual-state-map (kbd "C-h") 'previous-multiframe-window)
(define-key evil-normal-state-map (kbd "C-l") 'next-multiframe-window)
(define-key evil-visual-state-map (kbd "C-l") 'next-multiframe-window)

;; Meta commands reserved for emacs specific stuff.
(define-key evil-normal-state-map (kbd "M-h") 'help-for-help)
(define-key evil-visual-state-map (kbd "M-h") 'help-for-help)
(define-key evil-normal-state-map (kbd "M-v") 'describe-variable)
(define-key evil-visual-state-map (kbd "M-v") 'describe-variable)
(define-key evil-normal-state-map (kbd "M-v") 'describe-variable)
(define-key evil-visual-state-map (kbd "M-v") 'describe-variable)
(define-key evil-normal-state-map (kbd "M-f") 'describe-function)
(define-key evil-visual-state-map (kbd "M-f") 'describe-function)
(define-key evil-normal-state-map (kbd "M-e") 'eval-region-and-move-to-normal-state)
(define-key evil-visual-state-map (kbd "M-e") 'eval-region-and-move-to-normal-state)

(custom-set-faces
 ;; custom-set-faces was added by Custom.
