Is it possible to change the default location of vimrc?

Is it possible to change the default location of vimrc?

In Vim, is it possible to change the default location of the user vimrc file, i.e., from $HOME/.vimrc to some other location ? 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.

How to add viminfo to.vimrc file?

As for viminfo, you need to add this to your vimrc file: You don’t need any shell configuration to store your .vimrc file in the .vim directory. You just need to remove the . or _ from the filename. See section II of :help .vimrc for the documentation on this.

Where is my.vimrc file in Arch Linux?

In Arch Linux the global one is at /etc/vimrc. There are some comments in there with helpful details. Since the filename starts with a ., it’s hidden unless you use ls -a to show ALL files. Typing :version while in Vim will show you a bunch of interesting information including the file location.

Which is the best way to start Vim?

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. Another solution might be to create a symlink to you preferred location.

How to change the file path in Vim?

You can also change the directory only for the current window (each window has a local current directory that can be different from Vim’s global current directory): In these commands, % gives the name of the current file, %:p gives its full path, and %:p:h gives its directory (the “head” of the full path).

Where do I find my home directory in Vim?

In Vim, your home directory is specified with $HOME. On Unix systems, this is your ~ directory. On Windows systems, the best way to find the value of $HOME is from within Vim, as follows. These commands are useful to see what directories your Vim is using: Note the ‘system vimrc file’ and ‘user vimrc file’ paths displayed by the :version command.

How do I edit a Vim file in gVim?

In gvim, the Edit menu includes “Startup Settings” which will use $MYVIMRC to edit your vimrc file. If $MYVIMRC does not exist, “Startup Settings” will create a new file using the “user vimrc file” path shown by the :version command.