Hacker News new | past | comments | ask | show | jobs | submit login

One feature I particularly like in emacs is "chord mode". You can bind double keystrokes to features, eg I have @@ to save file. I haven't noticed this available in other editors.



VS Code has this built in.

I personally have a set of ⌘N and ⌘W chords [0] for various creations and deletions. ⌘W S to close all saved files is a particular favourite; I don't really pay particular attention to my tabs anymore (just open on the filespace), which is one less thing to think about when coding.

[0] https://github.com/yunruse/.config/blob/zsh/vscode/keybindin...


VSCode doesn't have chords. I have no idea why would you link your config to this... Chords are sequences of keys (i.e. this includes releasing keys). Vi(m) do have chords for example though. I.e. a navigation command is usually a sequence of commands that is send to execution after the whole sequence have been entered. This means that the key-binding has a prefix (or multiple prefixes) and will be continued with the suffix. For example, in Vi "dw" is "delete" followed by "move one word forward", where "d" is the prefix and "w" is the suffix. But, "d" may be followed by many other things, all of which will be interpreted as deleting whatever's covered by the movement command. VSCode keyboard interaction simply doesn't work like that. It waits for the single keyboard event (which may involve modifier keys) and then dispatches it to the handler code. The later results in some feedback to the user rather than accumulation of command sequence for later processing.


In Vim you can do the same with key mapping. Like below, you have it for three different modes (normal, visual and insert):

nnoremap @@ :update<cr>

vnoremap @@ <c-c>:update<cr>gv

inoremap @@ <c-o>:update<cr>




Consider applying for YC's Summer 2025 batch! Applications are open till May 13

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: