Rem*_*man 8 vim formatting list
我想在Vim中找到一种简单格式列表的方法.
我检查了PAR和Vim的默认格式化程序.
PE
1. this is my text this is my text this is my text 2. this is my text this is my text this is my text 3. this is my text this is my text this is my text 4. this is my text this is my text this is my text
还有这个
- this is my text this is my text this is my text - this is my text this is my text this is my text - this is my text this is my text this is my text - this is my text this is my text this is my text
当我选择行并使用PAR和VIM执行默认格式为42时,结果如下:
用par:
par错误格式化:
(42)<=(0)+(50)
用vim格式化:
1. this is my text this is my text this is my text 2. this is my text this is my text this is my text 3. this is my text this is my text this is my text 4. this is my text this is my text this is my text
使用par格式化:
4行过滤(无变化)
用vim格式化:
- this is my text this is my text this is my text - this is my text this is my text this is my text - this is my text this is my text this is my text - this is my text this is my text this is my text
有谁知道如何格式化列表没有问题的好方法?
试试set fo+=n
.来自:help fo-table
:
n When formatting text, recognize numbered lists. This actually uses
the 'formatlistpat' option, thus any kind of list can be used. The
indent of the text after the number is used for the next line. The
default is to find a number, optionally followed by '.', ':', ')',
']' or '}'. Note that 'autoindent' must be set too. Doesn't work
well together with "2".
Example:
1. the first item
wraps
2. the second item
Run Code Online (Sandbox Code Playgroud)