aboutsummaryrefslogtreecommitdiff
path: root/emacs
diff options
context:
space:
mode:
authorYuchen Pei <id@ypei.org>2023-08-19 18:49:35 +1000
committerYuchen Pei <id@ypei.org>2023-08-19 18:49:35 +1000
commitaa72a9538a9a49d4eb0beee2c2307bfce9506fe2 (patch)
tree30a6620eb249bf92029050e02a53775dcee687e5 /emacs
parentf2480834e287aa50176ab9a648fa7dabc5aec5db (diff)
fixing visual line mode commands
Diffstat (limited to 'emacs')
-rw-r--r--emacs/.emacs.d/init/ycp-editing.el10
1 files changed, 8 insertions, 2 deletions
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)