-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtmux.conf
52 lines (41 loc) · 1.63 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
# SETTINGS #
unbind C-b
set -g prefix C-a
# Set window name to the current directory name.
setw -g window-status-format "#{pane_current_path}".
set -g default-terminal "xterm-256color"
# No delay for escape key press
set -sg escape-time 0
set -g repeat-time 0
set -g history-limit 10000
set -g mode-keys vi
set -g mouse on
set -g base-index 1
set -g renumber-windows on
# BINDINGS #
bind-key v split-window -h -c '#{pane_current_path}'
bind-key s split-window -v -c '#{pane_current_path}'
bind-key b break-pane -d
bind-key t choose-tree
bind-key x kill-pane
# 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}' \
| grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|n?vim?x?)(diff)?$'"
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 -n C-\ if-shell "$is_vim" "send-keys C-\\" "select-pane -l"
# Reload tmux config
bind r source-file ~/.tmux.conf \; display "Config reloaded! :)"
# bind resizing of panes to H,J,K,L (resizes by steps of 10 lines/columns)
bind -n C-Left resize-pane -L 10
bind -n C-Right resize-pane -R 10
bind -n C-Down resize-pane -D 2
bind -n C-Up resize-pane -U 2
# Use vim keybindings in copy mode
setw -g mode-keys vi
# Setup 'v' to begin selection as in Vim
bind-key -Tcopy-mode-vi 'v' send -X begin-selection
bind-key -Tcopy-mode-vi 'y' send -X copy-pipe-and-cancel "reattach-to-user-namespace pbcopy"