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

Problem using alternate key mapping #82

Closed
asivitz opened this issue Jan 11, 2012 · 2 comments
Closed

Problem using alternate key mapping #82

asivitz opened this issue Jan 11, 2012 · 2 comments

Comments

@asivitz
Copy link

asivitz commented Jan 11, 2012

There's a problem in the keybinding code that prevents me from mapping snipmate to another key.

If I put let g:snips_trigger_key='' in my vimrc, then if I try to use to trigger the snippet, instead of the snippet I get an autocomplete menu. I assume it is having trouble with SuperTab, however, the reason I'm remapping snipmate is to avoid conflicts.

If I type :imap to list all the bindings, I find these snipmate lines:
i * =snipMate#BackwardsSnippet()
i * =snipMate#ShowAvailableSnips()

For some reason it is mapped to BackwardsSnippet instead. But, the command doesn't work anyway.

if I remove this line from after/plugin/snipmate.vim:
exec 'ino ' . g:snips_trigger_key_backwards . '> =snipMate#BackwardsSnippet()'

Then it works.
:imap
i * u=snipMate#TriggerSnippet()
(and the snippet comes out fine)

This works for me, as I don't need the reverse snippet binding, but it's not really a good solution to the problem.

@MarcWeber
Copy link
Collaborator

  1. How to debug?
    vim -V20/tmp/viml-log.txt

Then you what mappings happen when

  1. how to work around it:
    use a startup command:

au X
aucommand VimEnter * do your mapping here, this should be executed after the others ..
endau

I don't have time to debug the issue. If somebody else wants to step up
and explore this you know the tools to do so now.

@ajzafar
Copy link
Collaborator

ajzafar commented Apr 21, 2013

If g:snips_trigger_key was set but g:snips_trigger_key_backwards was not, the latter would be set to the former with shift pressed. In this case Vim sees them as the same thing since it can't differentiate between <C-B> and <S-C-B>. So Vim mapped an action to <C-B> then mapped another to the same key. This is fixed in the latest commit with <Plug> mappings.

@ajzafar ajzafar closed this as completed Apr 21, 2013
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