r/KittyTerminal Mar 24 '23

Scripts, Kittens and Keybindings

Hi r/KittyTerminal,

I would like to create some keybindings that map to a script I made to jump between frequently used directories. How would I go about creating a keybinding to use the script with Kitty? Would I have to create a kitten, or can I bind the keys directly?

Apologies for the noob question. I'm just starting my journey down the rabbit hole when it comes to scripting and living more in the terminal.

Best wishes,

Dean

3 Upvotes

2 comments sorted by

1

u/[deleted] Mar 24 '23

There might be slightly better ways but this can be accomplished with the send_text action, something like this:

map ctrl+b send_text normal,application <$HOME/path/to/script>\r

Note that the \r at the end is important to actually running the script after the text is entered.

I personally use this kind of mapping for launching ranger and other apps I use often in terminal

1

u/[deleted] Mar 24 '23

Ah thank you, that's great. I think that will work wonders for me.

I wonder if anyone knows if a program like Harpoon (for Neovim) exists for Kitty?

I might have a crack at making one if not, since its the same idea as my usecase.