3
在Vim中,我正在使用相对行编号,在.vimrc中有highlight CursorLineNr ctermfg=LightGray
以使当前行号突出一些。
我想知道是否可以更改当前行号的对齐方式?默认情况下,它与左侧对齐,但我想让它与其他数字一样向右对齐。在Vim中对齐当前行号
在Vim中,我正在使用相对行编号,在.vimrc中有highlight CursorLineNr ctermfg=LightGray
以使当前行号突出一些。
我想知道是否可以更改当前行号的对齐方式?默认情况下,它与左侧对齐,但我想让它与其他数字一样向右对齐。在Vim中对齐当前行号
的number
和rnu
选项的组合将改变行号的显示。如果您有nonu
和rnu
,则当前行号将与其他(相对)行号对齐,但是,当前行号始终显示0
。
如果同时启用nu
和rnu
,则显示样式为屏幕截图。这不能改变。
对于细节,请您检查
:h number_relativenumber
相关信息:
The 'relativenumber' option changes the displayed number to be
relative to the cursor. Together with 'number' there are these
four combinations (cursor in line 3):
'nonu' 'nu' 'nonu' 'nu'
'nornu' 'nornu' 'rnu' 'rnu'
|apple | 1 apple | 2 apple | 2 apple
|pear | 2 pear | 1 pear | 1 pear
|nobody | 3 nobody | 0 nobody |3 nobody
|there | 4 there | 1 there | 1 there