From 8cf76238530ecc4a9358a0f65656bd0799a1cf0c Mon Sep 17 00:00:00 2001 From: Tobias Ostner Date: Sun, 26 Apr 2026 10:27:53 +0200 Subject: [PATCH] Wrap lines in code-mode --- flakes/emacs/config/init.el | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/flakes/emacs/config/init.el b/flakes/emacs/config/init.el index 94d4479..cb224eb 100644 --- a/flakes/emacs/config/init.el +++ b/flakes/emacs/config/init.el @@ -748,6 +748,20 @@ ("DEL" . vertico-directory-delete-char) ("M-DEL" . vertico-directory-delete-word))) +(use-package visual-wrap + :ensure nil + :preface + (defun to/enable-code-wrap () + "Wrap long code lines with context-aware continuation indentation." + (setq-local truncate-lines nil) + (setq-local truncate-partial-width-windows nil) + (setq-local word-wrap t) + (setq-local visual-wrap-extra-indent 0) + (visual-wrap-prefix-mode 1)) + :hook + ((prog-mode . to/enable-code-wrap) + (conf-mode . to/enable-code-wrap))) + (use-package vterm :defer 2 :if module-file-suffix)