Repository navigation
VIM key bindings in editor #371
Replies: 13 comments 4 replies
|
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. |
|
@tconbeer Thank you for building this. I will be watching closely for vim mode! |
|
@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. |
|
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! |
|
@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 ( |
|
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. |
|
@tconbeer looks like textualize has the keymap functionality you were waiting for. |
|
@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? |
This comment was marked as spam.
This comment was marked as spam.
This comment was marked as spam.
This comment was marked as spam.
|
Literally the only thing stopping from maining Harley. You could start pushing hot garbage after this and I would still deal with it and defend this project. The bare minimum I need is:
In normal mode, you have key mappings to move the cursor between windows, and key mappings to move the cursor around the text inside of a window. For the former, I would just copy over my VIM key maps to navigate vertical/horizontal splits. For the latter, support for the billions of ways to move the cursor would be nice, but I'd cope with smashing |
|
FWIW, this could potentially be covered by implementing #770 and opening the current text buffer in |
|
I have raised a PR for this feature, you can review it here: #977 |

Uh oh!
There was an error while loading. Please reload this page.
Is there a way to set the editor to use VIM config?
All reactions