mirror of
https://github.com/jbranchaud/til
synced 2026-01-05 08:08:02 +00:00
Make a couple clarifications in the latest til.
This commit is contained in:
@@ -1,17 +1,18 @@
|
|||||||
# Format Long Lines To Text Width
|
# Format Long Lines To Text Width
|
||||||
|
|
||||||
Vim allows you to set the maximum width for text per line in a buffer. For
|
Vim allows you to set the maximum width for text per line in a buffer with
|
||||||
example, you can set the maximum text width to 80 characters like so:
|
the `textwidth` setting. For example, you can set the maximum text width to
|
||||||
|
80 characters like so:
|
||||||
|
|
||||||
```
|
```
|
||||||
:set textwidth=80
|
:set textwidth=80
|
||||||
```
|
```
|
||||||
|
|
||||||
With this set, vim will automatically break on whitespace whenever you hit
|
With this set, vim will automatically break on whitespace whenever you hit
|
||||||
80 characters. There are two places where this doesn't quite pan out. You
|
80 characters. However, there are two places where this doesn't quite pan
|
||||||
will see this as soon as you open a file with lines of text that exceed 80
|
out. You will see this as soon as you open a file with lines of text that
|
||||||
characters and when you paste long lines of text into your buffer. You can
|
exceed 80 characters and when you paste long lines of text into your buffer.
|
||||||
quickly remedy this with `gw`.
|
You can quickly remedy this with `gw`.
|
||||||
|
|
||||||
Make a visual selection of the lines that need formatting and then hit `gw`.
|
Make a visual selection of the lines that need formatting and then hit `gw`.
|
||||||
All the lines should then we truncated to 80 or less characters.
|
All the lines should then we truncated to 80 or less characters.
|
||||||
|
|||||||
Reference in New Issue
Block a user