-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.tmux.conf
85 lines (71 loc) · 3.01 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
# Thanks to http://mutelight.org/practical-tmux
# and https://gist.github.com/anonymous/6bebae3eb9f7b972e6f0
# Changing the default prefix key because C-b is not acceptable, vi uses it
# If you're having problems with ubuntu and the alt prefix beeing swallowed
# most of the time do:
## install ccsm if you don't have it
#sudo apt-get install compizconfig-settings-manager
## open the compiz settings
#ccsm
#In the window that comes up, find the "Unity" plugin under the "Desktop"
#section. The very first item in there is "Key to show the HUD", which defaults
#to "". Click on the "" button and uncheck the "Enabled" box. Done!
# Taken from:
# http://askubuntu.com/questions/208329/why-does-gnome-terminal-swallow-some-of-my-alt-tmux-shortcuts
set-option -g prefix M-j
# Toggles current and last window
bind-key M-j last-window
# M-m to zoom current pane, easier to type than M-j-z
bind-key -n M-m resize-pane -Z
# Conf reload made easy
unbind-key r
bind-key r source-file ~/.tmux.conf \; display "Configuration reloaded!"
# Allows for faster key repetition
set-option -s escape-time 0
# Start windows and panes at 1, not 0
set -g base-index 1
set -g pane-base-index 1
# Raises the 2000 default limit
set-option -g history-limit 10000
# Status bar
# Highlighting current window using specified color
# https://misc.flogisoft.com/_media/bash/colors_format/256_colors_bg.png
set-option -g status-style fg=white,bg=black
set-window-option -g window-status-current-style fg=black,bg=green
# Easy-to-remember split pane commands
bind-key | split-window -h
bind-key - split-window -v
unbind-key '"'
unbind-key %
# vi friendly when in copy mode
set-option -g mode-keys vi
bind-key -Tcopy-mode-vi 'v' send -X begin-selection
bind-key -Tcopy-mode-vi 'y' send -X copy-selection
# Taken from https://github.com/junegunn/fzf/pull/582#issuecomment-377731826
# Smart pane switching with awareness of Vim splits and fzf.
# See: https://github.com/christoomey/vim-tmux-navigator
not_tmux="ps -o state= -o comm= -t '#{pane_tty}' | grep -iqE '^[^TXZ ]+ +(\\S+\\/)?(g?(view|n?vim?x?)(diff)?|fzf)$'"
bind-key -n C-h if-shell "$not_tmux" "send-keys C-h" "select-pane -L"
bind-key -n C-j if-shell "$not_tmux" "send-keys C-j" "select-pane -D"
bind-key -n C-k if-shell "$not_tmux" "send-keys C-k" "select-pane -U"
bind-key -n C-l if-shell "$not_tmux" "send-keys C-l" "select-pane -R"
# Restoring Clear Screen
bind l send-keys 'C-l'
# Moving between windows with vi movement keys
bind-key -n M-h select-window -t :-
bind-key -n M-l select-window -t :+
# Move current window left or right
bind-key M-h swap-window -d -t -1
bind-key M-l swap-window -d -t +1
# Resize panes made easy
# Alt + arrows work on gnome-terminal
bind-key -n M-Up resize-pane -U
bind-key -n M-Right resize-pane -R
bind-key -n M-Down resize-pane -D
bind-key -n M-Left resize-pane -L
# Control + arrows work on gnome-terminal and hyper
# It also makes Alt + arrows work on hyper
bind-key -n C-Up resize-pane -U
bind-key -n C-Right resize-pane -R
bind-key -n C-Down resize-pane -D
bind-key -n C-Left resize-pane -L