0

This question already has an answer here:

I have two tabs on my terminal. The first one is where I'm doing my project (html & css). On the other tab I'm working on my .vimrc. I added a new plugin (nerdcommenter) and it works on the .vimrc when I tested it because I also set the following augroup inside of it to make sure it will always source the ~/.vimrc

augroup myrefresh
    au!
    au bufwritepost .vimrc source ~/.vimrc
augroup END

nerdcommenter works on the tab where the .vimrc is but it didn't work to other tab where the html and css located. I tried to run :e in the html file to test if the nerdcommenter functionality will work on it but still it didn't work. What could be the problem?

marked as duplicate by D. Ben Knoble, Herb Wolfe, muru, statox Dec 20 '18 at 15:17

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • Can you explain how you « added a new plugin »? Running vim instances typically dont refresh e.g. runtime path or plugin scripts without explicitly being told to. That said, you could try source $MYVIMRC to see if that helps. – D. Ben Knoble Dec 20 '18 at 2:08
  • I first do :w then :PluginInstall. – isemaj Dec 20 '18 at 2:09
  • 1
    Overall the question needs more details to help figure out what’s going on and what a solution would look like. – D. Ben Knoble Dec 20 '18 at 4:00
  • @muru No, that's a different question because it is about without leaving the ~/.vimrc while my question is about without leaving the other file opened in vim but on the other tab in the terminal. – isemaj Dec 20 '18 at 7:33
  • I don't see the difference. – muru Dec 20 '18 at 7:33
0

The Vim running in the other tab is an entirely separate instance. In order for the changes to be picked up in that tab you will need to source your .vimrc there too, by running the following command in that Vim:

:source $MYVIMRC

Not the answer you're looking for? Browse other questions tagged or ask your own question.