-
First, I know this is a workflow question and there is a simple solution of picking a different key/key combo to use as my prefix for Kitty, but I'm lazy and would like to avoid that if possible. That said, I am a long time tmux user that, like a lot of people, remapped the prefix key from Would it be possible to do the same within Kitty so I can use keybinds like Here are some examples keybinds to show what I am using it for:
I am open to better/cleaner ways to do this as well. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
I dont follow your question. You want to press ctrl+a twice to send the
ctrl+a key to the terminal program?
If so do:
map ctrl+a>ctrl+a send_key ctrl+a
https://sw.kovidgoyal.net/kitty/actions/#action-send_key
Although you should know kitty is a lot smarter than tmux, you can make
conditional mappings that only take effect when a particular program is
running or similar, see
https://sw.kovidgoyal.net/kitty/mapping/#conditional-mappings-depending-on-the-state-of-the-focused-window
|
Beta Was this translation helpful? Give feedback.
-
On Thu, May 08, 2025 at 09:24:35PM -0700, Adam Jimerson wrote:
Well it was more the other way around. So say I had neovim open and wanted to increment a number/date, so I press `ctrl+a` to do so. Now with neovim still open I want to launch a new split, so then I press `ctrl+a>n`. The problem is both Kitty and NeoVim have a keybind for `ctrl+a` but which one acts on it?
The solution with tmux was to make it so that `ctrl+a` just goes through and NeoVim can act on it, but `ctrl+a>ctrl+a` gets handled by tmux.
The conditional mapping feature looks promising, but not quite what I'm wanting, as it just unbinds if the set condition is true. If I could make it so that normally pressing `ctrl+a>n` launches a new split in Kitty, but if inside neovim, then I need to press `ctrl+a>ctrl+a>n` to open the split letting neovim still act on `ctrl+a`, that would work.
You cannot both have ctrl+a act as a shortcut and as a prefix, for
obvious reasons. The only way to implement that would be via a delay
so that if a leader key of a prefix mapping is not followed by another
key for some time, it gets treated as complete keypress. I could
implement that, but I dont see the point, it just means ctrl+a becomes
slow. Better to use orthogonal mappings.
|
Beta Was this translation helpful? Give feedback.
Yeah, that is why I was asking about reproducing the same workaround that I have with Tmux. I guess the easiest solution that doesn't involve massively rebuilding muscle memory would be to let Kitty handle
ctrl+a
events and use this keybinding for neovim:It's basically the reverse of my tmux+neovim solution but should work.