How can I have changes in my vimrc take effect without restarting VIM?
Using file name completion, you could type :e $M then press Tab until you see the desired variable. If you only want to see the path, type :echo $M then press Tab to see the variable, and press Enter. In gvim, the Edit menu includes “Startup Settings” which will use $MYVIMRC to edit your vimrc file.
Enable the options for an individual file inside the Vim session using :set Open the desired file in Vim, type any option using the :set command in the Normal mode, and press Enter. 2. Enable the options permanently for all the files by specifying them in the local Vim configuration file ~/. vimrc.
The first line means you can open your vimrc from any vim buffer by typing your leader, then writing "vimrc." For example, my leader is set to comma, so if I'm in edit mode and I type ",vimrc" it opens my vimrc in a new tab. The second line automatically sources the changes to your vimrc when you save and close it.
Sourcing it is the same as typing each command in order. You source with the command :source (usually shortened to :so ). The only file sourced by default is the . vimrc ( _vimrc on windows) so that's a place you can keep all the commands you use to set up Vim every time.
You can just source it, like this:
:so ~/.vimrc
Also, for convenience, it usually gets mapped to something quicker to type:
nmap <silent> <leader>sv :so $MYVIMRC<CR>
And then of course, it would be nice to open vimrc a little quicker:
nmap <silent> <leader>ev :e $MYVIMRC<CR>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With