Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where is my .vimrc file?

Tags:

vim

I have been using Vim, and I would really like to save my settings. The problem I am having is that I cannot find my .vimrc file, and it is not in the standard /home/user/.vimrc location. How might I find this file?

like image 215
Eman Avatar asked Jun 06 '12 20:06

Eman


People also ask

Where can I find .vimrc file?

The global or system-wide vim configuration file is generally located under the /etc/vim/vimrc . This configuration file is applied to all users and when Vim is started this configuration file is read and Vim is configured according to this file contents.

Where is .vimrc file located in Ubuntu?

Vim Configuration Files: Vim can be configured system wide (globally) via the /etc/vim/vimrc. local file on Ubuntu/Debian based operating systems. On CentOS 7 and RHEL 7, the system wide configuration file for Vim is in /etc/vimrc.

Where is my vimrc file on Windows?

On Windows, when you start Vim normally, it *either* runs the file "C:\Documents and Settings\(user name)\_vimrc" (where "(user name)" is replaced by the actual user name); *or*, if that file doesn't exist (it usually doesn't, for most users), it runs the file "C:\Program Files\vim\_vimrc".


2 Answers

You need to create it. In most installations I've used it hasn't been created by default.

You usually create it as ~/.vimrc.

like image 158
AlG Avatar answered Nov 29 '22 05:11

AlG


These methods work, if you already have a .vimrc file:

:scriptnames list all the .vim files that Vim loaded for you, including your .vimrc file.

:e $MYVIMRC open & edit the current .vimrc that you are using, then use Ctrl + G to view the path in status bar.

like image 29
Philia Fan Avatar answered Nov 29 '22 05:11

Philia Fan