-
Notifications
You must be signed in to change notification settings - Fork 0
/
tmux.conf
122 lines (96 loc) · 4.02 KB
/
tmux.conf
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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
# Synchronize panes and show a red indicator when ON
bind S setw synchronize-panes
setw -g window-status-current-format '#{?pane_synchronized,#[bg=red],}#I:#W'
setw -g window-status-format '#{?pane_synchronized,#[bg=red],}#I:#W'
#set -g default-terminal "tmux-256color"
set -g default-terminal "screen-256color"
# enable full colors if TERM outside is xterm-256color
# this is required for using nvim's :set termguicolors
set-option -sa terminal-overrides ',xterm-256color:RGB'
set-option -sa terminal-overrides ',screen-256color:RGB'
# set shell
set -g default-shell /bin/zsh
# set max history
set -g history-limit 100000
# Custom modifier key
set -g prefix C-Space
unbind-key C-b
bind-key C-Space send-prefix
# set escape time (time to wait after pressing Esc)
# to 10ms, this precents nvim delay with pressing Esc
# https://github.com/neovim/neovim/wiki/FAQ
set -sg escape-time 10
# To copy, left click and drag to highlight text in yellow,
# once you release left click yellow text will disappear and
# will automatically be available in clibboard
# without this mouse scroll will send up/down arrows
# instead of scrolling the terminal history
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 -n C-WheelUpPane select-pane -t= \; copy-mode -e \; send-keys -M
bind -T copy-mode-vi C-WheelUpPane send-keys -X halfpage-up
bind -T copy-mode-vi C-WheelDownPane send-keys -X halfpage-down
bind -T copy-mode-emacs C-WheelUpPane send-keys -X halfpage-up
bind -T copy-mode-emacs C-WheelDownPane send-keys -X halfpage-down
# disable scrolling tmux scrolling (not working)
#set -g terminal-overrides 'xterm*:smcup@:rmcup@'
# vi-like keybindings for pane navigation
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
# easy pane resize
bind-key J resize-pane -D
bind-key K resize-pane -U
bind-key H resize-pane -L
bind-key L resize-pane -R
bind -r left resize-pane -L 8
bind -r right resize-pane -R 8
bind -r up resize-pane -U 5
bind -r down resize-pane -D 5
# pane splits
# | - veritcal split
# " - horizontal split
bind | split-window -h -c "#{pane_current_path}"
bind '"' split-window -v -c "#{pane_current_path}"
# vi-like keybindings in copy mode
setw -g mode-keys vi
# 'p' to paste buffer
# 'V' to enter copy-mode:
# 'v' to start visual mode
# 'y' to yank text
unbind p
bind p paste-buffer
bind V copy-mode
bind-key -T copy-mode-vi 'v' send -X begin-selection
bind-key -T copy-mode-vi 'y' send -X copy-selection
# Update default binding of `Enter` to also use copy-pipe
unbind -T copy-mode-vi Enter
bind-key -T copy-mode-vi Enter send-keys -X copy-pipe-and-cancel "xclip -selection c"
bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel "xclip -in -selection clipboard"
# source our config the file with Prefix r
bind r source-file ~/.config/tmux/tmux.conf \; display "Reloaded `tmux.conf`"
# zenburn theme
setw -g clock-mode-colour colour117
# post tmux 1.9 need to use the below option
setw -g mode-style fg=colour117,bg=colour238,bold
set -g status-style bg=colour235,fg=colour248
set -g message-style fg=colour117,bg=colour235,bold
setw -g window-status-current-style fg=colour223,bg=colour237,bold
# fancy status line: user@host, date, time
set-option -g status-right "#(whoami)@#(uname -n) #[fg=colour187,bold]%a %Y-%m-%d %H:%M"
set -g status-right-length 50
set -g status-left-length 20
# tmux plugin manager
# git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm
# run <space-I> once to install the plugins
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'laktak/extrakto'
set -g @plugin 'seebi/tmux-colors-solarized'
set -g @colors-solarized 'dark'
set -g @extrakto_split_size 10
set -g @extrakto_copy_key "ctrl-y" # use tab to copy to clipboard
set -g @extrakto_insert_key "enter" # use enter to insert selection
set -g @extrakto_fzf_layout "reverse"
run -b '~/.config/tmux/plugins/tpm/tpm'