 	  (save-place-mode t)
 	  (setq save-place-file "~/.emacs.d/saveplace")))
 
+;; Persistant undo using undo-tree
+(use-package undo-tree
+  :ensure t
+  :diminish :init
+  (progn
+    (global-undo-tree-mode)
+    (setq undo-tree-auto-save-history t)
+    (setq undo-tree-history-directory-alist '(("." . "~/.emacs.d/undo")))))
+
 ;; Neotree
 (use-package neotree
   :ensure t
-  :bind (("<return>" . 'neotree-enter)):init
-  (progn
-    (define-key evil-normal-state-map (kbd "<tab>") 'neotree-toggle)))
-
+  :init (progn
+	  (define-key evil-normal-state-map (kbd "<tab>") 'neotree-toggle)
+	  (defun meain/neotree-mode-hook ()
+	    (define-key neotree-mode-map (kbd "k") 'neotree-previous-line)
+	    (define-key neotree-mode-map (kbd "j") 'neotree-next-line)
+	    (define-key neotree-mode-map (kbd "<return>") 'neotree-enter)
+	    (define-key neotree-mode-map (kbd "<spc>") 'neotree-quick-look)
+	    (define-key neotree-mode-map (kbd "R") 'neotree-refresh)
+	    (define-key neotree-mode-map (kbd "r") 'neotree-rename-node)
+	    (define-key neotree-mode-map (kbd "c") 'neotree-create-node)
+	    (define-key neotree-mode-map (kbd "d") 'neotree-delete-node))
+	  (setq neo-theme 'ascii)
+	  (add-hook 'neotree-mode-hook 'meain/neotree-mode-hook)))
+
+
+;;; [Extra keybindings] ===============================================================
+
+;; Window mappings
+(global-set-key (kbd "M-l")
+		(defun meain/window-right ()
+		  (interactive)
+		  (evil-force-normal-state)
+		  (evil-window-right 1)))
+(global-set-key (kbd "M-h")
+		(defun meain/window-left ()
+		  (interactive)
+		  (evil-force-normal-state)
+		  (evil-window-left 1)))
+(global-set-key (kbd "M-k")
+		(defun meain/window-top ()
+		  (interactive)
+		  (evil-force-normal-state)
+		  (evil-window-top 1)))
+(global-set-key (kbd "M-j")
+		(defun meain/window-bottom ()
+		  (interactive)
+		  (evil-force-normal-state)
+		  (evil-window-bottom 1)))
+(global-set-key (kbd "M-b")
+		(defun meain/horizontal-split ()
+		  (interactive)
+		  (evil-force-normal-state)
+		  (split-window-below)
+		  (windmove-down)))
+(global-set-key (kbd "M-v")
+		(defun meain/vertical-split ()
+		  (interactive)
+		  (evil-force-normal-state)
+		  (split-window-right)
+		  (windmove-right)))
+(global-set-key (kbd "M-w")
+		'evil-window-delete)
+
+;; File manipulation mappings
+(evil-leader/set-key "<SPC>" 'save-buffer)
+
+;; Other keybindings
+(define-key evil-normal-state-map (kbd "\\") 'evil-jump-backward)
+(define-key evil-normal-state-map (kbd "~") 'evil-jump-forward)
+
+;; Up/Down don't bother wrap
+(define-key evil-normal-state-map (kbd "j") 'evil-next-visual-line)
+(define-key evil-normal-state-map (kbd "k") 'evil-previous-visual-line)
+
+;; Quick open config file
+(evil-leader/set-key "c"
+  (defun meain/load-config ()
+    (interactive)
+    (find-file "~/.emacs")))
+
+;; Full screen emacs
+(global-set-key (kbd "<s-return>")
+		'toggle-frame-fullscreen)
+
+;; Open dired
+(define-key evil-normal-state-map (kbd "-") 'counsel-find-file)
+
+;; Fullscreen current buffer
+(defun meain/toggle-maximize-buffer ()
+  "Maximize the current buffer."
+  (interactive)
+  (if (= 1 (length (window-list)))
+      (jump-to-register '_)
+    (progn
+      (window-configuration-to-register '_)
+      (delete-other-windows))))
+(define-key evil-normal-state-map (kbd "``") `meain/toggle-maximize-buffer)
+
+;; Eval region
+;; Figure out a way to auto exit normal mode after eval
+(define-key evil-visual-state-map (kbd ";") 'eval-region)
 
 
 ;; Emacs dump


;;; [Basic config] =============================================

;; Disable ugly stuff
(when window-system
  (tool-bar-mode -1)
  (scroll-bar-mode -1)

  :ensure t
  :diminish :init
  (projectile-mode +1))

;; Flycheck
(use-package flycheck
