feat(tmux): add tmux-ggclone and copy support for linux and mac

This commit is contained in:
Matej Janezic 2024-01-25 19:52:31 +01:00
parent f1e8dc27e5
commit afc6af93ca
Signed by: janezicmatej
GPG Key ID: 4298E230ED37B2C0
3 changed files with 27 additions and 2 deletions

1
.gitignore vendored
View File

@ -27,6 +27,7 @@ zsh/*
tmux/*
!tmux/tmux.conf
!tmux/tmux-sessionizer
!tmux/tmux-ggclone
# git
!git

15
tmux/tmux-ggclone Executable file
View File

@ -0,0 +1,15 @@
#!/usr/bin/env bash
if [[ $# -eq 1 ]]; then
selected=$1
else
read -p "ssh url: " selected
fi
if [[ -z $selected ]]; then
exit 0
fi
ggman clone "$selected"
find -L $GGROOT -mindepth 1 -maxdepth 5 -type d -name .git -prune | xargs -n 1 dirname > "$GGROOT/compiled"

View File

@ -15,7 +15,15 @@ set -g status-left-length 30
set-window-option -g mode-keys vi
bind -T copy-mode-vi v send-keys -X begin-selection
bind -T copy-mode-vi y send-keys -X copy-pipe-and-cancel 'pbcopy'
# differentiate copy on linux and max
if-shell -b '[ "$(uname -s)" = "Linux" ]' {
bind -T copy-mode-vi y send-keys -X copy-pipe-and-cancel 'xclip -in -selection clipboard'
}
if-shell -b '[ "$(uname -s)" = "Darwin" ]' {
bind -T copy-mode-vi y send-keys -X copy-pipe-and-cancel 'pbcopy'
}
# vim-like pane switching
bind -r ^ last-window
@ -29,6 +37,7 @@ bind -r t neww -c "~" "nvim ~/.TODO.md"
bind-key -r f run-shell "tmux neww ~/.config/tmux/tmux-sessionizer"
bind-key -r g run-shell "tmux neww ~/.config/tmux/tmux-sessionizer $XDG_CONFIG_HOME"
bind-key -r T run-shell "tmux neww ~/.config/tmux/tmux-sessionizer ~/Desktop/temp"
bind-key -r T run-shell "tmux neww ~/.config/tmux/tmux-sessionizer ~/temp"
bind-key -r R run-shell "tmux neww ~/.config/tmux/tmux-sessionizer ~"
bind-key -r G run-shell "tmux neww ~/.config/tmux/tmux-ggclone"