Key - Emacs
Define Emacs key package.
(use-package emacs
:after uno-key
:config
(provide 'uno-key-emacs))
Define core keybinds.
(use-package emacs
:after uno-key-emacs
:custom
(confirm-kill-emacs 'y-or-n-p)
:general
(uno-leader-define
"f" '(:ignore t :which-key "File")
"fe" '(:ignore t :which-key "Emacs")
"fR" '(uno/key/emacs/rename-file :which-key "Rename file")
"fs" '(save-buffer :which-key "Save file")
"fS" '(uno/key/emacs/save-all-files :which-key "Save all files")
"h" '(:ignore t :which-key "Help")
"hd" '(:ignore t :which-key "Describe")
"hdb" '(describe-bindings :which-key "Describe bindings")
"hdc" '(describe-char :which-key "Describe char")
"hdf" '(describe-function :which-key "Describe function")
"hdF" '(describe-face :which-key "Describe face")
"hdk" '(describe-key :which-key "Describe key")
"hdm" '(describe-mode :which-key "Describe mode")
"hdp" '(describe-package :which-key "Describe package")
"hdt" '(describe-theme :which-key "Describe theme")
"hdv" '(describe-variable :which-key "Describe variable")
"q" '(:ignore t :which-key "Quit")
"qq" '(save-buffers-kill-terminal :which-key "Save all and quit Emacs")
"qQ" '(kill-emacs :which-key "Quit Emacs")
"qx" '(save-buffers-kill-emacs :which-key "Save all and kill Emacs"))
:init
(defun uno/key/emacs/save-all-files ()
"Save all files."
(interactive)
(save-some-buffers t (lambda ()
(and (not buffer-read-only)
(buffer-file-name))))))
Use restart-emacs to handle different edge cases.
(use-package restart-emacs
:after uno-key-emacs
:custom
(restart-emacs-restore-frames t)
:general
(uno-leader-define
"qr" '(restart-emacs :which-key "Restart Emacs")))