Added tmux config and scipts

This commit is contained in:
JirR02 2023-11-24 18:03:30 +01:00
parent a52725e7ea
commit a42ea0339c
3 changed files with 77 additions and 0 deletions

View 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

View 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
View 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'