Wouldn’t it be great if you could take your commands with you everywhere? Sure aliases are great but can you really put a price on the feeling of just getting the command you want when you are in a ssh session?

So here it is. Use tmux snippets. Your terminal remembers your commands for you.

Installation

Use tmux plugin manager tpm to install the plugin.

1
set -g @plugin 'nyuyuyu/tmux-pet'

Use prefix + I (Uppercase I) to install the plugin using TPM.

Then set the trigger key by setting the variable @tmux-new-pane-key

set -g @pet-new-pane-key 'C-f'

Detailed instructions are present in the nyuyuyu/tmux-pet repository.

The plugin depends on pet so install it.

Then you can use pet to manage your snippets. pet edit

And call the tmux plugin to insert your snippets.

Quickly fetch important info

I wanted to extend this a bit more. So I added another command to put the selected snippet into the clipboard. This way you can quickly fetch your snippet and paste it somewhere. You can save information that needs to be copied over and over like your address, email, profile links, etc.

Similar to the original plugin, install it using tpm.

1
set -g @plugin 'aayushprime/tmux-pet'

On this one, you can set the trigger key using the variable @tmux-pet-copy-key.

1
set -g @pet_new_pane_copy_key 'C-p'

Then the selected snippet will be copied to the clipboard! Yay!