Language mode-specific key binding?
See original GitHub issueI’d like to map a keybinding for a specific language mode. Specifically, I’d like to map j
to gj
, as shown in the README, but only for Markdown.
I’ve tried a couple variants of the when
clause using, for example, resourceLangId == markdown
, but since that’s used for mappings (and not settings) it doesn’t seem to be an option.
Is what I’m trying to do even possible? I have several custom filetype mappings in Vim and would like to carry that approach over to VSCode.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:15
- Comments:15 (7 by maintainers)
Top Results From Across the Web
Mastering Key Bindings in Emacs
Binds a key to the local keymap used by the active buffer, unlike define-key which takes an explicit keymap to bind a key...
Read more >Set custom keybinding for specific Emacs mode - Stack Overflow
Though I know how to set a global key-binding in Emacs, I find it hard to even Google out the code for a...
Read more >The Emacs Guru Guide to Key Bindings - Wilfred Hughes
Emacs is a modal editor, so most key bindings are mode-specific. ... but these commands usually work in any programming language!
Read more >How to define mode-specific keys in evil-mode? [duplicate]
The standard way to set mode-specific keybindings in evil is to use: ;; default (define-key evil-insert-state-map (kbd "RET") ...
Read more >Visual Studio Code Key Bindings
Rich Languages Editing. Command, Key, Command id. Trigger Suggest, Ctrl+Space, editor.action.triggerSuggest.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
adding
editorLangId == <file_type>
atwhen
clause seems to be working now.e.g.
@jpoon you can get the file name though right? This would allow for people to have
ftdetect
style bindings. It is surprising this would not be on the roadmap for a vim emulator.