1

My OS is Debian, with LXDE.

find  / -name '*vimrc'
/usr/share/vim/vimrc
/etc/vim/vimrc

What is the difference between these two vimrc? Which one controls my vim?

2
  • You could have found answers to all your questions so far in the built-in documentation. In Vim, type :help and read along.
    – romainl
    Mar 6, 2016 at 12:21
  • 1
    Specifically, :help vimrc :-) Mar 6, 2016 at 14:13

1 Answer 1

3

I want to know What is the difference between two vimrc?

In the Debian packaged version of vim, /usr/share/vim/vimrc is a symlink to /etc/vim/vimrc - i.e., they are the same file.

% ls -al /usr/share/vim/vimrc
lrwxrwxrwx 1 root root 14 Dec 27 16:26 /usr/share/vim/vimrc -> /etc/vim/vimrc

If you want to know information about a file alway at least look inside it, e.g. the first few lines of comments give some explanation.

% head -5 /etc/vim/vimrc 

" All system-wide defaults are set in $VIMRUNTIME/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.

This is a system wide vimrc file, I believe it is run everytime vim is launched and for every user on the system.
If you want to make custom changes to vim, you should do it in your $HOME/.vimrc file.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.