-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtmux.conf
More file actions
90 lines (70 loc) · 2.91 KB
/
tmux.conf
File metadata and controls
90 lines (70 loc) · 2.91 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
# use zsh
set -g default-command /bin/zsh
set -g default-shell /bin/zsh
# Start windows numbering at 1 (instead of 0)
set -g base-index 1
set -g pane-base-index 1
# Visual settings
## Colors
set-window-option -g window-status-current-style bg=blue
# Enable mouse: scroll and activete panes
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
# bind vi key-mapping
set -g status-keys vi
setw -g mode-keys vi
# Enable CTRL+LEFT/RIGHT jumps between words.
set-window-option -g xterm-keys on
######## Bindings ########
# force a reload of the config file
bind r source-file ~/.tmux.conf \; display-message "Configuration reloaded"
# Working with unix clipboard (xclip required)
bind C-v run-shell -b "xclip -o | tmux load-bufter - ; tmux paste-buffer"
bind C-c run-shell -b "tmux save-buffer - | xclip -selection c"\; \
display-message "Buffer copied to clipboard."
# split windows and move to current path on new pane
unbind '"'
bind v split-window -h -c '#{pane_current_path}'
bind '"' split-window -v -c '#{pane_current_path}'
# navigate panes with hjkl
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
# resize panes like vim
bind -r H resize-pane -L 10
bind -r J resize-pane -D 10
bind -r K resize-pane -U 10
bind -r L resize-pane -R 10
# move window left/right
bind -r S-Left swap-window -t -1
bind -r S-Right swap-window -t +1
# Smart pane switching with awareness of vim splits
# See: https://github.com/christoomey/vim-tmux-navigator
is_vim='echo "#{pane_current_command}" | grep -iqE "(^|\/)g?(view|n?vim?x?)(diff)?$"'
bind -n C-h if-shell "$is_vim" "send-keys C-h" "select-pane -L"
bind -n C-j if-shell "$is_vim" "send-keys C-j" "select-pane -D"
bind -n C-k if-shell "$is_vim" "send-keys C-k" "select-pane -U"
bind -n C-l if-shell "$is_vim" "send-keys C-l" "select-pane -R"
bind -n C-\\ if-shell "$is_vim" "send-keys C-\\" "select-pane -l"
# Highlight window with activity
setw -g monitor-activity on
# Shortcut for synchronize-panes toggle
bind C-s set-window-option synchronize-panes
# Visual display when synchronize-panes toggle is on.
set-option -ag status-right '#{?pane_synchronized, #[bg=red]SYNC!#[default],}'
# List of plugins
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'
set -g @plugin 'tmux-plugins/tmux-urlview'
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run '~/.tmux/plugins/tpm/tpm'
source-file ~/.tmux/sessions.conf
# Fix VIM colors in TMUX.
# Source: https://gist.github.com/andersevenrud/015e61af2fd264371032763d4ed965b6
# This must be set after loading tmux-sensible plugin.
set -g default-terminal "tmux-256color"
set -ag terminal-overrides ",xterm-256color:RGB"
# set -sg terminal-overrides ",*:RGB"
# set -ag terminal-overrides ",$TERM:RGB"