diff options
author | eug-vs <eugene@eug-vs.xyz> | 2021-12-17 10:37:51 +0300 |
---|---|---|
committer | eug-vs <eugene@eug-vs.xyz> | 2021-12-17 10:37:51 +0300 |
commit | 7b6291b3826fa44ee6aa29220457c3b0e812b050 (patch) | |
tree | e6deac333a055d507b1151b1b8641d5a152f4c53 /zsh | |
parent | 24000f6052a2c87bde8f9baa82e35a90e3118917 (diff) | |
download | dotfiles-7b6291b3826fa44ee6aa29220457c3b0e812b050.tar.gz |
feat(zsh): add keybindings for tmux management
Diffstat (limited to 'zsh')
-rw-r--r-- | zsh/.zshrc | 24 |
1 files changed, 24 insertions, 0 deletions
@@ -41,5 +41,29 @@ export NVM_DIR="$HOME/.nvm" [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" --no-use # This loads nvm [ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion +# Functions +function fzf-tmux-project() { + find "$HOME/Documents/Projects" -type d -exec test -e '{}/.git' ';' -print -prune | fzf --height 20% -m | while read root; do + name=$(basename "$root") + echo Starting $name + tmuxinator start --no-attach -p=$HOME/.config/tmuxinator/.template.yml name=$name root=$root 2>/dev/null + done; + zle accept-line +} + +function fzf-kill-tmux-project() { + tmux ls -F "#{session_name}" | fzf --height 20% -m | while read session; do + tmux kill-session -t $session + done; + zle accept-line +} + +zle -N fzf-tmux-project +bindkey '^y' fzf-tmux-project + +zle -N fzf-kill-tmux-project +bindkey '^x' fzf-kill-tmux-project + + # Syntax highlighting, must be last source /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh 2> /dev/null |