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