about summary refs log tree commit diff stats
path: root/.emacs.d
diff options
context:
space:
mode:
Diffstat (limited to '.emacs.d')
-rw-r--r--.emacs.d/lisp/init-ui.el55
1 files changed, 29 insertions, 26 deletions
diff --git a/.emacs.d/lisp/init-ui.el b/.emacs.d/lisp/init-ui.el
index 93c396e..d881192 100644
--- a/.emacs.d/lisp/init-ui.el
+++ b/.emacs.d/lisp/init-ui.el
@@ -18,32 +18,6 @@
 
                          (add-to-list 'custom-theme-load-path "~/.emacs.d/themes")
                          (load-theme 'non-modo t)))
-  ;; http://yummymelon.com/devnull/enhancing-navigation-in-emacs-view-mode.html
-  (view-mode . (lambda ()
-                 (cond ((derived-mode-p 'org-mode)
-                        (define-key view-mode-map (kbd "p") 'org-previous-visible-heading)
-                        (define-key view-mode-map (kbd "n") 'org-next-visible-heading))
-                       ((derived-mode-p 'markdown-mode)
-                        (define-key view-mode-map (kbd "p") 'markdown-outline-previous)
-                        (define-key view-mode-map (kbd "n") 'markdown-outline-next))
-                       ((derived-mode-p 'html-mode)
-                        (define-key view-mode-map (kbd "p") 'sgml-skip-tag-backward)
-                        (define-key view-mode-map (kbd "n") 'sgml-skip-tag-forward))
-                       ((derived-mode-p 'emacs-lisp-mode)
-                        (define-key view-mode-map (kbd "p") 'backward-sexp)
-                        (define-key view-mode-map (kbd "n") 'forward-sexp))
-                       ((derived-mode-p 'clojure-mode)
-                        (define-key view-mode-map (kbd "p") 'backward-sexp)
-                        (define-key view-mode-map (kbd "n") 'forward-sexp))
-                       ((derived-mode-p 'makefile-mode)
-                        (define-key view-mode-map (kbd "p") 'makefile-previous-dependency)
-                        (define-key view-mode-map (kbd "n") 'makefile-next-dependency))
-                       ((derived-mode-p 'c-mode)
-                        (define-key view-mode-map (kbd "p") 'c-beginning-of-defun)
-                        (define-key view-mode-map (kbd "n") 'c-end-of-defun))
-                       (t
-                        (define-key view-mode-map (kbd "p") 'scroll-down-command)
-                        (define-key view-mode-map (kbd "n") 'scroll-up-command)))))
   :bind ("C-x C-S-k" . kill-buffer)
   :config
   (setq-default display-line-numbers-widen t)
@@ -95,6 +69,35 @@
     (setq mac-command-modifier 'control
           mac-control-modifier 'super)))
 
+(use-feature view
+  ;; http://yummymelon.com/devnull/enhancing-navigation-in-emacs-view-mode.html
+  :hook
+  (view-mode . (lambda ()
+                 (cond ((derived-mode-p 'org-mode)
+                        (define-key view-mode-map (kbd "p") 'org-previous-visible-heading)
+                        (define-key view-mode-map (kbd "n") 'org-next-visible-heading))
+                       ((derived-mode-p 'markdown-mode)
+                        (define-key view-mode-map (kbd "p") 'markdown-outline-previous)
+                        (define-key view-mode-map (kbd "n") 'markdown-outline-next))
+                       ((derived-mode-p 'html-mode)
+                        (define-key view-mode-map (kbd "p") 'sgml-skip-tag-backward)
+                        (define-key view-mode-map (kbd "n") 'sgml-skip-tag-forward))
+                       ((derived-mode-p 'emacs-lisp-mode)
+                        (define-key view-mode-map (kbd "p") 'backward-sexp)
+                        (define-key view-mode-map (kbd "n") 'forward-sexp))
+                       ((derived-mode-p 'clojure-mode)
+                        (define-key view-mode-map (kbd "p") 'backward-sexp)
+                        (define-key view-mode-map (kbd "n") 'forward-sexp))
+                       ((derived-mode-p 'makefile-mode)
+                        (define-key view-mode-map (kbd "p") 'makefile-previous-dependency)
+                        (define-key view-mode-map (kbd "n") 'makefile-next-dependency))
+                       ((derived-mode-p 'c-mode)
+                        (define-key view-mode-map (kbd "p") 'c-beginning-of-defun)
+                        (define-key view-mode-map (kbd "n") 'c-end-of-defun))
+                       (t
+                        (define-key view-mode-map (kbd "p") 'scroll-down-command)
+                        (define-key view-mode-map (kbd "n") 'scroll-up-command))))))
+
 (use-package hl-todo
   :bind
   (:map hl-todo-mode-map