我已编辑我的.vimrc文件以包含以下行:
set number
我保存了文件并完全关闭了vim,当重新打开文件时,仍然没有行号。
这是整个文件,位于 / 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
答案 0 :(得分:1)
在您编辑vimrc文件(系统默认文件或主目录中的文件)之后,您应该使用以下源命令读取它并使这些配置在当前会话中有效。
:source ~/.vimrc
或
:source /usr/share/vim/vimrc