vsvim

Is there a feature flag I can test in .vimrc to tell whether I am running VsVim?


In .vimrc, I can test whether I am loaded in GVim by testing for has('gui_running'). Is there a similar feature flag that VsVim uses so I can test whether VsVim is currently running?

The reason is that there are some mappings that I use in regular Vim that cause problems when run within VsVim and so I'd like to avoid loading them when run inside VsVim.


Solution

  • For now, I found a workaround by using a ~/.vsvimrc file. I just set a has_vsvim variable in .vsvimrc, then source my normal .vimrc file, in which I can check for the has_vsvim flag.

    ~/.vsvimrc:

    let has_vsvim = 1
    so ~/dotfiles/.vimrc
    

    ~/dotfiles/.vimrc

    " ...snip...
    if !exists('has_vsvim')
        " ... perform actions that shouldn't happen in VsVim ...
    endif
    " ...snip...