You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 

1.9 KiB

Key - Emacs

Package

Define Emacs key package.

  (use-package emacs
    :after uno-key
    :config
    (provide 'uno-key-emacs))

Keybinds

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-face :which-key "Describe face")
      "hdm" '(describe-mode :which-key "Describe mode")
      "hdp" '(describe-package :which-key "Describe package")
      "hdt" '(describe-theme :which-key "Describe theme")
      "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))))))

Restart Emacs

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")))