Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suggestion: Fix tmux-sessionizer keybinding #64

Open
opera-duanei opened this issue Mar 26, 2024 · 1 comment
Open

Suggestion: Fix tmux-sessionizer keybinding #64

opera-duanei opened this issue Mar 26, 2024 · 1 comment

Comments

@opera-duanei
Copy link

Hey @ThePrimeagen! Just came from the frontend masters course. Couldn't stand that the

bindkey -s ^f "tmux-sessionizer\n"

binding appends to whatever is already on the input.

This seems to do the trick (on mac at least)

bindkey -s '^f' "^Qtmux-sessionizer\n"

Whatever was on the terminal before will be added back when you exit tmux

Couldn't find anywhere what ^q actually does, but it seems to remove the input, let you run one command and then add back the input!

@wadegbow
Copy link

wadegbow commented Mar 29, 2024

Another method is to create an zsh nle (new line editor) widget, it's a bit more text but has the benefit of not actually typing out tmux-sessionizer into the terminal, which was bugging me.

example:

session-widget() { tmux-sessionizer }
zle -N session-widget
bindkey ^f session-widget

Edit: just fyi ^Q is running the zsh push-line widget, you could also use ^U kill-whole-line if you dont care about getting what you had typed back. More info: https://zsh.sourceforge.io/Doc/Release/Zsh-Line-Editor.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants