-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdot_tmux.conf
More file actions
105 lines (101 loc) · 4.19 KB
/
dot_tmux.conf
File metadata and controls
105 lines (101 loc) · 4.19 KB
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
set -g default-shell /bin/zsh
# Set the default terminal mode to 256color mode
set -g default-terminal "screen-256color"
# Set default RGB capability
set -sa terminal-features ',xterm-256color:RGB'
# Fix status bar on top
set-option -g status-position top
# Setting the prefix to C-b
set -g prefix C-b
#setting the delay between prefix and command
set -sg escape-time 1
# Set the base index for windows to 1 instead of 0
set -g base-index 1
# Set the base index for panes to 1 instead of 0
setw -g pane-base-index 1
# Keybind to reload .tmux.conf file
bind r source-file ~/.tmux.conf \; display "Reloaded!"
# Ensure that we can send Ctrl-B to other apps
bind C-b send-prefix
# splitting panes with | and -
bind | split-window -h
bind _ split-window -v
# split pane and retain the current directory of existing pane
bind - split-window -v -c "#{pane_current_path}"
bind / split-window -h -c "#{pane_current_path}"
# moving between panes with Prefix h,j,k,l
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
# Quick window selection
bind -r C-h select-window -t :-
bind -r C-k select-window -t :+
# Pane resizing panes with Prefix H,J,K,L
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
# mouse support - set to on if you want to use the mouse
set -g mouse on
# enable activity alerts
setw -g monitor-activity on
set -g visual-activity on
# enable vi keys.
setw -g mode-keys vi
# remapping copy and paste keys
bind Escape copy-mode
bind -T copy-mode-vi v send -X begin-selection
# bind -T copy-mode-vi y send-keys -X copy-pipe-and-cancel
# bind p paste-buffer
# Copy to clipboard
bind-key -T copy-mode-vi y send-keys -X copy-pipe-and-cancel "xclip -i -sel clip >/dev/null 2>&1"
bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel "xclip -i -sel clip >/dev/null 2>&1"
bind-key p run "xclip -o -sel clip | tmux load-buffer - ; tmux paste-buffer"
# shortcut for synchronize-panes toggle
bind C-s set-window-option synchronize-panes
# Readline clear screen
bind C-l send-keys 'C-l'
# Tmux navigator config
# Smart pane switching with awareness of Vim splits.
# See: https://github.com/christoomey/vim-tmux-navigator
vim_pattern='(\S+/)?g?\.?(view|l?n?vim?x?|fzf)(diff)?(-wrapped)?'
is_vim="ps -o state= -o comm= -t '#{pane_tty}' \
| grep -iqE '^[^TXZ ]+ +${vim_pattern}$'"
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'
tmux_version='$(tmux -V | sed -En "s/^tmux ([0-9]+(.[0-9]+)?).*/\1/p")'
if-shell -b '[ "$(echo "$tmux_version < 3.0" | bc)" = 1 ]' \
"bind-key -n 'C-\\' if-shell \"$is_vim\" 'send-keys C-\\' 'select-pane -l'"
if-shell -b '[ "$(echo "$tmux_version >= 3.0" | bc)" = 1 ]' \
"bind-key -n 'C-\\' if-shell \"$is_vim\" 'send-keys C-\\\\' 'select-pane -l'"
bind-key -T copy-mode-vi 'C-h' select-pane -L
bind-key -T copy-mode-vi 'C-j' select-pane -D
bind-key -T copy-mode-vi 'C-k' select-pane -U
bind-key -T copy-mode-vi 'C-l' select-pane -R
bind-key -T copy-mode-vi 'C-\' select-pane -l
# tpm plugin
set -g @plugin 'tmux-plugins/tpm'
# List of plugins
# set -g @plugin 'christoomey/vim-tmux-navigator'
set -g @plugin 'tmux-plugins/tmux-sensible'
set -g @plugin 'tmux-plugins/tmux-resurrect'
set -g @plugin 'catppuccin/tmux#v2.1.3' # See https://github.com/catppuccin/tmux/tags for additional tags
set -g @catppuccin_flavor 'mocha' # latte, frappe, macchiato or mocha
# set -g @plugin 'tmux-plugins/tmux-continuum' # automatically saves sessions for you every 15 minutes
set -g @resurrect-capture-pane-contents 'on'
# set -g @continuum-restore 'on'
set -g @plugin '2kabhishek/tmux2k'
# use a theme
set -g @tmux2k-theme 'onedark'
# to show icons only
set -g @tmux2k-icons-only true
# Other examples:
# set -g @plugin 'github_username/plugin_name'
# set -g @plugin 'github_username/plugin_name#branch'
# set -g @plugin 'git@github.com:user/plugin'
# set -g @plugin 'git@bitbucket.com:user/plugin'
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run '~/.tmux/plugins/tpm/tpm'