-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtmux.conf
More file actions
30 lines (26 loc) · 1.76 KB
/
tmux.conf
File metadata and controls
30 lines (26 loc) · 1.76 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
# Enable proper colors for tools like vim
set -g default-terminal "tmux-256color"
# Store a lot of history for scrollback
set -g history-limit 100000
# Use vi keybinds to scroll tmux
set-window-option -g mode-keys vi
# When making a new split, open it to the location of the current pane
bind '"' split-window -c "#{pane_current_path}"
bind % split-window -h -c "#{pane_current_path}"
# Drastically reduce the time tmux spends listening after an Esc hit. Sufficiently close Esc and
# another key gets reinterpreted as Alt+the key. While this is required for Alt to work with some
# terminal emulators, it also delays passing on normal escape hits.
set -sg escape-time 10
# Optional additional source for machine-local files
#
# If you don't have any changes, `touch` the file to suppress the error message.
source-file ~/.config/tmux.local.conf
# ^B + f to search the scrollback buffer for filenames
bind-key f copy-mode \; send-keys -X search-backward \
'(^|/|\<|[[:space:]"])((\.|\.\.)|[[:alnum:]~_"-]*)((/[][[:alnum:]_.#$%&+=@"-]+)+([/ "]|\.([][[:alnum:]_.#$%&+=@"-]+(:[0-9]+)?(:[0-9]+)?)|[][[:alnum:]_.#$%&+=@"-]+(:[0-9]+)(:[0-9]+)?)|(/[][[:alnum:]_.#$%&+=@"-]+){2,}([/ "]|\.([][[:alnum:]_.#$%&+=@"-]+(:[0-9]+)?(:[0-9]+)?)|[][[:alnum:]_.#$%&+=@"-]+(:[0-9]+)(:[0-9]+)?)?|(\.|\.\.)/([][[:alnum:]_.#$%&+=@"-]+(:[0-9]+)?(:[0-9]+)?))'
# When in that mode, press o to open the highlighted file in your editor
bind-key -T copy-mode-vi o send-keys -X copy-pipe-and-cancel \
'tmux send-keys "C-q"; xargs -I {} tmux send-keys "${EDITOR:-vim} {}"; tmux send-keys "C-m"'
# Or press O to open it in a new split
bind-key -T copy-mode-vi O send-keys -X copy-pipe-and-cancel \
'tmux split-window -h -c "#{pane_current_path}"; xargs -I {} tmux send-keys "${EDITOR:-vim} {}"; tmux send-keys "C-m"'