VIM行号 - 如何在默认情况下让他们吗?(vim line numbers - how to ha

2019-06-23 20:31发布

我可以:set number从我编辑一个文件中,但我怎么可以让他们永远是默认?

Answer 1:

Add set number to your .vimrc file in your home directory.
If the .vimrc file is not in your home directory create one with vim .vimrc and add the commands you want at open.

Here's a site that explains the vimrc and how to use it.



Answer 2:

要更改默认设置,以显示在vi / vim的行号:

vi ~/.vimrc

然后将下面的行添加到文件:

set number

要么我们可以source ~/.vimrc或保存和退出:wq ,现在VIM会议将编号:)



Answer 3:

终端> su > password > vim /etc/vimrc

点击这里,编辑为行号(13):

set nu



Answer 4:

我没有在我家目录的.vimrc文件。 我创建了一个中加入这一行:

set number

而解决了这个问题。



Answer 5:

在主目录,你会发现一个在该文件名为“.vimrc”文件添加以下代码‘ 设置NU’并保存退出并打开新的VI文件,你会发现在该行号。



Answer 6:

我使用Debian 7 64位。

我没有在我的主文件夹.vimrc文件。 我创建了一个,并能设置用户默认值VIM。

然而,对于Debian的7,另一种方法是编辑/ etc / vim的/的vimrc

下面是该文件的注释块:

" All system-wide defaults are set in $VIMRUNTIME/debian.vim (usually just
" /usr/share/vim/vimcurrent/debian.vim) and sourced by the call to :runtime
" you can find below.  If you wish to change any of those settings, you should
" do it in this file (/etc/vim/vimrc), since debian.vim will be overwritten
" everytime an upgrade of the vim packages is performed.  It is recommended to
" make changes after sourcing debian.vim since it alters the value of the
" 'compatible' option.


Answer 7:

如果你不希望添加/编辑.vimrc里,你可以启动

vi "+set number" /path/to/file


文章来源: vim line numbers - how to have them on by default?