From aa72a9538a9a49d4eb0beee2c2307bfce9506fe2 Mon Sep 17 00:00:00 2001 From: Yuchen Pei Date: Sat, 19 Aug 2023 18:49:35 +1000 Subject: fixing visual line mode commands --- emacs/.emacs.d/init/ycp-editing.el | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'emacs') diff --git a/emacs/.emacs.d/init/ycp-editing.el b/emacs/.emacs.d/init/ycp-editing.el index f440e49..c53cf74 100644 --- a/emacs/.emacs.d/init/ycp-editing.el +++ b/emacs/.emacs.d/init/ycp-editing.el @@ -46,10 +46,16 @@ (my-configure (setq visual-line-fringe-indicators '(left-curly-arrow right-curly-arrow)) - ;; Keep the binding of C-a and C-e + ;; Keep the binding of C-a, C-e, and C-k (my-keybind visual-line-mode-map "C-a" nil - "C-e" nil)) + "C-e" nil + "C-k" nil) + ;; We need to override them still because org-kill-line hardcodes + ;; call to `kill-visual-line' etc. when `visual-line-mode' is on. + (advice-add 'kill-visual-line :override 'kill-line) + (advice-add 'beginning-of-visual-line :override 'beginning-of-line) + (advice-add 'end-of-visual-line :override 'end-of-line)) (my-package my-editing (:delay 5) -- cgit v1.2.3