maxbrunsfeld / vim-yankstack

A lightweight implementation of emacs's kill-ring for vim
437 stars 29 forks source link

Breaks vim-sneak #39

Closed apirogov closed 10 years ago

apirogov commented 10 years ago

I tried g:yankstack_map_keys = 0, but it still mapped stuff to s and S..

I looked into yankstack and it seems that this option just works for the M-p/M-P keys.

EDIT: I try to clarify - I would like to have an option to disable yankstack hijacking some of the keys with something like:

let g:my_yank_keys = ['c', 'C', 'd', 'D', 'x', 'X', 'y', 'Y']

oconnor663 commented 10 years ago

You can work around this issue with something like this in your .vimrc:

" Calling yankstack#setup() here stops it from overriding the vim-sneak mappings that come next.
call yankstack#setup()
nmap s <Plug>SneakForward
nmap S <Plug>SneakBackward
pablox-cl commented 10 years ago

Thanks @oconnor663. Still we need a proper solution :)

blueyed commented 10 years ago

This should be:

" Calling yankstack#setup() here stops it from overriding the vim-sneak mappings that come next.
call yankstack#setup()
nmap s <Plug>Sneak_s
nmap S <Plug>Sneak_S
xmap s <Plug>Sneak_s
xmap S <Plug>Sneak_S

The SneakForward/SneakBackward maps are deprecated, and yankstack also overwrites the xmap (visual mode).

raghur commented 10 years ago

Hi - I'm hitting the same problem - and I'm using NeoBundle - so doing

 NeoBundle 'maxbrunsfeld/yankstack'
 call yankstack#setup()

doesn't work either :( (fails with unknown fn yankstack#setup)

raghur commented 10 years ago

@apirogov, @maxbrunsfeld just submitted a PR https://github.com/maxbrunsfeld/vim-yankstack/pull/48 to allow customization of keys hijacked by yankstack.

pablox-cl commented 10 years ago

I had to stop using this plugin because it was giving problems with lots of plugins, and unexpected behaviours that went away after disabling the plugin. I don't understand the vim internals, but it seems that hijack keys (yank_with_key) it's not very useful in conjuction with other plugins :/

@raghur, I'm using Neobundle and I solved that particular issue, as soon as I get home I'll check how did I did it (and I remember getting that error too).

maxbrunsfeld commented 10 years ago

See this merged pull request and the addition to the 'Compatibility' section of the README. Thanks!