24 lines
814 B
Markdown
24 lines
814 B
Markdown
---
|
|
title: "prevent vim auto new lines"
|
|
date: 2020-08-13T10:06:37+02:00
|
|
draft: false
|
|
snippet_types:
|
|
- 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
|
|
|