Search code examples
vimdiffvimdiff

Using vimdiff with a different .vimrc?


I've been using Vim now for most of my editing for the last week or so and I'm loving the experience. However I have an issue.

I've setup my .vimrcfile with NERD_tree and a few other goodies. This works well for when I'm coding. However on occasion I use vimdiff via Git and this causes some problems. I don't need NERD_Tree open when I do this or many of the other things I've setup in my .vimrc file.

Here's my question. Is there a way to check what is calling my .vimrc file and have it execute different code depending on the caller? Specifically how do I test to see if vimdiff is the caller? Or am I going about this entirely the wrong way?


Solution

  • Excerpt from the VIM manual called up by typing in :h diff

    if &diff
       setup for diff mode
    else
       setup for non-diff mode
    endif