terryma / vim-multiple-cursors

True Sublime Text style multiple selections for Vim
MIT License
7.94k stars 247 forks source link

Shortcuts with cmd does not work #6

Closed fatih closed 11 years ago

fatih commented 11 years ago

I have the following lines in ~/.vimrc and it doesn't accept them:

let g:multi_cursor_use_default_mapping=0
let g:multi_cursor_next_key="\<D-d>"
let g:multi_cursor_prev_key="\<D-u>"
let g:multi_cursor_skip_key="\<D-k>"
let g:multi_cursor_exit_key="\<Esc>"

The ctrlp vim plugin has a shorcut setting like let g:ctrlp_map = '<D-p>' and it works like a charm. May be looking into this plugin for internal work could be helpful.

jbeja commented 11 years ago

I also have a similar problem , i can re-map the keys but every time i use them Vim give me a error.

Ps: @fatih this is maybe the last piece to complete your subvim repo :D

terryma commented 11 years ago

It was slightly tricky to get this right, since the same key sequence is using for regular map command, as well as to check against user input with getchar() in the special multicursor mode. I checked in a fix that should allow '<D-d>' to be mapped now. Note that the syntax for mapping has changed. I've updated the README and the doc to reflect that. Give it a whirl and let me know if it works for you.

terryma commented 11 years ago

Also note that I made a mistake in the documentation that might've caused some woes to many folks. The correct global option to use for mapping the exit key is g:multi_cursor_quit_key and NOT g:multi_cursor_exit_key. I've fixed the doc.

fatih commented 11 years ago

Works as featured. Thanks @terryma for fixing it.