comparison dot_tmux.conf @ 257:d726921aaabe

Clean start of dotfiles repo
author zegervdv <zegervdv@me.com>
date Thu, 21 May 2020 11:28:36 +0200
parents
children 0ba6e190eb62
comparison
equal deleted inserted replaced
-1:000000000000 257:d726921aaabe
1 set-environment -g PATH "/project/asic_fpga/tools/tmux/bin:$PATH"
2
3 # Nested TMUX sessions (from
4 # https://medium.freecodecamp.org/tmux-in-practice-local-and-nested-remote-tmux-sessions-4f7ba5db8795)
5 bind -T root F12 \
6 set prefix None \;\
7 set key-table off \;\
8 set status-right "#[fg=colour0,bg=colour1] DISABLED #[fg=colour3,bg=colour0] #{session_name}#[fg=colour1] | #[fg=colour2]%d %b %l:%M %p "
9 refresh-client -S \;\
10
11 bind -T off F12 \
12 set -u prefix \;\
13 set -u key-table \;\
14 set -u status-right \;\
15 refresh-client -S
16 # improve colors
17 set -g default-terminal 'screen-256color'
18 set-option -g allow-rename off
19 set-window-option -g automatic-rename off
20
21 # Status bar
22 set -g set-titles 'off'
23 set -g status-position 'top'
24 set -g status-left ""
25 set -g status-right-length 200
26 set -g status-right "#[fg=colour0,bg=colour5] vsim #[fg=colour15,bg=colour254] #(ps hux -u $(whoami) | grep 'vish' | grep -v -E 'grep|view' | wc -l) #[fg=colour3,bg=colour0] #[fg=colour0,bg=colour3] load #[fg=colour15,bg=colour254] #(cat /proc/loadavg | awk '{ print $3; }' | xargs printf '%2.2f') #[fg=colour3,bg=colour0] #[fg=colour0,bg=colour2] mem #[fg=colour15,bg=colour254] #(ps haux | awk -v user=$(whoami) '$1 ~ user { sum += $4 } END { print sum; }' | xargs printf '%2.2f')% #[fg=colour3,bg=colour0] #[fg=colour0,bg=colour1] time #[fg=colour15,bg=colour254] %d %b %l:%M %p #[fg=colour3,bg=colour0] #[fg=colour0,bg=colour8] #{session_name} #[fg=colour0,bg=colour0] "
27
28 # Tabs
29 setw -g window-status-format " #I #W "
30 setw -g window-status-style fg=colour15
31 setw -g window-status-current-format " #I #W "
32 setw -g window-status-current-style fg=red
33
34 set -g status-justify "left"
35 set -g status-bg "colour0"
36 set -g status-fg "colour7"
37 set -g message-bg "colour0"
38 set -g message-fg "colour8"
39
40 setw -g window-status-bell-style "fg=colour0,bg=colour5"
41
42 bind s split-window -v -c "#{pane_current_path}"
43 bind v split-window -h -c "#{pane_current_path}"
44 bind a split-window -v -p 15 -c "#{pane_current_path}"
45 # bind c new-window -c "#{pane_current_path}"
46 bind c command-prompt -p "Name:" "new-window -c \"#{pane_current_path}\" -n %%"
47
48 # Enable delete in command sequencer
49 bind h send-keys 'c-h'
50
51 # Open man pages in split
52 bind @ command-prompt -p "Man:" "split-window -v 'exec man %%'"
53
54 # act like vim
55 bind Escape copy-mode
56 set-window-option -g mode-keys vi
57 bind-key -T copy-mode-vi 'v' send -X begin-selection
58 bind-key -T copy-mode-vi 'V' send -X select-line
59 bind-key -T copy-mode-vi 'r' send -X rectangle-toggle
60 bind-key -T copy-mode-vi 'y' send -X copy-pipe-and-cancel 'xclip -in -selection clipboard'
61 unbind-key -T copy-mode-vi MouseDragEnd1Pane
62 unbind -T copy-mode-vi MouseDragEnd1Pane
63 # unbind -t vi-copy MouseDragEnd1Pane
64
65 # Smart pane switching with awareness of Vim splits.
66 # See: https://github.com/christoomey/vim-tmux-navigator
67 is_vim="ps -o state= -o comm= -t '#{pane_tty}' \
68 | grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|n?vim?x?)(diff)?$'"
69 bind-key -n C-h if-shell "$is_vim" "send-keys C-h" "select-pane -L"
70 bind-key -n C-j if-shell "$is_vim" "send-keys C-j" "select-pane -D"
71 bind-key -n C-k if-shell "$is_vim" "send-keys C-k" "select-pane -U"
72 bind-key -n C-l if-shell "$is_vim" "send-keys C-l" "select-pane -R"
73 bind-key -n C-\ if-shell "$is_vim" "send-keys C-\\" "select-pane -l"
74 bind-key -T copy-mode-vi C-h select-pane -L
75 bind-key -T copy-mode-vi C-j select-pane -D
76 bind-key -T copy-mode-vi C-k select-pane -U
77 bind-key -T copy-mode-vi C-l select-pane -R
78 bind-key -T copy-mode-vi C-\ select-pane -l
79 #act like GNU screen
80 unbind C-b
81 set -g prefix C-Space
82 bind Space send-prefix
83 set -g escape-time 20
84
85 # start window numbers at 1 to match keyboard order with tmux window order
86 set -g base-index 1
87
88 # renumber windows sequentially after closing any of them
89 set -g renumber-windows on
90
91 bind-key r source ~/.tmux.conf
92
93 # Fix hightlighting in less
94 set -ga terminal-overrides ',*:sitm@,ritm@'
95
96 # increase scrollback lines
97 set -g history-limit 100000
98
99 setw -g mouse on
100
101 set -g focus-events on
102
103 # Allow for visual bell when a command completes
104 set-window-option -g visual-bell on
105 set-window-option -g bell-action other
106
107 set-option -g default-shell "/bin/bash"
108 # set-option -g default-command "/bin/bash"
109 # set-environment -g SHELL "/bin/bash"
110 # set-environment -g PATH "$PATH:/home/zvandeva/bin"
111
112 # Local config
113 if-shell "[ -f ~/.tmux.conf.local ]" 'source ~/.tmux.conf.local'
114
115 # Plugins
116 set -g @plugin 'tmux-plugins/tpm'
117 set -g @plugin 'nhdaly/tmux-better-mouse-mode'
118 set -g @plugin 'tmux-plugins/tmux-yank'
119 set -g @plugin 'Morantron/tmux-fingers'
120 set -g @plugin 'laktak/extrakto'
121 set -g @plugin 'tmux-plugins/tmux-resurrect'
122 set -g @plugin 'tmux-plugins/tmux-continuum'
123
124
125 # Config
126 set -g @fingers-skip-health-check '1'
127 set -g @fingers-compact-hints '0'
128 set -g @fingers-hint-format-nocompact " #[fg=colour1][%s]"
129 set -g @fingers-highlight-format-nocompact "#[fg=colour5]%s"
130 set -g @fingers-pattern-0 "[[:digit:]][[:digit:]][[:digit:]]+"
131
132 set -g @scroll-without-changing-pane "on"
133 set -g @emulate-scroll-for-no-mouse-alternate-buffer "on"
134
135 set -g @extrakto_fzf_tool "/home/zvandeva/.fzf/bin/fzf"
136
137 set -g @resurrect-strategy-nvim 'session'
138 set -g @resurrect-capture-pane-contents 'on'
139
140 run-shell "~/.tmux/plugins/tpm/tpm"