linux - Vim在折行(Wrap line)前能否显示行号?
大家讲道理
大家讲道理 2017-04-17 11:53:04
0
1
571

在Vim中设置了

set wrap
set linebreak

做到了软折行(soft-wrap),但是折行前没有行号。


设置了:
set cpo+=n
set showbreak==>
可以得到下面的效果:

但还是没有行号。因为老师要求用Latex写论文,自己又习惯了Vim,所以希望可以在折行的地方也加上行号,方便阅读。

大家讲道理
大家讲道理

光阴似箭催人老,日月如移越少年。

모든 응답(1)
黄舟

If you want Vim to show display lines, not the actual, physical lines, that's not possible. It also doesn't make sense, since no movement command except gj / gk works on display lines, and you cannot use them in :[range].

If you want wrapped/broken lines to actually be new lines, why don't you actually make them new lines?

gqq reformats the current paragraph using the textwidth settting
To get automatic formatting going:

set fo=tcrwa textwidth=80
Now, whenever you're type your text will wrap around. On auto-wrap, a trailing space is left on the previous line indicating it isn't the end of a paragraph yet.

Vim line numbers on display lines

我是勤劳的搬运工!

최신 다운로드
더>
웹 효과
웹사이트 소스 코드
웹사이트 자료
프론트엔드 템플릿
회사 소개 부인 성명 Sitemap
PHP 중국어 웹사이트:공공복지 온라인 PHP 교육,PHP 학습자의 빠른 성장을 도와주세요!