snippets/old_snippets/prevent-vim-auto-new-line.en.md

814 B

title date draft snippet_types
prevent vim auto new lines 2020-08-13T10:06:37+02:00 false
vim

Sometimes when typing vim will automatically start a newline. This is an expected behavior but at times can be really annoying. Ex working with macros, you can recored one on a short line that breaks on longer lines 😟. The amount of text before vim will break to new line while typing is controlled via the textwidth setting. So a fix is pretty simple. If don't want the behavior just set textwidth to a big number. ex:

: set tw=500

Here is a asciicast of the problem and solution in action:

{{< asciicast-with-caption id="353148" title="demo of setting tw" >}}

source -- https://stackoverflow.com/questions/1272173/in-vim-how-do-i-break-one-really-long-line-into-multiple-lines