diff options
-rw-r--r-- | Emacs.org | 42 |
1 files changed, 42 insertions, 0 deletions
@@ -614,6 +614,47 @@ | |||
614 | 614 | ||
615 | #+end_src | 615 | #+end_src |
616 | 616 | ||
617 | ** Neotree | ||
618 | |||
619 | #+begin_src emacs-lisp | ||
620 | |||
621 | (defun jd/neotree-project-dir () | ||
622 | "Open NeoTree using the git root." | ||
623 | (interactive) | ||
624 | (let ((project-dir (projectile-project-root)) | ||
625 | (file-name (buffer-file-name))) | ||
626 | (neotree-toggle) | ||
627 | (if project-dir | ||
628 | (if (neo-global--window-exists-p) | ||
629 | (progn | ||
630 | (neotree-dir project-dir) | ||
631 | (neotree-find file-name))) | ||
632 | (message "Could not find git project root.")))) | ||
633 | |||
634 | (use-package neotree | ||
635 | :init | ||
636 | (setq neo-theme 'icons) | ||
637 | :config | ||
638 | |||
639 | (evil-define-key 'normal neotree-mode-map (kbd "TAB") 'neotree-enter) | ||
640 | (evil-define-key 'normal neotree-mode-map (kbd "C-RET") 'neotree-quick-look) | ||
641 | (evil-define-key 'normal neotree-mode-map (kbd "q") 'neotree-hide) | ||
642 | (evil-define-key 'normal neotree-mode-map (kbd "RET") 'neotree-enter) | ||
643 | (evil-define-key 'normal neotree-mode-map (kbd "g") 'neotree-refresh) | ||
644 | (evil-define-key 'normal neotree-mode-map (kbd "A") 'neotree-stretch-toggle) | ||
645 | (evil-define-key 'normal neotree-mode-map (kbd "H") 'neotree-hidden-file-toggle)) | ||
646 | |||
647 | #+end_src | ||
648 | |||
649 | *** Keybinds | ||
650 | |||
651 | #+begin_src emacs-lisp | ||
652 | |||
653 | (jd/leader-key-def | ||
654 | "op" '(jd/neotree-project-dir :which-key "Open neotree")) | ||
655 | |||
656 | #+end_src | ||
657 | |||
617 | ** Magit | 658 | ** Magit |
618 | 659 | ||
619 | #+begin_src emacs-lisp | 660 | #+begin_src emacs-lisp |
@@ -623,6 +664,7 @@ | |||
623 | (magit-display-buffer-function #'magit-display-buffer-same-window-except-diff-v1)) | 664 | (magit-display-buffer-function #'magit-display-buffer-same-window-except-diff-v1)) |
624 | 665 | ||
625 | #+end_src | 666 | #+end_src |
667 | |||
626 | *** Keybinds | 668 | *** Keybinds |
627 | 669 | ||
628 | #+begin_src emacs-lisp | 670 | #+begin_src emacs-lisp |