-
Notifications
You must be signed in to change notification settings - Fork 0
/
.tmux.conf
105 lines (82 loc) · 3.77 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
# install tmux plugins manager if necessary
if "test ! -d ~/.tmux/plugins/tpm" \
"run 'git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm && ~/.tmux/plugins/tpm/bin/install_plugins'"
# List of plugins ---------------------------------
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'
#set -g @plugin 'seebi/tmux-colors-solarized'
#set -g @plugin 'jimeh/tmux-themepack'
# set -g @plugin 'edouard-lopez/tmux-tomorrow'
set -g @plugin 'tmux-plugins/tmux-resurrect'
#set -g @plugin 'tmux-plugins/tmux-continuum'
#set -g @plugin 'tmux-plugins/tmux-yank'
set -g @plugin 'sainnhe/tmux-fzf'
set -g @plugin 'christoomey/vim-tmux-navigator'
# misc settings -----------------------------------
set -g history-limit 65000
set-window-option -g mode-keys vi
# true color support
#set -g default-terminal "screen-256color"
#set -g default-terminal "xterm-kitty"
set-option default-terminal "tmux-256color"
set-option -sa terminal-overrides ",xterm-kitty:RGB"
# rename window to current process
#set-window-option -g automatic-rename on
# set-window-option -g automatic-rename-format "#{command}"
#set-option -g automatic-rename-format "#{b:pane_current_path}"
# set term title
set-option -g set-titles on
set-option -g set-titles-string "#S"
# set-option -g set-titles-string "#{b:pane_current_path}: #{pane_title}"
# start count from one
set -g base-index 1
setw -g pane-base-index 1
# pass keys to progs
set-option -gw xterm-keys on
# tmux session restore
#set -g @continuum-restore 'on'
set -g @continuum-save-interval '10'
set-option -g mouse on
#
# make scrolling with wheels work
bind -n WheelUpPane if-shell -F -t = "#{mouse_any_flag}" "send-keys -M" "if -Ft= '#{pane_in_mode}' 'send-keys -M' 'select-pane -t=; copy-mode -e; send-keys -M'"
bind -n WheelDownPane select-pane -t= \; send-keys -M
# status bar ---------------------------------------------
# see https://github.com/edkolev/tmuxline.vim
source-file ~/.tmux/airline_theme.tmux
# based on: tmux show-options -g | grep status
set-option status-right "#[fg=colour254,bg=colour24,nobold,nounderscore,noitalics]#[fg=colour240,bg=colour254] #h "
# key bindings ---------------------------------------------
set-option -g prefix C-b
# set-option -g prefix Home
#set-option -g prefix2 C-b
# bind-key PageUp send-prefix
#reload config
bind r source-file ~/.tmux.conf \; display-message "Config reloaded..."
unbind [
bind u copy-mode
# bind-key -T copy-mode-vi 'v' send -X begin-selection
# bind-key -T copy-mode-vi 'y' send -X copy-selection-and-cancel "reattach-to-user-namespace pbcopy"
set -g default-command "reattach-to-user-namespace -l $SHELL"
setw -g mode-keys vi
bind-key -T copy-mode-vi 'v' send -X begin-selection
bind-key -T copy-mode-vi 'y' send-keys -X copy-pipe "reattach-to-user-namespace pbcopy"
#unbind -T copy-mode-vi Enter
#bind-key -T copy-mode-vi Enter send-keys -X copy-pipe-and-cancel "reattach-to-user-namespace pbcopy"
bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe "reattach-to-user-namespace pbcopy"
# fast window switching
unbind f
#bind-key f run "tmux list-windows -F \"##I:##W\" | fzf-tmux | cut -d \":\" -f 1 | xargs tmux select-window -t"
bind-key f run -b "tmux list-windows -F \"##I:##W\" | fzf-tmux | cut -d \":\" -f 1 | xargs tmux select-window -t"
# window creation, create
unbind c
bind-key -T prefix c command-prompt -p "Name of new window: " "new-window -a -n '%%'"
# swap windows
bind-key -T prefix H swap-window -t -1\; select-window -t -1
bind-key -T prefix L swap-window -t +1\; select-window -t +1
# ctrl/shfit enter
bind -n S-Enter send-keys Escape "[13;2u"
bind -n C-Enter send-keys Escape "[13;5u"
# Has to stay at bottom of file --------------------------
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run -b '~/.tmux/plugins/tpm/tpm'