Clean up prelude-mode
* Move the mode menu top-level, so it's easier to discover * Make prelude-mode a global mode and remove prelude-global-mode
This commit is contained in:
parent
598fdd8392
commit
fef1988eac
2 changed files with 36 additions and 65 deletions
|
@ -373,7 +373,7 @@ indent yanked text (with prefix arg don't indent)."
|
|||
(add-hook 'compilation-filter-hook #'prelude-colorize-compilation-buffer)
|
||||
|
||||
;; enable Prelude's keybindings
|
||||
(prelude-global-mode t)
|
||||
(prelude-mode t)
|
||||
|
||||
;; sensible undo
|
||||
(global-undo-tree-mode)
|
||||
|
|
|
@ -79,13 +79,8 @@
|
|||
(define-key map (kbd "s-m f") 'magit-log-buffer-file)
|
||||
(define-key map (kbd "s-m b") 'magit-blame)
|
||||
(define-key map (kbd "s-o") 'crux-smart-open-line-above)
|
||||
|
||||
map)
|
||||
"Keymap for Prelude mode.")
|
||||
|
||||
(defun prelude-mode-add-menu ()
|
||||
"Add a menu entry for `prelude-mode' under Tools."
|
||||
(easy-menu-add-item nil '("Tools")
|
||||
(easy-menu-define prelude-mode-menu map
|
||||
"Prelude's menu."
|
||||
'("Prelude"
|
||||
("Files"
|
||||
["Open with..." crux-open-with]
|
||||
|
@ -95,11 +90,9 @@
|
|||
["Find init file" crux-find-user-init-file]
|
||||
["Find custom file" crux-find-user-custom-file]
|
||||
["Find shell config file" crux-find-shell-init-file])
|
||||
|
||||
("Buffers"
|
||||
["Clean up buffer or region" crux-cleanup-buffer-or-region]
|
||||
["Kill other buffers" crux-kill-other-buffers])
|
||||
|
||||
("Editing"
|
||||
["Go to beginning of line" crux-move-beginning-of-line]
|
||||
["Kill line" crux-smart-kill-line]
|
||||
|
@ -112,24 +105,16 @@
|
|||
["Indent rigidly and copy to clipboard" crux-indent-rigidly-and-copy-to-clipboard]
|
||||
["Indent defun" crux-indent-defun]
|
||||
["Insert date" crux-insert-date]
|
||||
["Eval and replace" crux-eval-and-replace]
|
||||
)
|
||||
|
||||
["Eval and replace" crux-eval-and-replace])
|
||||
("Windows"
|
||||
["Swap windows" crux-swap-windows])
|
||||
|
||||
("General"
|
||||
["Visit term buffer" crux-visit-term-buffer]
|
||||
["Search in Google" prelude-google]
|
||||
["View URL" crux-view-url]))
|
||||
"Search Files (Grep)...")
|
||||
|
||||
(easy-menu-add-item nil '("Tools") '("--") "Search Files (Grep)..."))
|
||||
|
||||
(defun prelude-mode-remove-menu ()
|
||||
"Remove `prelude-mode' menu entry."
|
||||
(easy-menu-remove-item nil '("Tools") "Prelude")
|
||||
(easy-menu-remove-item nil '("Tools") "--"))
|
||||
map)
|
||||
"Keymap for Prelude mode.")
|
||||
|
||||
;; define minor mode
|
||||
(define-minor-mode prelude-mode
|
||||
|
@ -138,21 +123,7 @@
|
|||
\\{prelude-mode-map}"
|
||||
:lighter " Pre"
|
||||
:keymap prelude-mode-map
|
||||
(if prelude-mode
|
||||
;; on start
|
||||
(prelude-mode-add-menu)
|
||||
;; on stop
|
||||
(prelude-mode-remove-menu)))
|
||||
|
||||
(define-globalized-minor-mode prelude-global-mode prelude-mode prelude-on)
|
||||
|
||||
(defun prelude-on ()
|
||||
"Turn on `prelude-mode'."
|
||||
(prelude-mode +1))
|
||||
|
||||
(defun prelude-off ()
|
||||
"Turn off `prelude-mode'."
|
||||
(prelude-mode -1))
|
||||
:global t)
|
||||
|
||||
(provide 'prelude-mode)
|
||||
;;; prelude-mode.el ends here
|
||||
|
|
Loading…
Reference in a new issue