feat(tmux): add tmux-ggclone and copy support for linux and mac
This commit is contained in:
		
							
								
								
									
										1
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										1
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							@@ -27,6 +27,7 @@ zsh/*
 | 
			
		||||
tmux/*
 | 
			
		||||
!tmux/tmux.conf
 | 
			
		||||
!tmux/tmux-sessionizer
 | 
			
		||||
!tmux/tmux-ggclone
 | 
			
		||||
 | 
			
		||||
# git
 | 
			
		||||
!git
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										15
									
								
								tmux/tmux-ggclone
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										15
									
								
								tmux/tmux-ggclone
									
									
									
									
									
										Executable 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"
 | 
			
		||||
 | 
			
		||||
@@ -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
 | 
			
		||||
 | 
			
		||||
# 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"
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user