Vsvim: detect vsvim in .vimrc file

Created on 27 Jun 2016  ·  7Comments  ·  Source: VsVim/VsVim

Hi, I have a plugin ( incsearch ). And this plugin require a special mapping for work.

"aditional mapping for incsearch
map /  <Plug>(incsearch-forward)
map ?  <Plug>(incsearch-backward)
map g/ <Plug>(incsearch-stay)

But VsVim proceeds this action as

insert command
ncsearch-forward

How I can disable this behaviour or make this plugin works?
Thanks

All 7 comments

VsVim doesn't support arbitrary Vim plugins and is unlikely to work with incsearch.

ok, but how I can detect that it's running in vsvim? I intend to exclude this mapping from .vimrc by

if !has("vsvim")
    "aditional mapping for incsearch
   map /  <Plug>(incsearch-forward)
   map ?  <Plug>(incsearch-backward)
   map g/ <Plug>(incsearch-stay)
endif

You could simply copy your .vimrc to .vsvimrc and omit the parts not working in VsVim.

That is the recommended practice.

is copypaste recommended ? i haven't known that it can be recommended.

Generally I structure my files as follows:

  1. .vimcommon: all my settings common to VsVim and gVim
  2. .vsvimrc: runs :source on the common file
  3. .vimrc: runs :source on the common file then does gVim specific work.

Great, thanks! It's a better solution, I'll follow that.

Was this page helpful?
0 / 5 - 0 ratings