GramEditor/gram
38
985
Fork
You've already forked gram
88

None keymap with vim keys #117

Closed
opened 2026年03月16日 23:06:04 +01:00 by tjk · 7 comments
Contributor
Copy link

(I'll admit that it was very tempting to name this something else)

The keybindings documentation clearly states that using "None" as the base keymap disables all key bindings. However, I wonder whether it would make more sense to still enable vim (or helix) bindings if one of those toggles is enabled rather than disabling everything.

What I had hoped for was to have vim keys usable (for text editing and general editor management, to the degree it's implemented) but no bindings from other editors, which I find to conflict/confuse a bit more than I'd like. What actually happens is that I can't use the editor because no keys do anything.

I believe the available workarounds would be (1) pick the least-conflicting base keymap and get used to that, or (2) use the None base keymap and have a user keymap with the vim keys. A downside of option 2 is that any improvements to the built-in vim-key support would not be inherited.

Does this make any sense? Am I missing an option that would allow for only vim keys?

_(I'll admit that it was very tempting to name this [something else](https://en.wikipedia.org/wiki/None_Pizza_with_Left_Beef))_ The keybindings [documentation](https://gram.liten.app/docs/key-bindings/) clearly states that using "None" as the base keymap disables _all_ key bindings. However, I wonder whether it would make more sense to still enable vim (or helix) bindings if one of those toggles is enabled rather than disabling _everything_. What I had hoped for was to have vim keys usable (for text editing and general editor management, to the degree it's implemented) but no bindings from other editors, which I find to conflict/confuse a bit more than I'd like. What actually happens is that I can't use the editor because no keys do anything. I believe the available workarounds would be (1) pick the least-conflicting base keymap and get used to that, or (2) use the None base keymap and have a user keymap with the vim keys. A downside of option 2 is that any improvements to the built-in vim-key support would not be inherited. Does this make any sense? Am I missing an option that would allow for only vim keys?
Owner
Copy link

I think your interpretation makes sense! At least the documentation does seem to be saying that None + vim should result in vim modal bindings only.

I think your interpretation makes sense! At least the documentation does seem to be saying that None + vim should result in vim modal bindings only.
Owner
Copy link

I think I've fixed this on main now, seems to work for me after some very quick testing :)

I think I've fixed this on main now, seems to work for me after some very quick testing :)
Author
Contributor
Copy link

Wow, thanks! I'll give it a shot.

Wow, thanks! I'll give it a shot.
Author
Contributor
Copy link

Thanks, that did work!

Unfortunately, since the rest of the code doesn't expect this combination, it breaks other things. For example, I couldn't find a way to close the action panel without using the mouse, and when in the keybinds window, I can type text into the filter bar but can't backspace or delete any of it. Stuff like that. Weird!

Maybe it's worth keeping this issue open at a low priority? Up to you, of course. I'll set another base keymap for now.

Thanks, that did work! Unfortunately, since the rest of the code doesn't expect this combination, it breaks other things. For example, I couldn't find a way to close the action panel without using the mouse, and when in the keybinds window, I can type text into the filter bar but can't backspace or delete any of it. Stuff like that. Weird! Maybe it's worth keeping this issue open at a low priority? Up to you, of course. I'll set another base keymap for now.
Author
Contributor
Copy link

Ah, I see. It didn't "break" things, per se, it's just that the default vim keymap assumes a lot of basic functionality has been set up by another keymap first. For example, backspace, enter, etc. while editing aren't there, along with escape to cancel out of menus, etc. Adding them to the user keymap works.

So, I see a couple of options:

  • Add the basics to the vim keymap. The downside of this would be potential conflicts with base keymaps, since those could have set up the basics in very different ways.
  • Create a new base keymap that sets up the basics for vim/helix mode, to ensure no conflicts. It could just be called "Vim/Helix".

I'm willing to work on a new base keymap if you think this approach makes sense. It may take a bit since I'm new to Gram and I see a lot of lines in the keymap files, but it seems like a worthwhile effort.

Ah, I see. It didn't "break" things, per se, it's just that the default vim keymap assumes a lot of basic functionality has been set up by another keymap first. For example, backspace, enter, etc. while editing aren't there, along with escape to cancel out of menus, etc. Adding them to the user keymap works. So, I see a couple of options: * Add the basics to the vim keymap. The downside of this would be potential conflicts with base keymaps, since those could have set up the basics in very different ways. * Create a new base keymap that sets up the basics for vim/helix mode, to ensure no conflicts. It could just be called "Vim/Helix". I'm willing to work on a new base keymap if you think this approach makes sense. It may take a bit since I'm new to Gram and I see a lot of lines in the keymap files, but it seems like a worthwhile effort.
Owner
Copy link

A new base keymap would make sense, yes! We could call it "Minimal", "Basic" or something like that.

A new base keymap would make sense, yes! We could call it "Minimal", "Basic" or something like that.
Author
Contributor
Copy link

I don't think I got this fully completed in #144. There are fewer key bindings, but still a bunch that aren't in minimal or vim. I think the default keymap (default-linux.jsonc, for me) is still being loaded before Gram considers any user-selected keymaps. I'll see if there's an unintrusive way of changing that.

I don't think I got this fully completed in #144. There are fewer key bindings, but still a bunch that aren't in minimal or vim. I think the default keymap (default-linux.jsonc, for me) is still being loaded before Gram considers any user-selected keymaps. I'll see if there's an unintrusive way of changing that.
Sign in to join this conversation.
No Branch/Tag specified
main
test/wgpu-on-mac
test-ci/failing-test-mac
test/failing-test-mac
test/build-on-22-04
test/wgpu-present-mode-mailbox
v2.1
test/altgr-fix-again
test/2.0.0-rc1
test/linux-build
test/objc2
v1.2.1
3.0.1
3.0.0
2.2.0
2.1.2
2.1.1
2.1.0
2.0.0
1.2.1
1.2.0
1.1.0
1.0.0
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
GramEditor/gram#117
Reference in a new issue
GramEditor/gram
No description provided.
Delete branch "%!s()"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?