-
Notifications
You must be signed in to change notification settings - Fork 201
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 Request: VIM keymap #24
Comments
codemirror has a vim mode https://codemirror.net/5/demo/vim.html should be "easy" to implement Lines 24 to 30 in a871291
It might be possible to just import vim.js instead of emacs.js. |
I'd like to have this. Implementing it should probably start with some refactoring. My Emacs keymap (it's actually just the subset of the Emacs keybindings I happen to be using) is currently a bit of a duct tape implementation. Commands should be more formalized into an internal API, and once that is in place it would be nice to have a proper UI for customizing the mapped keys. There are implementation details that will make it non-trivial. E.g. we can't trigger copy/cut/paste commands from within the renderer so there's currently code in the Electron main process that listens for those keys (https://github.com/heyman/heynote/blob/main/electron/keymap.js). Should be solvable though. |
Would love to see it :) |
bump! |
From the draft PR:
It would be nice to simply "extend" the operators, so I've asked about a potential API change to the vim dependency that will hopefully allow us to make the operator aware of block state. @heyman let me know if you'd be open to this type of implementation. If the replit/codemirror-vim maintainers don't like the EDIT: I am perhaps going to go another direction with this, but hopefully a PR soon! |
I saw the comment on your proposal suggesting to use
This was fixed by #133, so now all code related to the Emacs keybindings at least reside in the renderer process. |
@heyman yeah that's kind of my thinking - if we find ourselves in "the middle" of a block separator (i.e. "\n") we might already know that we need to offset the entire separator in any case, thanks for the insight! hopefully can get some time this weekend to tinker with it |
Please include VIM key mapping!
The text was updated successfully, but these errors were encountered: