2020-09-20 05:22:17 +00:00
|
|
|
# split windows like vim
|
|
|
|
|
# vim's definition of a horizontal/vertical split is reversed from tmux's
|
|
|
|
|
bind s split-window -v -c "#{pane_current_path}"
|
|
|
|
|
bind v split-window -h -c "#{pane_current_path}"
|
|
|
|
|
|
|
|
|
|
# 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}' \
|
2021-07-08 08:03:27 +00:00
|
|
|
| grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|n?vim?x?)(diff)?$|emacs'"
|
2020-09-20 05:22:17 +00:00
|
|
|
bind-key -n C-h if-shell "$is_vim" "send-keys C-h" "select-pane -L"
|
|
|
|
|
bind-key -n C-j if-shell "$is_vim" "send-keys C-j" "select-pane -D"
|
|
|
|
|
bind-key -n C-k if-shell "$is_vim" "send-keys C-k" "select-pane -U"
|
|
|
|
|
bind-key -n C-l if-shell "$is_vim" "send-keys C-l" "select-pane -R"
|
|
|
|
|
bind-key -T copy-mode-vi C-h select-pane -L
|
|
|
|
|
bind-key -T copy-mode-vi C-j select-pane -D
|
|
|
|
|
bind-key -T copy-mode-vi C-k select-pane -U
|
|
|
|
|
bind-key -T copy-mode-vi C-l select-pane -R
|
|
|
|
|
|
|
|
|
|
#
|
|
|
|
|
# Set color term
|
|
|
|
|
#
|
2021-11-21 16:32:08 +00:00
|
|
|
set -g default-terminal "xterm-256color"
|
2020-09-20 05:22:17 +00:00
|
|
|
set-option -sg escape-time 10
|
2021-11-21 16:32:08 +00:00
|
|
|
set-option -ga terminal-overrides ",tmux-256color:Tc"
|
2020-09-20 05:22:17 +00:00
|
|
|
|
|
|
|
|
#
|
|
|
|
|
# Set long history
|
|
|
|
|
#
|
|
|
|
|
set-option -g history-limit 5000
|
|
|
|
|
|
|
|
|
|
# resize panes like vim
|
|
|
|
|
# feel free to change the "1" to however many lines you want to resize by, only
|
|
|
|
|
# one at a time can be slow
|
|
|
|
|
bind < resize-pane -L 1
|
|
|
|
|
bind > resize-pane -R 1
|
|
|
|
|
bind - resize-pane -D 1
|
|
|
|
|
bind + resize-pane -U 1
|
|
|
|
|
|
2022-12-22 19:52:56 +00:00
|
|
|
# Setup window switching via fzf
|
|
|
|
|
bind-key f run-shell -b ~/.local/bin/tmux-switch-pane
|
|
|
|
|
|
2020-09-20 05:22:17 +00:00
|
|
|
# bind : to command-prompt like vim
|
|
|
|
|
# this is the default in tmux already
|
|
|
|
|
bind : command-prompt
|
|
|
|
|
|
|
|
|
|
# vi-style controls for copy mode
|
|
|
|
|
setw -g mode-keys vi
|
|
|
|
|
|
|
|
|
|
# set windows so they dont resize to the smallest
|
|
|
|
|
setw -g aggressive-resize on
|
|
|
|
|
|
|
|
|
|
# use mouse on
|
|
|
|
|
set -g mouse on
|
|
|
|
|
set-option -g mouse on
|
|
|
|
|
|
|
|
|
|
set -g @open-S 'https://www.duckduckgo.com/'
|
2020-11-04 20:15:44 +00:00
|
|
|
set -g @open-editor-command 'emacs --no-wait'
|
2020-09-20 05:22:17 +00:00
|
|
|
|
|
|
|
|
# Init plugins
|
|
|
|
|
run-shell ~/.tmux/plugins/tmux-copycat/copycat.tmux
|
|
|
|
|
run-shell ~/.tmux/plugins/tmux-open/open.tmux
|
|
|
|
|
run-shell ~/.tmux/plugins/tmux-yank/yank.tmux
|
|
|
|
|
|
|
|
|
|
# Automatically renumber window numbers on closing a pane (tmux >= 1.7).
|
|
|
|
|
set -g renumber-windows on
|
|
|
|
|
|
|
|
|
|
# Stay in copy mode on drag end.
|
|
|
|
|
# (Would use `bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X
|
|
|
|
|
# stop-selection` but it is a bit glitchy.)
|
|
|
|
|
unbind-key -T copy-mode-vi MouseDragEnd1Pane
|
|
|
|
|
|
|
|
|
|
# Search back to last prompt.
|
|
|
|
|
bind-key b copy-mode\; send-keys -X start-of-line\; send-keys -X search-backward "⇒"\; send-keys -X next-word
|
|
|
|
|
|
|
|
|
|
# Set `v` key to start selection like vim
|
|
|
|
|
bind-key -T copy-mode-vi 'v' send -X begin-selection
|
|
|
|
|
|
|
|
|
|
# Start window and pane numbering at 1, (0 is too hard to reach).
|
|
|
|
|
set -g base-index 1
|
|
|
|
|
set -g pane-base-index 1
|
|
|
|
|
|
|
|
|
|
# Needed as on tmux 1.9 and up (defaults to off).
|
|
|
|
|
# Added in tmux commit c7a121cfc0137c907b7bfb.
|
|
|
|
|
# Also need by vim plugin tmux-focus-events.vim
|
|
|
|
|
set -g focus-events on
|
|
|
|
|
|
2022-09-08 19:30:35 +00:00
|
|
|
# Github colors for Tmux
|
|
|
|
|
#https://github.com/projekt0n/github-theme-contrib/blob/main/tmux/github_light.confhttps://github.com/projekt0n/github-theme-contrib/blob/main/tmux/github_light.confhttps://github.com/projekt0n/github-theme-contrib/blob/main/tmux/github_light.conf
|
2020-09-20 05:22:17 +00:00
|
|
|
|
2022-10-01 10:42:10 +00:00
|
|
|
## set status bar
|
|
|
|
|
set -g status-style bg=default
|
|
|
|
|
setw -g window-status-current-style bg="#282a2e"
|
|
|
|
|
setw -g window-status-current-style fg="#81a2be"
|
|
|
|
|
|
|
|
|
|
## highlight active window
|
|
|
|
|
setw -g window-style 'bg=#282a2e'
|
|
|
|
|
setw -g window-active-style 'bg=#1d1f21'
|
|
|
|
|
setw -g pane-active-border-style ''
|
|
|
|
|
|
|
|
|
|
## highlight activity in status bar
|
|
|
|
|
setw -g window-status-activity-style fg="#8abeb7"
|
|
|
|
|
setw -g window-status-activity-style bg="#1d1f21"
|
|
|
|
|
|
|
|
|
|
## pane border and colors
|
|
|
|
|
set -g pane-active-border-style bg=default
|
|
|
|
|
set -g pane-active-border-style fg="#373b41"
|
|
|
|
|
set -g pane-border-style bg=default
|
|
|
|
|
set -g pane-border-style fg="#373b41"
|
|
|
|
|
|
|
|
|
|
set -g clock-mode-colour "#81a2be"
|
|
|
|
|
set -g clock-mode-style 24
|
|
|
|
|
|
|
|
|
|
set -g message-style bg="#8abeb7"
|
|
|
|
|
set -g message-style fg="#000000"
|
|
|
|
|
|
|
|
|
|
set -g message-command-style bg="#8abeb7"
|
|
|
|
|
set -g message-command-style fg="#000000"
|
|
|
|
|
|
|
|
|
|
# message bar or "prompt"
|
|
|
|
|
set -g message-style bg="#2d2d2d"
|
|
|
|
|
set -g message-style fg="#cc99cc"
|
|
|
|
|
|
|
|
|
|
set -g mode-style bg="#1d1f21"
|
|
|
|
|
set -g mode-style fg="#de935f"
|
|
|
|
|
|
|
|
|
|
# right side of status bar holds "[host name] (date time)"
|
|
|
|
|
set -g status-right-length 100
|
|
|
|
|
set -g status-right-style fg=black
|
|
|
|
|
set -g status-right-style bold
|
|
|
|
|
set -g status-right '#[fg=#f99157,bg=#2d2d2d] %H:%M |#[fg=#6699cc] %y.%m.%d '
|
|
|
|
|
|
|
|
|
|
# make background window look like white tab
|
|
|
|
|
set-window-option -g window-status-style bg=default
|
|
|
|
|
set-window-option -g window-status-style fg=white
|
|
|
|
|
set-window-option -g window-status-style none
|
|
|
|
|
set-window-option -g window-status-format '#[fg=#6699cc,bg=colour235] #I #[fg=#999999,bg=#2d2d2d] #W #[default]'
|
|
|
|
|
|
|
|
|
|
# make foreground window look like bold yellow foreground tab
|
|
|
|
|
set-window-option -g window-status-current-style none
|
|
|
|
|
set-window-option -g window-status-current-format '#[fg=#f99157,bg=#2d2d2d] #I #[fg=#cccccc,bg=#393939] #W #[default]'
|
|
|
|
|
|
|
|
|
|
# active terminal yellow border, non-active white
|
|
|
|
|
set -g pane-border-style bg=default
|
|
|
|
|
set -g pane-border-style fg="#999999"
|
|
|
|
|
set -g pane-active-border-style fg="#f99157"
|