I can :set number
from within a file I'm editing but how can I have them always be on by default?
相关问题
- Emacs shell: save commit message
- How to change the first two uppercase characters o
- Insert text into current buffer from function
- Hot reload on save
- Substituting zero-width match in vim script
相关文章
- 如何让 vim 支持 .cshtml 文件的代码高亮
- Auto-save in VIM as you type
- How can I use gcc's -I command to add recursiv
- Vim: overloaded mapping for multiple modes
- vi editor is not responding
- How to use relative line numbering universally in
- How to copy the value of a vim option to a registe
- E185: Cannot find color scheme*
To change the default setting to display line numbers in vi/vim:
then add the following line to the file:
Either we can
source ~/.vimrc
or save and quit by:wq
, now vim session will have numbering :)in home directory you will find a file called ".vimrc" in that file add this code "set nu" and save and exit and open new vi file and you will find line numbers on that.
Add
set number
to your.vimrc
file in your home directory.If the
.vimrc
file is not in your home directory create one withvim .vimrc
and add the commands you want at open.Here's a site that explains the vimrc and how to use it.
I'm using Debian 7 64-bit.
I didn't have a .vimrc file in my home folder. I created one and was able to set user defaults for vim.
However, for Debian 7, another way is to edit /etc/vim/vimrc
Here is a comment block in that file:
I did not have a .vimrc file in my home directory. I created one, added this line:
and that solved the problem.
Terminal >
su
>password
>vim /etc/vimrc
Click here and edit as in line number (13):