VIM key bindings in editor #371
Replies: 8 comments 1 reply
-
Not currently. I'd like to add an option in the future. Can you (or someone) please compile a list of modes and bindings? I'm not a vim user. |
Beta Was this translation helpful? Give feedback.
-
@tconbeer Thank you for building this. I will be watching closely for vim mode! |
Beta Was this translation helpful? Give feedback.
-
@tconbeer this is the official list, but I'm sure there's a subset of commands that would work and would be a good start. |
Beta Was this translation helpful? Give feedback.
-
Big update in this realm: configurable key bindings just shipped with v1.22.0. See the docs: https://harlequin.sh/docs/keymaps/index However, supporting Vim motions requires a LOT more work, since Textual bindings don't natively support multiple key presses (and a host of other challenges). If anyone has Vim-ish bindings that they are able to configure post-v1.22, please share your config here (or distribute those as a plug-in). Thanks! |
Beta Was this translation helpful? Give feedback.
-
@tconbeer, I'm not at all a Vim power user, but as I see it, implementing at a minimum Normal and Insert modes will be a requirement for users to configure their own Vim-ish bindings. Currently it seems not possible to implement Vim bindings because many commands are single keypresses in Normal mode, and in Harlequin you'll want to treat those single keypresses as editing the active buffer (like If you could implement a toggle for those two modes, the community could probably do more here with building the keymap as a plugin. Here's how a basic set of commands could work. This wouldn't require adding any new commands, just mapping keys differently while in Normal mode. In Normal Mode:
In Insert Mode:
You're right that you'll still need multi-keypress support to support motions like delete word ( |
Beta Was this translation helpful? Give feedback.
-
The major modes that I want to see implemented are normal mode where basic navigation happens, visual mode which allows you to select blocks of text, and insert mode which allows you to actually type information into the editor. There is also replace mode which is similar to insert mode but it is for replacing content. Less important, but would still be command mode which allows you to type in custom commands and functions. This can allow you to run commands that you don't have keybinds for (like opening a file or directory, connecting to a database, refreshing a folder/bucket) If at the very least, navigational/normal mode could be implemented it would be a huge improvement in terms of usability. |
Beta Was this translation helpful? Give feedback.
-
@tconbeer looks like textualize has the keymap functionality you were waiting for. |
Beta Was this translation helpful? Give feedback.
-
@tconbeer , got myself a programmable keyboard and trying hard to get keybindings set in the spirit of Vim. And feeling only partially successful; dealing with what feels like bugs, but maybe I'm missing something. For example:
Some of these overrides work, and others don't. I've ensured there aren't any duplicates in both my I could provide specifics if needed, but I'm having to result to default mappings (vscode) and keyboard layer programming - which works but is a hassle and requires holding layer-mode keys in Normal/Visual. Any thoughts/guidance? |
Beta Was this translation helpful? Give feedback.
-
Is there a way to set the editor to use VIM config?
Beta Was this translation helpful? Give feedback.
All reactions