diff --git a/.gitignore b/.gitignore index 3a79db0..8c05a0d 100644 --- a/.gitignore +++ b/.gitignore @@ -27,6 +27,7 @@ zsh/* tmux/* !tmux/tmux.conf !tmux/tmux-sessionizer +!tmux/tmux-ggclone # git !git diff --git a/tmux/tmux-ggclone b/tmux/tmux-ggclone new file mode 100755 index 0000000..ca202b3 --- /dev/null +++ b/tmux/tmux-ggclone @@ -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" + diff --git a/tmux/tmux.conf b/tmux/tmux.conf index 3c3ce00..989e659 100644 --- a/tmux/tmux.conf +++ b/tmux/tmux.conf @@ -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"