-
Notifications
You must be signed in to change notification settings - Fork 0
/
tmux.conf
123 lines (106 loc) · 3.98 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
114
115
116
117
118
119
120
121
122
# set prefix to control-f
set -g prefix C-f
#unbind system defined prefix
unbind C-b
#set -g default-terminal "xterm"
set -g default-terminal "xterm-256color"
# enable mouse
set -g mouse on
# Allows for faster key repetition
set -s escape-time 0
# start session number from 1 rather than 0
set -g base-index 1
# start pane number from 1 similar to windows
set -g pane-base-index 1
# renumber when you close lower# windows
set -g renumber-windows on
# new window/split in same directory
bind c new-window -c "#{pane_current_path}"
bind '"' split-window -c "#{pane_current_path}"
bind % split-window -h -c "#{pane_current_path}"
# status pane
set -g pane-border-status top
set -g pane-border-format "#[fg=white] #{pane_index} #{pane_current_path} #(ps -f --no-headers --ppid #{pane_pid} -o args) "
set -g pane-active-border-style bg=default,fg=black,bold
set -g pane-border-style fg=black
##{pane_index} #{pane_title}"
#set -g pane-border-format "#{pane_index} #{pane_current_command}"
# pane movement similar to vim
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
# resize panes
bind -r H resize-pane -L 5
bind -r J resize-pane -D 5
bind -r K resize-pane -U 5
bind -r L resize-pane -R 5
# to cycle through windows
#bind -r C-h select-window -t :-
#bind -r C-l select-window -t :+
bind b previous-window
bind -n C-k if "[ $(tmux display -p '#{pane_current_command}') = vim ]" "send-keys C-k" "select-pane -U"
bind -n C-j if "[ $(tmux display -p '#{pane_current_command}') = vim ]" "send-keys C-j" "select-pane -D"
bind -n C-h if "[ $(tmux display -p '#{pane_current_command}') = vim ]" "send-keys C-h" "select-pane -L"
bind -n C-l if "[ $(tmux display -p '#{pane_current_command}') = vim ]" "send-keys C-l" "select-pane -R"
## Use vim keybindings in copy mode
# Copy mode with prefix+[
# navigate using u and d???
# v to start copy
# y to yank
# p to prefix+p to paste
# or use xclip moust for X11 wayland uses wl-copy
#set-option -g mouse on
#setw -g mode-keys vi
#set-option -s set-clipboard off
#bind p paste-buffer
#bind-key -T copy-mode-vi v send-keys -X begin-selection
#bind-key -T copy-mode-vi y send-keys -X rectangle-toggle
#unbind -T copy-mode-vi Enter
#bind-key -T copy-mode-vi Enter send-keys -X copy-pipe-and-cancel 'xclip -se c -i'
#bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel 'xclip -se c -i'
# monitor activities in other windows
set -g monitor-activity on
set -g visual-activity on
# reload config
bind r source-file ~/.tmux.conf \; display-message "Config reloaded..."
# status bar theme
set -g mode-style fg=default,bg=black
set -g window-status-current-style fg=white,bold,bg=default
set -g window-status-activity-style bg=default
set -g window-status-separator ' '
set -g window-style fg=default,bg=default
set -g window-active-style fg=default,bg=default
set -g status-style fg=white,bg=default
set -g status-interval 1
set -g status-justify 'centre'
set -g status 'on'
set -g status-right '%H:%M '
set -g status-right-length '100'
set -g status-right-style fg=white
set -g status-left ' -#S-'
set -g status-left-length '100'
set -g status-left-style fg=white
set -g message-style fg=white,bg=default
# List of plugins
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'
set -g @plugin 'tmux-plugins/tmux-resurrect'
# for vim
set -g @resurrect-strategy-vim 'session'
# for neovim
set -g @resurrect-strategy-nvim 'session'
# for panes
set -g @resurrect-capture-pane-contents 'on'
# by default save in ~/.tmux/ressurect
# change with: set -g @resurrect-dir '/some/path'
set -g @resurrect-processes 'ssh'
set -g @plugin 'tmux-plugins/tmux-continuum'
#set -g @plugin 'ofirgall/tmux-window-name'
# Other examples:
# set -g @plugin 'github_username/plugin_name'
# set -g @plugin 'github_username/plugin_name#branch'
# set -g @plugin '[email protected]:user/plugin'
# set -g @plugin '[email protected]:user/plugin'
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run '~/.tmux-plugins/tpm/tpm'