forked from paulirish/dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.tmux.conf
100 lines (72 loc) · 3.13 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
# unbind default prefix and set it to Ctrl+a
unbind C-b
set -g prefix C-a
bind C-a send-prefix
# Act like Vim
set-window-option -g mode-keys vi
bind-key h select-pane -L
bind-key j select-pane -D
bind-key k select-pane -U
bind-key l select-pane -R
# Look good
set-option -g default-terminal "screen-256color"
set-option -sa terminal-features "xterm-kitty:RGB"
# Enable mouse support (works in iTerm)
set-window-option -g mouse on
# This is important to enable the mouse scrolling
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
# set up layouts
# set main-pane-width 130
# scrollback buffer size increase
set -g history-limit 500000
# C-a C-b will swap to last used window
bind-key C-b last-window
# Start tab numbering at 1
set -g base-index 1
# Allows for faster key repetition
set -s escape-time 0
# use different keys to split vertical and horizonal
bind | split-window -h -c "#{pane_current_path}"
bind - split-window -v -c "#{pane_current_path}"
# Change cursor in vim to distinguish between insert and command mode
# Use in conjunciton with tmux-cursors.vim
set-option -g terminal-overrides '*88col*:colors=88,*256col*:colors=256,xterm*:XT:Ms=\E]52;%p1%s;%p2%s\007:Cc=\E]12;%p1%s\007:Cr=\E]112\007:Cs=\E]50;CursorShape=%?%p1%{3}%<%t%{0}%e%p1%{2}%-%;%d\007'
# reload config file
bind r source-file ~/.tmux.conf \; display "Config Reloaded!"
# Use vim keybindings in copy mode
setw -g mode-keys vi
# set vi mode for copy mode
setw -g mode-keys vi
# more settings to make copy-mode more vim-like
bind -T copy-mode-vi C-v send -X rectangle-toggle
bind -T copy-mode-vi v send -X begin-selection
bind -T copy-mode-vi y send -X copy-selection_and_cancel
bind -T copy-mode-vi Escape send -X cancel
bind-key -T copy-mode-vi Enter send -X copy-pipe-and-cancel "xclip -sel clip -i"
bind-key -T copy-mode-vi y send -X copy-pipe-and-cancel "xclip -sel clip -i"
# Increase the time for displaying the pane numbers
set -g display-panes-time 2000 #2s
# Start the numbers for panes with 1
set -g pane-base-index 1
# set default path for new windows
bind c new-window -c '#{pane_current_path}'
# You've to clone the powerline project before from https://github.com/powerline/powerline.git
source ~/.tmux/powerline.conf
# Add plugin resurrect
set -g @plugin 'tmux-plugins/tmux-resurrect'
# Initialize TMUX plugin manager (git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm)
run '~/.tmux/plugins/tpm/tpm'
# set default path for new windows
bind c new-window -c '#{pane_current_path}'
# Move current window to left or right
bind-key -n C-S-Left swap-window -t -1
bind-key -n C-S-Right swap-window -t +1
# Bind special key to clear to tmux history
bind-key C-S-L clear-history
# Create a new window with predefined panes
bind-key F2 split-window -v -p 25 -c '#{pane_current_path}' \; split-window -h -p 50 -c '#{pane_current_path}' -t 2 \; select-pane -t 1
# Please don't rename the window names after I named it manually
set-option -g allow-rename off
# Required for support in nvim
set-option -g focus-events on