Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change default location of vimrc

Tags:

vim

In Vim, is it possible to change the default location of the user vimrc file, i.e., from $HOME/.vimrc to some other location ?

like image 686
Vivek Avatar asked Aug 18 '11 15:08

Vivek


People also ask

Where is vimrc default stored?

The system vimrc should normally be left unmodified and is located in the $VIM * directory.

Where is my vimrc file windows?

vim/ directory ($HOME/vimfiles/ for MS-Windows). That makes it easy to copy it to another system.

Is Viminfo the same as vimrc?

They are not the same. The vimrc is the file you edit to change vim's behavior. It is a the configuration file. The viminfo is like a cache, to store cut buffers persistently, and other things.


2 Answers

Another solution might be to create a symlink to you preferred location. I have my .vimrc in $HOME/.vim/.vimrc and symlink to it. This way I can have it in a git repo and backup it.

like image 144
Tamás Szelei Avatar answered Sep 19 '22 11:09

Tamás Szelei


You must start vim with the command vim -u ./path/to/your/vimrcfile

vim -u NONE is a good way to start Vim without any plugin or customisation.

See :help starting.txt for more information.

like image 25
Xavier T. Avatar answered Sep 20 '22 11:09

Xavier T.