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

[Feature] Support multikey commands #21

Closed
terryma opened this issue Apr 17, 2013 · 3 comments
Closed

[Feature] Support multikey commands #21

terryma opened this issue Apr 17, 2013 · 3 comments

Comments

@terryma
Copy link
Owner

terryma commented Apr 17, 2013

Currently the plugin doesn't work for multikey commands in any mode once multicursor mode is started. Actions like ciw in normal mode causes undetermined behavior since the plugin literally tries to fan out c, i, and w individually at every virtual cursor location. Adding this support requires the plugin to be more intelligent with user input, deciding what to 'keep' vs what to 'fan out'.

@eapache
Copy link
Collaborator

eapache commented Feb 4, 2015

This is basically already done by the insert_maps and normal_maps. The only thing left is visual_maps (ticket #111) and then setting some sane defaults for these options.

My .vimrc currently contains the following, which I suggest as a good starting point for defaults.

let g:multi_cursor_insert_maps={'\':1}
let g:multi_cursor_normal_maps={'c':1, 'd':1, 'f':1, 'r':1, '=':1, '<':1, '>':1}

@roryokane
Copy link
Contributor

I think this is a complete list of Vim multi-key mappings, and should be the default for multi_cursor_normal_maps:

let g:multi_cursor_normal_maps={'!':1, '@':1, '=':1, 'q':1, 'r':1, 't':1, 'T':1, 'y':1, '[':1, ']':1, '\':1, 'd':1, 'f':1, 'F':1, 'g':1, '"':1, 'z':1, 'c':1, 'm':1, '<':1, '>':1}

I identified these multi-key mappings by going across the keyboard, row by row, and checking whether that key, or Shift plus that key, was a multi-key mapping by default.

@faceleg
Copy link
Collaborator

faceleg commented May 28, 2015

@roryokane do you want to submit a PR with this change, assuming it won't break anything?

roryokane added a commit to roryokane/vim-multiple-cursors that referenced this issue May 28, 2015
I identified these multi-key mappings by going across the keyboard, row by row, and checking whether that key, or Shift plus that key, was a multi-key mapping by default.

I manually tested this change by removing the setting from my vimrc and making sure that the listed keys were still handled correctly, and that they weren’t when the dictionary was set to empty.

First posted in my comment terryma#21 (comment).
@faceleg faceleg closed this as completed May 29, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants