Rem*_*man 5 vim formatting text-width
这些是我在.vimrc中的格式选项:
set formatoptions=tqronw
set formatlistpat=^\\([\\-\\*]\\\|[0-9]\\+[.)]\\)\\s*
set textwidth=72
set autoindent
Run Code Online (Sandbox Code Playgroud)
1)
我的文字:
- This is my text this is my text this is my text this is my text this is my text this is my text.
Run Code Online (Sandbox Code Playgroud)
格式化后输出:
- This is my text this is my text this is my text this is my text this is my
text this is my text.
Run Code Online (Sandbox Code Playgroud)
预期产量:
- This is my text this is my text this is my text this is my text this is my
text this is my text.
Run Code Online (Sandbox Code Playgroud)
2)
我的文字:
for Biochemistry, conducted a quality clinical study to determine the effects of microwave cooking on food
Run Code Online (Sandbox Code Playgroud)
格式化后输出:
for Biochemistry, conducted a quality clinical study to determine the
effects of microwave cooking on food
Run Code Online (Sandbox Code Playgroud)
预期产量:
for Biochemistry, conducted a quality clinical study to determine the
effects of microwave cooking on food
Run Code Online (Sandbox Code Playgroud)
编辑
找到我的第一个问题的解决方案:)
文本中有(不可见)nbsp(没有空格).
当我使用普通空格替换时,格式符合预期