Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

detect vsvim in .vimrc file #1796

Closed
iamkarlson opened this issue Jun 27, 2016 · 7 comments
Closed

detect vsvim in .vimrc file #1796

iamkarlson opened this issue Jun 27, 2016 · 7 comments

Comments

@iamkarlson
Copy link

iamkarlson commented Jun 27, 2016

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

@jaredpar
Copy link
Collaborator

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

@iamkarlson
Copy link
Author

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

@jkadg
Copy link

jkadg commented Jun 28, 2016

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

@jaredpar
Copy link
Collaborator

That is the recommended practice.

@iamkarlson
Copy link
Author

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

@jaredpar
Copy link
Collaborator

jaredpar commented Jul 6, 2016

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.

@iamkarlson
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants