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 with vim-repeat and remapping keys #58

Open
oskarkv opened this issue Mar 2, 2017 · 1 comment
Open

Problem with vim-repeat and remapping keys #58

oskarkv opened this issue Mar 2, 2017 · 1 comment

Comments

@oskarkv
Copy link

oskarkv commented Mar 2, 2017

I don't have the qwerty layout, and so want to remap some keys, in particular u.

Looking at vim-repeat, it seems I should be able to just map another key to RepeatUndo, like so:

nmap k <Plug>(RepeatUndo)

and vim-repeat will not overwrite my u mapping, because it checks for a mapping with hasmapto.

The problem is that unless I have used a command that requires vim-repeat, for example, used vim-surround, my k key does not undo anything. It starts working only after I have used vim-surround.

@tpope
Copy link
Owner

tpope commented Mar 4, 2017

So a hackish but probably adequate solution would to add the following to your vimrc:

if empty(mapcheck("<Plug>(RepeatUndo)"))
  nnoremap <Plug>(RepeatUndo) u
endif

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

2 participants