mirror of
https://github.com/jimeh/dotfiles.git
synced 2026-02-19 13:26:40 +00:00
98 lines
2.5 KiB
Bash
98 lines
2.5 KiB
Bash
# Prefix Key
|
|
unbind C-b
|
|
set -g prefix C-q
|
|
bind C-q send-prefix
|
|
|
|
# Settings
|
|
set -g default-terminal "screen-256color"
|
|
set -g detach-on-destroy on
|
|
set -g history-limit 50000
|
|
|
|
# Mouse support (pre Tmux 2.1)
|
|
if-shell -b '[ "$(echo "$(tmux -V | cut -c 6-) < 2.1" | bc)" = 1 ]' \
|
|
" \
|
|
set -g mode-mouse on; \
|
|
set -g mouse-resize-pane on; \
|
|
set -g mouse-select-pane on; \
|
|
set -g mouse-select-window on; \
|
|
"
|
|
|
|
# Mouse support (Tmux 2.1 and later)
|
|
# - scrolling behavior from: https://github.com/tmux/tmux/issues/145#issuecomment-151123624
|
|
if-shell -b '[ "$(echo "$(tmux -V | cut -c 6-) >= 2.1" | bc)" = 1 ]' \
|
|
" \
|
|
set -g mouse on; \
|
|
bind -n WheelUpPane if-shell -F -t = \"#{mouse_any_flag}\" \"send-keys -M\" \"if -Ft= '#{pane_in_mode}' 'send-keys -M' 'select-pane -t=; copy-mode -e; send-keys -M'\"; \
|
|
bind -n WheelDownPane select-pane -t= \\; send-keys -M; \
|
|
"
|
|
|
|
# Mac OS X fix for pbcopy, pbpaste, and launchctl. Requires:
|
|
# brew install reattach-to-user-namespace
|
|
if-shell -b '[ -n "$(command -v reattach-to-user-namespace)" ]' \
|
|
" \
|
|
set-option -g default-command 'reattach-to-user-namespace -l $SHELL'; \
|
|
"
|
|
|
|
# Set window notifications
|
|
setw -g monitor-activity on
|
|
set -g visual-activity off
|
|
|
|
# Keybindings
|
|
bind r source-file ~/.tmux.conf
|
|
|
|
# Ctrl versions of default keybindings
|
|
bind C-c new-window
|
|
bind C-n next-window
|
|
bind C-p previous-window
|
|
bind C-l last-window
|
|
bind C-s choose-session
|
|
bind C-w choose-window
|
|
bind C-k confirm-before kill-window
|
|
|
|
# Kill window
|
|
bind k confirm-before kill-window
|
|
|
|
# Split window into panes
|
|
bind h split-window -h
|
|
bind v split-window -v
|
|
bind C-h split-window -h
|
|
bind C-v split-window -v
|
|
|
|
unbind i
|
|
bind u display-message
|
|
bind i select-pane -t :.-
|
|
bind C-i select-pane -t :.-
|
|
bind C-o select-pane -t :.+
|
|
|
|
unbind Enter
|
|
bind Enter resize-pane -Z
|
|
bind C-Enter resize-pane -Z
|
|
|
|
# Use Alt-[j/i/l/k] keys without prefix key to switch panes.
|
|
bind -n M-j select-pane -L
|
|
bind -n M-k select-pane -D
|
|
bind -n M-i select-pane -U
|
|
bind -n M-l select-pane -R
|
|
|
|
# Toogle synchronize-panes without prefix key.
|
|
bind -n M-I setw synchronize-panes
|
|
|
|
#
|
|
# Plugins via TPM (https://github.com/tmux-plugins/tpm)
|
|
#
|
|
# Install TPM with:
|
|
#
|
|
# git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm
|
|
#
|
|
|
|
set -g @plugin 'jimeh/tmux-themepack'
|
|
set -g @plugin 'tmux-plugins/tpm'
|
|
set -g @plugin 'tmux-plugins/tmux-copycat'
|
|
set -g @plugin 'tmux-plugins/tmux-yank'
|
|
|
|
# Set Theme
|
|
set -g @themepack 'powerline/default/green'
|
|
|
|
# Init Plugin Manager
|
|
run "${HOME}/.tmux/plugins/tpm/tpm"
|