From 794cf516b1d0ab9f435ec456c710301ccfb45ffb Mon Sep 17 00:00:00 2001 From: Kjetil Orbekk Date: Mon, 14 Aug 2023 20:04:26 -0400 Subject: Add server key binding --- emacs/.config/emacs-kj/init.el | 33 +++++++++++++++++++++------------ 1 file changed, 21 insertions(+), 12 deletions(-) (limited to 'emacs/.config') diff --git a/emacs/.config/emacs-kj/init.el b/emacs/.config/emacs-kj/init.el index bb73ad5..195d784 100644 --- a/emacs/.config/emacs-kj/init.el +++ b/emacs/.config/emacs-kj/init.el @@ -108,6 +108,7 @@ ;; Deletes trailing whitespace on changed lines only. (use-package ws-butler + :diminish ws-butler-mode :hook (prog-mode . ws-butler-mode)) ;; `M-x shell` settings @@ -767,20 +768,20 @@ (repeat-mode 1) ;; Disable the built-in repeat-mode hinting -(setq repeat-echo-function #'ignore) +;;(setq repeat-echo-function #'ignore) ;; Spawn or hide a which-key popup -(advice-add 'repeat-post-hook :after - (defun repeat-help--which-key-popup () - (if-let ((cmd (or this-command real-this-command)) - (keymap (or repeat-map - (repeat--command-property 'repeat-map)))) - (run-at-time - 0 nil - (lambda () - (which-key--create-buffer-and-show - nil (symbol-value keymap)))) - (which-key--hide-popup)))) +;; (advice-add 'repeat-post-hook :after +;; (defun repeat-help--which-key-popup () +;; (if-let ((cmd (or this-command real-this-command)) +;; (keymap (or repeat-map +;; (repeat--command-property 'repeat-map)))) +;; (run-at-time +;; 0 nil +;; (lambda () +;; (which-key--create-buffer-and-show +;; nil (symbol-value keymap)))) +;; (which-key--hide-popup)))) ;; Calendar settings. (setq calendar-week-start-day 1) @@ -825,3 +826,11 @@ ;; Restore gc. (setq gc-cons-threshold (* 16 1024 1024)) + +;; Emacs server edit. +;; Easier way to save and exit. +(define-key server-mode-map (kbd "C-c C-c") + (defun kj/server-save-and-edit (&optional arg) + (interactive "P") + (save-buffer) + (server-edit arg))) -- cgit v1.2.3