简体   繁体   中英

Unable to locate the vimrc file

I am trying to update my vimrc file to add new plugins to vim. However my vimrc is not a dot file. In fact the :scriptnames command is displaying me this :

  1: /usr/share/vim/vimrc
  2: /usr/share/vim/vim74/debian.vim
  3: /usr/share/vim/vim74/syntax/syntax.vim
  4: /usr/share/vim/vim74/syntax/synload.vim
  5: /usr/share/vim/vim74/syntax/syncolor.vim
  6: /usr/share/vim/vim74/filetype.vim
  7: /usr/share/vim/vim74/plugin/getscriptPlugin.vim
  8: /usr/share/vim/vim74/plugin/gzip.vim
  9: /usr/share/vim/vim74/plugin/logiPat.vim
 10: /usr/share/vim/vim74/plugin/matchparen.vim
 11: /usr/share/vim/vim74/plugin/netrwPlugin.vim
 12: /usr/share/vim/vim74/plugin/rrhelper.vim
 13: /usr/share/vim/vim74/plugin/spellfile.vim
 14: /usr/share/vim/vim74/plugin/tarPlugin.vim
 15: /usr/share/vim/vim74/plugin/tohtml.vim
 16: /usr/share/vim/vim74/plugin/vimballPlugin.vim
 17: /usr/share/vim/vim74/plugin/zipPlugin.vim

So I am not sure if I should update my /usr/share/vim/vimrc or should I create a new dot file at ~/.vimrc (which does not exist on my machine yet) as it is recommended here ?

/usr/share/vim/vimrc is installed by your Linux distribution; like anything under /usr/share , system updates will eventually override changes you make there.

Create your own configuration in ~/.vimrc (or ~/.vim/vimrc ); if you avoid hard-coding of paths, you can even share this across multiple systems that you use. Vim will automatically use this file on the next start. See :help vimrc for details.

The only use case for editing system-wide configuration is when you are the system administrator of a multi-user system (eg for students), and you want to make everyone use the same, consistent settings. Some distributions even allow to do that without touching those distribution-controlled files (via /etc/vim/vimrc.local in Debian, for example).

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