-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtmux.conf
112 lines (86 loc) · 4.22 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
# mac os x terminfo database does not support tmux-256color
# only really provides italic text
set-option -g default-terminal "tmux-256color"
# set-option -g default-terminal "screen-256color"
set-option -ga terminal-overrides ",*-256color*:Tc"
# reload config file (change file location to your the tmux.conf you want to use)
bind r source-file ~/.tmux.conf \; display "Reloaded!"
# split panes using | and -
#bind | split-window -h
#bind - split-window -v
#unbind '"'
#unbind %
# Enable mouse mode (tmux 2.1 and above)
set -g mouse on
# don't rename windows automatically
set-option -g allow-rename off
set -g history-limit 128000
setw -g mode-keys vi
# override default behavior and create new splits with the same path as the starting pane
bind '"' split-window -c "#{pane_current_path}"
bind % split-window -h -c "#{pane_current_path}"
# vim-like selection and copy to tmux buffer
bind-key -T copy-mode-vi 'v' send -X begin-selection
bind-key -T copy-mode-vi 'y' send -X copy-selection-and-cancel
# scroll between prompts matching $USER@HOSTNAME on prefix + u
bind-key -T copy-mode-vi 'U' send -X search-backward '$USER@'
bind-key -T copy-mode-vi 'D' send -X search-forward '$USER@'
# copy to system clipboard with xclip
# https://dev.to/iggredible/the-easy-way-to-copy-text-in-tmux-319g
bind-key -T copy-mode-vi 'c' send -X copy-pipe-and-cancel 'xclip -in -selection clipboard'
bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel 'xclip -in -selection clipboard'
# goal would be to open a new search with selection
bind-key -T copy-mode-vi 'C-g' send -X copy-pipe 'xargs -I {} google-chrome "? {}"'
# bind-key -T copy-mode-vi 'C-G' send -X copy-pipe 'xargs -I {} google-chrome "{}"'
# bind-key -T copy-mode-vi 'C-g' send -X copy-pipe 'xclip -in -selection clipboard && google-chrome'
# toggle synchronize panes with =
bind = setw synchronize-panes \; display "Toggled synchronize-panes #{?pane_synchronized,on,off}"
# source-file /usr/local/lib/python2.7/dist-packages/powerline/bindings/tmux/powerline.conf
# source-file ${HOME}/.tmux-themepack/powerline/block/green.tmuxtheme
# clear scrollback and screen
bind -n C-l send-keys C-l \; clear-history
# increase pane switching delay
set -g display-panes-time 3000
# Resizing panes with alt + vim nav
bind -n M-k resize-pane -U 5
bind -n M-j resize-pane -D 5
bind -n M-h resize-pane -L 5
bind -n M-l resize-pane -R 5
# switch windows alt+number
bind-key -n M-0 select-window -t 0
bind-key -n M-1 select-window -t 1
bind-key -n M-2 select-window -t 2
bind-key -n M-3 select-window -t 3
bind-key -n M-4 select-window -t 4
bind-key -n M-5 select-window -t 5
bind-key -n M-6 select-window -t 6
bind-key -n M-7 select-window -t 7
bind-key -n M-8 select-window -t 8
bind-key -n M-9 select-window -t 9
#source ~/.tmux.powerline.conf
# Define some aliases for writing buffer to text file
set -g command-alias[0] cap='capture-pane -e -S -10000 -b temp'
set -g command-alias[1] sb='save-buffer -b temp' # must provide path arg
set -g command-alias[2] cd='attach -c "#{pane_current_path}"' # new panes start at the path of the current pane
set -g command-alias[3] sync='setw synchronize-panes; display-message "synchronize-panes #{?pane_synchronized,on,off}"' # without on or off, toggles
# set -g command-alias[3] google='#(google-chrome #{pane_current_path})' # this currently crashes tmux
## TMUX PLUGINS
# tmux plugin manager
# List of plugins
# don't forget to run prefix + I in tmux to install!
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'
set -g @plugin 'tmux-plugins/tmux-resurrect'
set -g @plugin 'tmux-plugins/tmux-continuum'
set -g @plugin 'mitchallain/vim-tmux-navigator'
# 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'
# Automatic plugin installation
# https://github.com/tmux-plugins/tpm/blob/master/docs/automatic_tpm_installation.md
if "test ! -d ~/.tmux/plugins/tpm" \
"run 'git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm && ~/.tmux/plugins/tpm/bin/install_plugins'"
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run '~/.tmux/plugins/tpm/tpm'