-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy path.tmux.conf
More file actions
165 lines (122 loc) · 6.31 KB
/
.tmux.conf
File metadata and controls
165 lines (122 loc) · 6.31 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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
set -g default-terminal "xterm-256color"
set-option -ga terminal-overrides ",xterm-256color:Tc"
set-option -g -q mouse on
set-option -g display-time 2000 # By default, status msg disappears in the blink of an eye (750ms)
set-option -g base-index 1 # window index will start with 1
set-window-option -g pane-base-index 1 # pane index will start with 1
set-option -g renumber-windows on
set-option -g prefix F12
# bind-key F12 send-prefix # ensure that we can send Ctrl-A to other apps or the shell that your interacting
# unbind C-b # free the original bind-key key
# set -g prefix C-t # setting the prefix from C-t to C-a
# v and h are not binded by default, but we never know in the next versions...
unbind % # Split vertically
unbind v
bind-key v split-window -h -c "#{pane_current_path}"
unbind '"' # Split horizontally
unbind h
bind-key h split-window -v -c "#{pane_current_path}"
# source ~/.tmux/gruvbox-mix-dark.tmux.conf
source ~/.tmux/rigel.tmux
bind-key -r j select-pane -L # go left
bind-key -r k select-pane -D # go down
bind-key -r l select-pane -R # go right
bind-key -r m select-pane -U # go up
# for navigating between vim/tmux splits/panes
# is_vim="ps -o state= -o comm= -t '#{pane_tty}' \
# | grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|n?vim?x?)(diff)?$'"
# bind-key -n 'C-l' if-shell "$is_vim" 'send-keys C-h' 'select-pane -L'
# bind-key -n 'C-k' if-shell "$is_vim" 'send-keys C-j' 'select-pane -D'
# bind-key -n 'C-m' if-shell "$is_vim" 'send-keys C-k' 'select-pane -U'
# bind-key -n 'C-j' if-shell "$is_vim" 'send-keys C-l' 'select-pane -R'
# Pane: Arrow Movements
bind-key Up select-pane -U
bind-key Down select-pane -D
bind-key Left select-pane -L
bind-key Right select-pane -R
# Window: Movements# option + arrow keys to change the window
bind ] next-window
bind [ previous-window
bind-key -r C-j select-window -t :- # cycle through the windows for quick window selection
bind-key -r C-l select-window -t :+
# swap window
bind-key -r "<" swap-window -d -t -1
bind-key -r ">" swap-window -d -t +1
unbind n #DEFAULT KEY: Move to next window
unbind w #DEFAULT KEY: change current window interactively
# prompt rename window to type it from scratch
bind n command-prompt -p "Enter new window name:" "rename-window '%%'"
bind w new-window -c "#{pane_current_path}"
# prompt rename session to type it from scratch
# bind S command-prompt -p "Enter new session name:" "rename-session '%%'"
bind S command-prompt -p "Enter session name:" "new-session '%%'"
# prompt for a name for new window
# bind-key c command-prompt -p "Enter new window name:" "new-window; rename-window '%%'"
# word separators for automatic word selection
set-window-option -g word-separators ' @"=()[]' # default => ‘ -_@’.
# tmux adds a short, almost imperceptible delay between the commands that can cause funny behavior when running vim inside tmux.
set-option -s escape-time 0
# Command Prompt Movements: within the tmux command prompt and the command prompt is accessed using <P>: (in the status line)
set-option -g status-keys vi
# Let's add one more to the set (Vim way)
# Vim Style
bind-key -r L resize-pane -L 2 # resize a pane two rows at a time.
bind-key -r K resize-pane -D 2
bind-key -r M resize-pane -U 2
bind-key -r J resize-pane -R 2
# Vim Style in Copy-Mode "<prefix> ["
# Interacting with Paste Buffer
# bind-key Escape copy-mode
# Setup 'v' to begin selection as in Vim
bind-key -T copy-mode-vi 'v' send-keys -X begin-selection
bind-key -T copy-mode-vi 'y' send-keys -X copy-pipe-and-cancel "reattach-to-user-namespace pbcopy"
bind-key C-t choose-buffer # view the buffer stack
unbind-key p
bind-key p paste-buffer # default "<prefix> ]"
# enable incremental search by default
# bind-key -T copy-mode-vi / command-prompt -i -p "search down" "send -X search-forward-incremental \"%%%\""
# bind-key -T copy-mode-vi ? command-prompt -i -p "search up" "send -X search-backward-incremental \"%%%\""
# Split panes vertical
# Ctr+C: Make it even better -just one step to move from sys->buffer->editor vice versa
# bind-key C-c run "tmux save-buffer - | xclip -i -sel clipboard"
# Ctr+V: To paste text from sys clipboard into the view
# bind-key C-v run "tmux set-buffer \"$(xclip -o -sel clipboard)\""
bind r source-file ~/.tmux.conf \; display "Reloaded!"
bind t choose-tree -s
bind d detach
unbind-key q # unbind-key “x” from it’s current job of “ask and then close”
bind-key q kill-pane # rebind-key it to just “close”
bind-key Q kill-session # key combo for killing the entire session - <prefix> + shift + x
# bind-key X kill-window
# work project launcher
bind-key M-r run-shell -b 'workdirs="$(find ~/CodeHub/.git \; -print -prune | fzf-tmux --multi --bind alt-a:select-all,alt-d:deselect-all)" ; if [ -n "${workdirs}" ]; then for wd in "${workdirs}"; do tmux new-window -c "${wd}" vim . ; done ; fi ;'
# Dotfiles launcher
bind-key M-d new-window -c ~/.dotfiles 'files="$(fzf --multi --preview "cat {}" )" ; if [ -n "${files}" ]; then vim -- ${files} ; fi ;'
# Top launcher
bind-key C-t split-window htop
bind-key C-f split-window ranger
# Cool trick: Let's dim out any pane that's not active.
# set-window-option -g window-style fg=colour245,bg=colour237
# set-window-option -g window-active-style fg=colour230,bg=colour235
# Command / Message line
set -g message-style fg=red,bg=default
# Basic
set-option -g status on
set-option -g status-interval 2 # Update the status line every 2 seconds (15 is default)
# set-option -g status-utf8 on
# List of plugins
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-resurrect'
set -g @plugin 'tmux-plugins/tmux-continuum'
# By default files are saved in ~/.tmux/resurrect dir. Change this to our custom path
set -g @resurrect-dir '~/.tmux/resurrect/tmux'
# Last saved environment is automatically restored when tmux is started.
set -g @continuum-boot 'on'
# change the save interval from 15 mins to 30
set -g @continuum-save-interval '30'
# terminal window will go fullscreen
set -g @continuum-boot-options 'fullscreen'
if "test ! -d ~/.tmux/plugins/tpm" \
"run 'git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm && ~/.tmux/plugins/tpm/bin/install_plugins'"
# Run the Tmux Plugin Manager
run ~/.tmux/plugins/tpm/tpm