- Notifications
You must be signed in to change notification settings - Fork750
Wrapping
This makes Kakoune visually wrap text to fit within the terminal, without actually modifying the content of the buffer (sometimes called "soft wrap").
addhlglobal/ wrap
Seethe highlighter documentation for more details about the wrap highlighter.
Theautowrap script included with Kakoune will automatically insert newline characters as you type. To turn it on, use theautowrap-enable
command:
hookglobalWinSetOptionfiletype=mail %{setwindow autowrap_column72 autowrap-enable}
Theautowrap
script can be a bit quirky, so maybe you only want to rewrap paragraphs after you're finished with them, rather than while you're editing them, in the manner of Vim's= command. Here's a mapping that will do that:
mapglobal normal ='|fmt -w $kak_opt_autowrap_column<ret>'
This mapping pipes the selected text through thefmt
command, but you can easily use a different tool likefold
orpar
if you prefer.
Note that this wraps to the value of theautowrap_column
option, so you can mix fully-automatic and semi-automatic wrapping and have them be consistent with each other.
- Normal mode commands
- Avoid the escape key
- Implementing user mode (Leader key)
- Kakoune explain
- Kakoune TV