Added tmux conf and script
This commit is contained in:
parent
a52725e7ea
commit
679415792e
17
.config/tmux/tmux-sessionizer-files
Executable file
17
.config/tmux/tmux-sessionizer-files
Executable file
@ -0,0 +1,17 @@
|
|||||||
|
#!/usr/bin/env zsh
|
||||||
|
|
||||||
|
selected=$(find ~/ -mindepth 2 -maxdepth 2 -type d | fzf)
|
||||||
|
|
||||||
|
selected_name=$(basename "$selected" | tr . _)
|
||||||
|
|
||||||
|
tmux has-session -t=$selected_name 2> /dev/null
|
||||||
|
|
||||||
|
if [[ $? -ne 0 ]]; then
|
||||||
|
TMUX='' tmux new-session -d -s "$selected_name" -c "$selected"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ -z "$TMUX" ]]; then
|
||||||
|
tmux attach -t "$selected_name"
|
||||||
|
else
|
||||||
|
tmux switch-client -t "$selected_name"
|
||||||
|
fi
|
17
.config/tmux/tmux-sessionizer-git
Executable file
17
.config/tmux/tmux-sessionizer-git
Executable file
@ -0,0 +1,17 @@
|
|||||||
|
#!/usr/bin/env zsh
|
||||||
|
|
||||||
|
selected=$(find ~/Projects/Private/ ~/Projects/Public/ -mindepth 1 -maxdepth 1 -type d | fzf)
|
||||||
|
|
||||||
|
selected_name=$(basename "$selected" | tr . _)
|
||||||
|
|
||||||
|
tmux has-session -t=$selected_name 2> /dev/null
|
||||||
|
|
||||||
|
if [[ $? -ne 0 ]]; then
|
||||||
|
TMUX='' tmux new-session -d -s "$selected_name" -c "$selected"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ -z "$TMUX" ]]; then
|
||||||
|
tmux attach -t "$selected_name"
|
||||||
|
else
|
||||||
|
tmux switch-client -t "$selected_name"
|
||||||
|
fi
|
43
.config/tmux/tmux.conf
Normal file
43
.config/tmux/tmux.conf
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
set -g default-terminal "screen-256color"
|
||||||
|
|
||||||
|
set -g prefix C-a
|
||||||
|
unbind C-b
|
||||||
|
bind-key C-a send-prefix
|
||||||
|
|
||||||
|
unbind %
|
||||||
|
bind - split-window -v
|
||||||
|
|
||||||
|
unbind '"'
|
||||||
|
bind _ split-window -h
|
||||||
|
|
||||||
|
bind -r j resize-pane -D 5
|
||||||
|
bind -r k resize-pane -U 5
|
||||||
|
bind -r h resize-pane -L 5
|
||||||
|
bind -r l resize-pane -R 5
|
||||||
|
|
||||||
|
bind -r m resize-pane -Z
|
||||||
|
|
||||||
|
set-window-option -g mode-keys vi
|
||||||
|
|
||||||
|
bind-key -T copy-mode-vi 'v' send -X begin-selection
|
||||||
|
bind-key -T copy-mode-vi 'y' send -X copy-selection
|
||||||
|
|
||||||
|
unbind -T copy-mode-vi MouseDragEnd1Pane
|
||||||
|
|
||||||
|
unbind r
|
||||||
|
bind -r r source-file ~/.config/tmux/tmux.conf
|
||||||
|
|
||||||
|
bind-key -r g run-shell -b "tmux neww ~/.config/tmux/tmux-sessionizer-git"
|
||||||
|
bind-key -r f run-shell -b "tmux neww ~/.config/tmux/tmux-sessionizer-files"
|
||||||
|
|
||||||
|
set -g @plugin 'tmux-plugins/tpm'
|
||||||
|
set -g @plugin 'christoomey/vim-tmux-navigator'
|
||||||
|
set -g @plugin 'wfxr/tmux-power'
|
||||||
|
set -g @plugin 'tmux-plugins/tmux-resurrect'
|
||||||
|
set -g @plugin 'tmux-plugins/tmux-continuum'
|
||||||
|
|
||||||
|
set -g @tmux_power_theme '#BD93F9'
|
||||||
|
set -g @resurrect-capture-pane-contents 'on'
|
||||||
|
set -g @continuum-restore 'on'
|
||||||
|
|
||||||
|
run '~/.config/tmux/plugins/tpm/tpm'
|
Loading…
x
Reference in New Issue
Block a user