diff options
author | David Morgan <djm_uk@protonmail.com> | 2024-09-25 16:34:32 +0100 |
---|---|---|
committer | David Morgan <djm_uk@protonmail.com> | 2024-09-25 16:34:32 +0100 |
commit | 3dfa7cde68ed88ad7369d32257242d151047d7d1 (patch) | |
tree | 90e13b804a752a108863be32234657704b8db095 /.emacs.d | |
parent | 9fe466c1fa6e1265854a1de89d684a9d22a2e451 (diff) | |
download | dotfiles-3dfa7cde68ed88ad7369d32257242d151047d7d1.tar.gz |
Separate view-mode config
Diffstat (limited to '.emacs.d')
-rw-r--r-- | .emacs.d/lisp/init-ui.el | 55 |
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 |