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

Remapping ":" #4374

Closed
airstrike opened this issue Dec 12, 2019 · 3 comments
Closed

Remapping ":" #4374

airstrike opened this issue Dec 12, 2019 · 3 comments

Comments

@airstrike
Copy link

I've looked around quite a bit trying to find a solution but came up empty. I'd like to remap : and ; as I find shift+; to be significantly more annoying to repeatedly type than simply ;

In vanilla vim, I use

nnoremap ; :
nnoremap : ;

And that does the trick. I don't believe I can do the same in VS Code today, so I'm opening this feature request.

@sql-koala
Copy link
Contributor

sql-koala commented Dec 13, 2019

Hi, you can do this. With, 1.12 there is support for "parsing" mappings from a vimrc.
I would give a separate path for vscodevim like this (because, as I understand it, only simple mappings are supported right now):
grafik
And then you can put these lines there.

Pre 1.12, you would do that in your settings.json. This is described here:
https://github.com/VSCodeVim/Vim
"Key Remapping"

@airstrike
Copy link
Author

Pre 1.12, you would do that in your settings.json. This is described here:
https://github.com/VSCodeVim/Vim
"Key Remapping"

I've read that article twice but still don't see how that's possible. Closest I got was by adding

{
  "key": "shift+;",
  "command": "vim.showQuickpickCmdLine",
  "when": "editorTextFocus && vim.mode != 'Insert'"
}

to my keybindings.json but vim.showQuickpickCmdLine isn't quite the same as the regular command line

@airstrike
Copy link
Author

I can, however, confirm that using nnoremap in a vimrc file works, and indeed works better than the keybindings.json approach. Feels like that setting is buried under a bunch of other "more granular" ones, though.

The latter would incorrectly pop up the QuickpickCmdLine when doing e.g. r; in normal mode to replace a single character with ;

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