-
Notifications
You must be signed in to change notification settings - Fork 0
/
.tmux.conf
74 lines (57 loc) · 2.33 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
# This is my tmux configuration file
# I will keep adding stuff into this file while I am keep learning tmux.
# Use C-s instead of default prefix-key.
unbind C-b
set -g prefix C-s
#Set scrolling support
set -g mouse on
#Set zsh as default shell
set-option -g default-shell $SHELL
#Set color
set-option -g default-terminal "screen-256color"
#Use C-p, C-n, C-a, C-e to navigate in status bar
set-option -g status-keys "emacs"
#Set status bar colors
set -g status-bg '#666666'
set -g status-fg '#aaaaaa'
#Set parameters for both left and right side of status bar
set -g status-left-length 50
set -g status-right "#(date '+%a, %b %d - %I:%m')"
#re-index windows
set -g base-index 1
set -g renumber-windows on
# make sure reattach-to-user-namespace installed
set-option -g default-command "reattach-to-user-namespace -l zsh"
# Set key for reload tmux conf file
bind-key r source-file ~/.tmux.conf \; display-message "~/.tmux.conf reloaded"
# Set keys for move between panes
#bind-key -n C-h select-pane -L
#bind-key -n C-j select-pane -D
#bind-key -n C-k select-pane -U
#bind-key -n C-l select-pane -R
# Smart pane switching with awareness of vim splits
# # See: https://github.com/christoomey/vim-tmux-navigator
is_vim='echo "#{pane_current_command}" | grep -iqE "(^|\/)g?(view|n?vim?x?)(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"
#Set key bindings for resizing panes
bind-key -n S-Left resize-pane -L 2
bind-key -n S-Right resize-pane -R 2
bind-key -n S-Down resize-pane -D 1
bind-key -n S-Up resize-pane -U 1
bind-key -n C-Left resize-pane -L 10
bind-key -n C-Right resize-pane -R 10
bind-key -n C-Down resize-pane -D 5
bind-key -n C-Up resize-pane -U 5
#Set key binding for breaking current pane and send it to next window
bind-key b break-pane -d
bind-key C-j choose-tree
bind-key c new-window -c '#{pane_current_path}'
#Set keys for split window horizontally and vertically
bind-key - split-window -v -c '#{pane_current_path}'
bind-key \ split-window -h -c '#{pane_current_path}'
#set key binding for editing dotfiles quickly
bind-key v split-window -h -c ~/git/dotfiles "vim +CtrlP"