-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.tmux.conf
113 lines (94 loc) · 4.08 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
# set default shell
set-option -g default-shell /bin/zsh
set-option -g prefix C-a
# Vi copypaste mode
set-window-option -g mode-keys vi
bind-key -t vi-copy v begin-selection
# works for osx, linux should use "xclip -in -selection clipboard" instead of pbcopy
# Can use "tmux list-keys -t vi-copy" to show all keybindings in copy mode
bind-key -t vi-copy y copy-pipe "pbcopy"
############################################################################
# Global options
############################################################################
# large history
set-option -g history-limit 10000
# colors
setw -g mode-bg black
set-option -g default-terminal "screen-256color" #"xterm-256color" # "screen-256color"
set-option -g pane-active-border-fg green
# utf8 support
set-window-option -g utf8 on
# basic settings
set-window-option -g xterm-keys on # for vim
set-window-option -g mode-keys vi # vi key
set-window-option -g monitor-activity on
set-window-option -g window-status-current-fg white
setw -g window-status-current-attr reverse
# Automatically set window title
#setw -g automatic-rename
#set-window-option -g automatic-rename off
#set-option -g set-titles off
# use mouse # More on mouse support http://floriancrouzat.net/2010/07/run-tmux-with-mouse-support-in-mac-os-x-terminal-app/
#setw -g mode-mouse on
#setw -g mouse-resize-pane on
#set -g mouse-select-window on
#set -g mouse-select-pane on
set -g terminal-overrides 'xterm*:smcup@:rmcup@'
###########################################################################
# Status Bar
############################################################################
set-option -g status-utf8 on
set-option -g status-justify right
set-option -g status-bg black # colour213 # pink
set-option -g status-fg cyan
set-option -g status-interval 5
set-option -g status-left-length 30
set-option -g status-left '#[fg=magenta]» #[fg=blue,bold]#T#[default]'
set-option -g status-right '#[fg=red,bold][[ #(git branch) branch ]] #[fg=cyan]»» #[fg=blue,bold]###S #[fg=magenta]%R %m-%d#(acpi | cut -d ',' -f 2)#[default]'
set-option -g visual-activity on
# Titles (window number, program name, active (or not)
# set-option -g set-titles on
# set-option -g set-titles-string '#H:#S.#I.#P #W #T'
############################################################################
# Unbindings
############################################################################
#unbind [ # copy mode bound to escape key
unbind j
unbind C-b # unbind default leader key
unbind '"' # unbind horizontal split
unbind % # unbind vertical split
############################################################################
# Bindings
############################################################################
# reload tmux conf
bind r source-file ~/.tmux.conf \; display "Reloaded!"
# new split in current pane (horizontal / vertical)
bind-key - split-window -v # split pane horizontally
bind-key \ split-window -h # split pane vertically
# list panes
bind-key Space list-panes
# break-pane
bind-key Enter break-pane
############################################################################
# panes
############################################################################
# Navigation ---------------------------------------------------------------
# use the vim motion keys to move between panes
#bind-key h select-pane -L
#bind-key j select-pane -D
#bind-key k select-pane -U
#bind-key l select-pane -R
# Resizing ---------------------------------------------------------------
bind-key c-h resize-pane -L 5
bind-key c-j resize-pane -D 5
bind-key c-k resize-pane -U 5
bind-key c-l resize-pane -R 5
# use vim motion keys while in copy mode
setw -g mode-keys vi
# smart pane switching with awareness of vim splits
is_vim='echo "#{pane_current_command}" | grep -iqE "(^|\/)g?(view|n?vim?)(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"