-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtmux
118 lines (85 loc) · 3.43 KB
/
tmux
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
114
115
116
117
118
#----------------------- general -------------------------------
set-option -g default-terminal 'xterm-256color'
set-option -g default-shell /bin/zsh
set -g prefix2 C-a
bind C-a send prefix -2
set -g history-limit 5000
#reload config
bind r source-file ~/.tmux.conf \; display '~/.tmux.conf sourced'
#if 'which -s reattach-to-user-namespace' 'set -g default-command "exec initializing... 2> /dev/null & reattach-to-user-namespace $SHELL -l"'
# -- pane splitting -----------------
bind | split-window -h -c "#{pane_current_path}"
bind - split-window -v -c "#{pane_current_path}"
#bind v split-window -h
#bind C-v split-window -h
#
#bind s split-window -v
#bind C-v split-window -v
# ----- kill windows ---------------
bind-key q kill-window
bind-key C-q kill-window
bind-key x kill-pane
bind-key C-x kill-pane
#---------------------- display -------------------------------
set -g base-index 1 # start with 1
setw -g pane-base-index 1 # make pane number consistent
setw -g automatic-rename on
set -g renumber-windows on
set -g set-titles on
set -g set-titles-string '#h ❐ #S ● #I #W'
set -g display-panes-time 800
set -g display-time 1000
set -g status-interval 10
#clock
setw -g clock-mode-style 24
# clear both screen and history
bind -n C-l send-keys C-l \; run 'tmux clear-history'
#activity
set -g monitor-activity on
set -g visual-activity off
# -- navigation ------------------------------------------------
#bind C-f command-prompt -p find-session 'switch-client -t %%'
# pane navigation
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" # Added in quotes because \ needs to be escaped in later tmux versions
#bind -r h select-pane -L # left
#bind -r j select-pane -D # down
#bind -r k select-pane -U # up
#bind -r l select-pane -R # move right
bind > swap-pane -D
bind < swap-pane -U
# vi mode -------------------------------------------------------
set-window-option -g mode-keys vi
#max current pane
bind + run 'cut -c3- ~/.tmux.conf | sh -s maximize_pane'
bind -r H resize-pane -L 2
bind -r J resize-pane -D 2
bind -r K resize-pane -U 2
bind -r L resize-pane -R 2
# toggle mouse
bind m run "cut -c3- ~/.tmux.conf | sh -s toggle_mouse"
# copy to Mac OSX pasteboard
bind-key -T copy-mode-vi v send -X begin-selection
bind-key -T copy-mode-vi y send-keys -X copy-pipe-and-cancel "pbcopy"
bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel "pbcopy"
bind-key -T copy-mode-vi Enter send-keys -X copy-pipe-and-cancel "pbcopy"
# ----------------------- powerline bar ----------------------------
#source "/Users/mariomelara/Envs/v-python/lib/python2.7/site-packages/powerline/bindings/tmux/powerline.conf"
# Setting up tmux options
bind P paste-buffer
set-option -g mouse on
# TPM tmux plugin manager settings
set -g @plugin 'tmux-plugins/tpm'
# set -g @plugin 'tmux-plugins/tmux-sensible'
# set -g @plugin 'odedlaz/tmux-onedark-theme'
set -g @plugin 'arcticicestudio/nord-tmux'
#set -g @plugin 'egel/tmux-gruvbox'
run '~/.tmux/plugins/tpm/tpm'
# To install press prefix + I
# To uninstall press prefix + alt + u
# To update prefix + U