summary refs log tree commit diff stats
path: root/config.org
diff options
context:
space:
mode:
authorCase Duckworth2021-02-24 17:42:53 -0600
committerCase Duckworth2021-02-24 17:42:53 -0600
commit3ddce92685c1b2daec8cb20496518d44497777c9 (patch)
treea6713c162eac1b571c5be9a7acdd97ad5efcb6ec /config.org
parentFucking ... UNIX LINE ENDINGS (diff)
downloademacs-3ddce92685c1b2daec8cb20496518d44497777c9.tar.gz
emacs-3ddce92685c1b2daec8cb20496518d44497777c9.zip
Enable global-visual-line-mode
Diffstat (limited to 'config.org')
-rw-r--r--config.org31
1 files changed, 19 insertions, 12 deletions
diff --git a/config.org b/config.org index 18b2324..5225df9 100644 --- a/config.org +++ b/config.org
@@ -1340,18 +1340,25 @@ that's the only time I accidentally call it, anyway.
1340 (add-hook 'text-mode-hook #'auto-fill-mode) 1340 (add-hook 'text-mode-hook #'auto-fill-mode)
1341#+end_src 1341#+end_src
1342 1342
13432. /Just/ in case ... let's "fix" =visual-line-mode= if we're in =org-mode=. 13432a. Enable =visual-line-mode= everywhere. I do this because when I'm typing a
1344 1344long line, I don't want it to accidentally push my viewport out to the right. I
1345 #+begin_src emacs-lisp :noweb-ref hooks 1345want the text to invisibly wrap, and /then/ wrap "in the real world," as it were.
1346 (defun hook--visual-line-fix-org-keys () 1346
1347 (when (derived-mode-p 'org-mode) 1347#+begin_src emacs-lisp :noweb-ref modes
1348 (local-set-key (kbd "C-a") #'org-beginning-of-line) 1348 (global-visual-line-mode +1)
1349 (local-set-key (kbd "C-e") #'org-end-of-line) 1349#+end_src
1350 (local-set-key (kbd "C-k") #'org-kill-line))) 1350
1351 13512b. Let's "fix" =visual-line-mode= if we're in =org-mode=.
1352 (add-hook 'visual-line-mode-hook #'hook--visual-line-fix-org-keys) 1352
1353 1353#+begin_src emacs-lisp :noweb-ref hooks
1354 #+end_src 1354 (defun hook--visual-line-fix-org-keys ()
1355 (when (derived-mode-p 'org-mode)
1356 (local-set-key (kbd "C-a") #'org-beginning-of-line)
1357 (local-set-key (kbd "C-e") #'org-end-of-line)
1358 (local-set-key (kbd "C-k") #'org-kill-line)))
1359
1360 (add-hook 'visual-line-mode-hook #'hook--visual-line-fix-org-keys)
1361#+end_src
1355 1362
1356I think that'll work -- I only care about line aesthetics with text. 1363I think that'll work -- I only care about line aesthetics with text.
1357Programming modes should be /allowed/ to have long lines, regardless 1364Programming modes should be /allowed/ to have long lines, regardless