-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path.tmux.conf
95 lines (75 loc) · 2.75 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
set -g default-command "/usr/bin/env zsh"
set -g default-terminal "tmux-256color"
set -ga terminal-overrides ",xterm-256color*:Tc"
# enable focus-events so that autoread works in Neovim
set-option -g focus-events on
# use vi keybindings
setw -g mode-keys vi
# no delay
set -sg escape-time 0
set -g history-limit 50000
# when creating windows or panes, keep the current directory
bind '"' split-window -c "#{pane_current_path}"
bind _ split-window -c "#{pane_current_path}"
bind % split-window -h -c "#{pane_current_path}"
bind | split-window -h -c "#{pane_current_path}"
bind c new-window -c "#{pane_current_path}"
# movement between panes
bind k select-pane -U
bind j select-pane -D
bind h select-pane -L
bind l select-pane -R
# move pane to a different window. you can choose window from a list:
bind m choose-window -F "#{window_index}: #{window_name}" "join-pane -h -t %%"
bind M choose-window -F "#{window_index}: #{window_name}" "join-pane -v -t %%"
# toggle between two last used sessions with a keybinding similar to vim
bind C-^ switch-client -l
# keybindings to move windows
bind -n C-S-Left swap-window -t -1\; select-window -t -1
bind -n C-S-Right swap-window -t +1\; select-window -t +1
# better keybindings to enter copy mode
unbind [
bind b copy-mode
bind C-b copy-mode
# enable mouse
set -g mouse on
# renumber windows automatically
set -g renumber-windows on
# indices start at 1
set -g base-index 1
setw -g pane-base-index 1
# reload config with ctrl-b r
bind r source-file ~/.tmux.conf \; display-message "configuration reloaded"
# use emacs keybindings in tmux commandline
set -g status-keys emacs
# do not show message after bells and ignore if they happen in current window
set -g visual-bell off
set -g bell-action other
# appearance
set -g status-bg green
set -g status-fg black
set -g status-left ""
set -g status-right " %F %H:%M | #{session_name} "
set -g window-status-format " #{window_index}:#{window_name}#{window_flags} "
set -g window-status-current-format " #{window_index}:#{window_name}#{window_flags} "
set -g status-right-style bg=brightblack,fg=white
set -g window-status-style bg=default,fg=default
set -g window-status-current-style bg=brightblack,fg=white
# clipboard integration
set-option -g set-clipboard off
# copy
unbind -T copy-mode-vi Space
bind -T copy-mode-vi v send-keys -X begin-selection
if-shell "uname | grep -iq Darwin" {
bind -T copy-mode-vi y send-keys -X copy-pipe-no-clear "pbcopy"
} {
if-shell "uname -a | grep -iq Microsoft" {
if-shell "command -v win32yank.exe" {
bind -T copy-mode-vi y send-keys -X copy-pipe-no-clear "win32yank.exe -i --crlf"
} {
bind -T copy-mode-vi y send-keys -X copy-pipe-no-clear "clip.exe"
}
} {
bind -T copy-mode-vi y send-keys -X copy-pipe-no-clear "xclip -sel clip -i"
}
}