vim - Vim 中当前行号的对齐方式

标签 vim

在 Vim 中,我使用相对行编号,而在我的 .vimrc 中有 highlight CursorLineNr ctermfg=LightGray使当前行号更加突出。
我想知道是否也可以更改当前行号的对齐方式?默认情况下,它向左对齐,但我希望它像其他数字一样向右对齐。

The current line number is aligned to the left

最佳答案

number的组合和 rnu选项将更改行号的显示。如果您有 nonurnu ,则当前行号将与其他(相对)行号对齐,但是,当前行号始终显示 0 .

如果同时启用 nurnu ,您将显示样式作为屏幕截图。这是无法改变的。

有关详细信息,请检查

: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

关于vim - Vim 中当前行号的对齐方式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46443872/

相关文章:

vim - 获取Vim脚本的<SNR>

c++ - vim、ctags 和同名标识符

vim - 如何 "rewrite"现有的 vim 键绑定(bind)?

linux - 在大量 diff 文件上从 vimdiff 中断

python - 如何将 python 表达式嵌入到 :s command in vim?

regex - Vim 正则表达式范围与当前光标位置

vim - 在 jVI for Netbeans 中,光标不会出现

vim - 在 Vim 中如何使用 FuzzyFinder 刷新文件列表?

Vim 全方位完成 : optional preview window

python - 对 Vim 有用的 Python 命令列表?