Search code examples
vim

Apply vimrc changes without restarting


How can I have changes in my vimrc take effect without restarting VIM?


Solution

  • 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>