-
djmattyg007
How does one assign a keybind to "close tab"?
-
djmattyg007
Apparently I should be looking at "pane: close active item"? Which is annoying because it doesn't show up in a search for "close tab".
-
djmattyg007
It looks like it defaults to Ctrl+F4, which is impossible to type quickly and not at all what one expects coming from any other tabbed application.
-
djmattyg007
I tried setting the keybind to Ctrl+W, and I've somehow managed to wind up with two keybinds instead of just updating the original keybind. Ctrl+W still doesn't work to close a tab though.
-
djmattyg007
I've worked out how to search by keystroke, and apparently Ctrl+W is being hijacked by "editor: select larger syntax node". I tried deleting that keybind, but instead of deleting it, it's just introduced a new keybind for the same keystroke, with the action name "<null>". Ctrl+W still doesn't work to close a tab. I'm not sure how to fix this.
-
krig
The keybinding system is pretty complex, each keybind has a context which is hierarchical so it takes effect only in certain panes or if certain conditions hold: You’ll need to find the current Ctrl+W binding and either unbind it in the same context or make sure that you bind your binding in a more specific context.
-
djmattyg007
I tried unbinding the editor keybind, by selecting "delete", but it isn't doing what I expect. Instead of unbinding it completely, it's overriding it in the same context with a "null" action.
-
krig
But as just general advice, if you come in with this level of frustration at things like this you are going to have a bad time. There are hundreds of small decisions or differences compared to any editor you’re used to, and a lot of them we can’t change without breaking someone elses configuration
-
krig
yeah overriding in the same context with null is how you unset a binding
-
djmattyg007
What's the difference between the "Editor" context and the "Pane" context in the keybind system? How would I execute a keybind in the "Pane" context but not the "Editor" context?
-
krig
Editor is any view which accepts input so including popup windows etc., Pane is a view in the main area so not the side panels but anything that has a tab or can be a split. “Pane > Editor” would be any editor in a Pane, and "Editor && mode == full" excludes inline inputs in popups or side panels
-
krig
It’s explained here (but it’s complicated and the docs don’t explain everything): https://gram-editor.com/docs/key-bindings/
-
djmattyg007
Thank you. So what I had to do was edit the keybind for Ctrl+W on "pane: close active item" and change its context to "Editor". This didn't actually "edit" the original keybind, it just created a new keybind with a higher precedence. Closing tabs with Ctrl+W actually works now though 👍
-
krig
Great!
-
lemoi
does gram come with a cmdline binary? the gentoo ebuild does not install /usr/bin/gramcli or whatever
-
krig
usually the cli binary is installed as gram, and the actual editor as gram-editor or something like that. I suspect that’s the case for gentoo
-
lemoi
can confirm it gets installed in gram 3.2.0 from your overlay. It was not the case before IIRC
-
lemoi
@krig your work on gram is appreciated :)
-
krig
thank you!