Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to apply vim configurations without restarting?

Tags:

vim

I want to edit .vimrc file from Vim and apply them without restarting Vim.

like image 435
0xdeadbeef Avatar asked Mar 08 '10 09:03

0xdeadbeef


People also ask

How do I enable vimrc?

Open vim and type ":version" and hit Enter. You will get paths to your vimrc files. Make sure that your vimrc file is not overwritten by another one (with a higher priority). Please refer to Open vimrc file.

Where is default Vim config?

A default Vim installation will feature a file containing Vim's core global settings called vimrc. This file will be located at either /etc/vim/vimrc or etc/vimrc , depending on your Linux distribution.


1 Answers

Yes, just use the :so % command while editing your .vimrc.

If you want vim to auto-reload your configuration, you must add the following commands :

augroup myvimrchooks     au!     autocmd bufwritepost .vimrc source $MYVIMRC augroup END 

the grouping of autocommand is here to avoid "exponential" reloading if you save several times your configuration.

like image 166
Raoul Supercopter Avatar answered Oct 24 '22 22:10

Raoul Supercopter