简体   繁体   中英

Why doesn't Vim show number lines after editing .vimrc

I have edited my .vimrc file to include the following line:

set number

I've saved the file and closed out vim entirely and when reopening files theres still no line numbers.

Here's the entire file which is located at /usr/share/vim/vimrc

" Configuration file for vim
set modelines=0     " CVE-2007-2438

" Normally we use vim-extensions. If you want true vi-compatibility
" remove change the following statements
set nocompatible    " Use Vim defaults instead of 100% vi compatibility
set backspace=2     " more powerful backspacing

" Don't write backup file if vim is being called by "crontab -e"
au BufWrite /private/tmp/crontab.* set nowritebackup
" Don't write backup file if vim is being called by "chpass"
au BufWrite /private/etc/pw.* set nowritebackup

set number

After you edited your vimrc file(either the one of system default or the one in your home directory), you should use source command as followings to read it in and make those configurations valid on current session.

:source ~/.vimrc

or

:source  /usr/share/vim/vimrc

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM