dotfiles/.tmux.conf##default

86 lines
2.8 KiB
Plaintext
Raw Normal View History

# plugins
set -g @plugin 'alexghergh/nvim-tmux-navigation'
run '~/.tmux/plugins/tpm/tpm'
2016-12-15 00:30:09 -05:00
# remap prefix from 'C-b' to 'C-a'
unbind C-b
set-option -g prefix C-a
bind-key C-a send-prefix
# Enable mouse control (clickable windows, panes, resizable panes)
set -g mouse on
# Initialize sesions
bind W source-file ~/.tmux/work
2016-12-15 00:30:09 -05:00
# reload config
bind r source-file ~/.tmux.conf \; display-message "Config reloaded..."
# spliting windoww
unbind %
unbind '"'
2024-01-25 15:53:20 -05:00
bind | split-window -h -c "#{pane_current_path}"
bind - split-window -v -c "#{pane_current_path}"
2016-12-15 00:30:09 -05:00
# sync panes
2023-06-07 04:27:23 -04:00
unbind b
bind b setw synchronize-panes
2023-06-07 04:27:23 -04:00
2023-06-15 08:13:09 -04:00
# reset working dir for session
unbind h
bind h attach-session -t . -c "#{pane_current_path}"
2016-12-15 00:30:09 -05:00
# status bar
2024-02-11 01:06:41 -05:00
set -g status-right '#[fg=black]◢#[bg=black fg=colour135] %H:%M #[fg=default]%b %d %Y '
2024-01-29 08:50:46 -05:00
if-shell 'test "$(acpi -t)"' {
2024-02-11 01:06:41 -05:00
set -g status-right '#[fg=black]◢#[bg=black fg=colour135] %H:%M #[fg=default]%b %d %Y #[fg=pink] ♥#(acpi | cut -d ',' -f 2) '
2024-02-02 13:26:43 -05:00
}
# Start windows and panes at 1, not 0
set -g base-index 1
set -g pane-base-index 1
set-window-option -g pane-base-index 1
set-option -g renumber-windows on
2024-02-03 18:11:25 -05:00
# Smart pane switching with awareness of Vim splits.
# See: https://github.com/christoomey/vim-tmux-navigator
is_vim="ps -o state= -o comm= -t '#{pane_tty}' \
| grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|l?n?vim?x?|fzf)(diff)?$'"
2024-02-03 21:28:55 -05:00
bind-key -n -r 'C-h' if-shell "${is_vim}" 'send-keys C-h' 'select-pane -L'
bind-key -n -r 'C-j' if-shell "${is_vim}" 'send-keys C-j' 'select-pane -D'
bind-key -n -r 'C-k' if-shell "${is_vim}" 'send-keys C-k' 'select-pane -U'
bind-key -n -r 'C-l' if-shell "${is_vim}" 'send-keys C-l' 'select-pane -R'
2024-02-03 18:11:25 -05:00
if-shell -b '[ "$(echo "$tmux_version < 3.0" | bc)" = 1 ]' \
"bind-key -n 'C-\\' if-shell \"$is_vim\" 'send-keys C-\\' 'select-pane -l'"
if-shell -b '[ "$(echo "$tmux_version >= 3.0" | bc)" = 1 ]' \
"bind-key -n 'C-\\' if-shell \"$is_vim\" 'send-keys C-\\\\' 'select-pane -l'"
2024-01-28 03:25:15 -05:00
# resize
bind-key -r -T prefix M-k resize-pane -U
bind-key -r -T prefix M-j resize-pane -D
bind-key -r -T prefix M-h resize-pane -L
bind-key -r -T prefix M-l resize-pane -R
2024-02-03 21:28:55 -05:00
bind-key -r -T prefix k select-pane -U
bind-key -r -T prefix j select-pane -D
bind-key -r -T prefix h select-pane -L
bind-key -r -T prefix l select-pane -R
2024-02-03 18:11:25 -05:00
bind C-l send-keys 'C-l'
2024-02-02 13:24:46 -05:00
set-option -g allow-passthrough on
2024-02-10 15:53:14 -05:00
set -g default-terminal "screen-256color"
2024-02-02 13:24:46 -05:00
2024-02-03 21:28:55 -05:00
# status and culors
2024-02-02 13:24:46 -05:00
set -g status-left-length 85
2024-02-11 01:06:41 -05:00
set -g status-left "#[bg=black]#[fg=#(pomodoro tmux-color)]#(pomodoro status -f ' %!r') #[fg=default]working on#[fg=colour135] #S#[bg=default fg=black]◣"
2024-02-02 13:24:46 -05:00
set -g window-status-current-format "#[fg=colour135]#W"
set -g status-style bg=default
2024-02-03 18:11:25 -05:00
set -g pane-active-border-style fg=colour135
set -g status-justify centre
2024-02-05 15:13:27 -05:00
set-option -g status-interval 1
2024-02-03 21:28:55 -05:00
set-option -g clock-mode-color colour135
set-option -g message-style fg=colour135,bg=black