From 643a061ff80c85f5fece9eadba15e7d03233b980 Mon Sep 17 00:00:00 2001 From: Marc Pohling Date: Sun, 18 Mar 2018 16:08:57 +0100 Subject: [PATCH] line wrapping now respects indents --- config.org | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/config.org b/config.org index 5030069..eb903b9 100644 --- a/config.org +++ b/config.org @@ -16,8 +16,6 @@ I want a pretty status bar! - Company It's too active and autocompletes normal text (don't!). Also it completes on RET, which is annoying when I finish a sentence with RET and company "completes" it to a longer word - - Line wrapping - Is there a way to wrap lines and keep the indent? * Update config in a running config Two options: @@ -136,14 +134,28 @@ Various stuff #+begin_src emacs-lisp (show-paren-mode t) (column-number-mode t) - - (global-visual-line-mode) - (diminish 'visual-line-mode) - (setq uniquify-buffer-name-style 'forward) #+end_src +* Prettier Line Wraps + By default there is no line wrapping. M-q actually modifies the buffer, which might not be wanted. + So: enable visual wrapping and keep indentation if there are any. + + #+begin_src emacs-lisp + (global-visual-line-mode) + (diminish 'visual-line-mode) + (use-package adaptive-wrap + :ensure t + :init + (when (fboundp 'adaptive-wrap-prefix-mode) + (defun my-activate-adaptive-wrap-prefix-mode () + "Toggle `visual-line-mode' and `adaptive-wrap-prefix-mode' simultaneously." + (adaptive-wrap-prefix-mode (if visual-line-mode 1 -1))) + (add-hook 'visual-line-mode-hook 'my-activate-adaptive-wrap-prefix-mode)) + ) + #+end_src + * List buffers Ibuffer is the improved version of list-buffers. Make ibuffer the default buffer lister. [[http://ergoemacs.org/emacs/emacs_buffer_management.html][Source]]