2018-09-05 07:57:17 +02:00
|
|
|
#Fairly basic Tmux config.
|
|
|
|
#Copyright 2018 TheToric
|
|
|
|
#
|
|
|
|
#This program is free software: you can redistribute it and/or modify
|
|
|
|
#it under the terms of the GNU General Public License as published by
|
|
|
|
#the Free Software Foundation, either version 3 of the License, or
|
|
|
|
#(at your option) any later version.
|
|
|
|
#
|
|
|
|
#This program is distributed in the hope that it will be useful,
|
|
|
|
#but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
#GNU General Public License for more details.
|
|
|
|
#
|
|
|
|
#You should have received a copy of the GNU General Public License
|
|
|
|
#along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
2018-02-25 00:10:56 +01:00
|
|
|
#remap prefix from C-b to alt-a
|
2018-02-22 19:51:35 +01:00
|
|
|
unbind C-b
|
|
|
|
set-option -g prefix M-a
|
|
|
|
bind-key M-a send-prefix
|
|
|
|
|
2018-02-25 00:10:56 +01:00
|
|
|
#split panes using | and -
|
2018-07-10 11:33:58 +02:00
|
|
|
unbind '|'
|
2018-08-10 20:38:23 +02:00
|
|
|
unbind '_'
|
2018-02-25 00:10:56 +01:00
|
|
|
bind | split-window -h
|
2018-08-10 20:38:23 +02:00
|
|
|
bind _ split-window -v
|
2018-02-22 19:51:35 +01:00
|
|
|
unbind '"'
|
|
|
|
unbind %
|
|
|
|
|
|
|
|
#switch panes using alt-hjkl
|
2018-07-10 11:33:58 +02:00
|
|
|
bind -n M-h select-pane -L
|
|
|
|
bind -n M-l select-pane -R
|
|
|
|
bind -n M-k select-pane -U
|
|
|
|
bind -n M-j select-pane -D
|
|
|
|
|
|
|
|
#or with the prefix and hjkl
|
|
|
|
bind h select-pane -L
|
|
|
|
bind l select-pane -R
|
|
|
|
bind k select-pane -U
|
|
|
|
bind j select-pane -D
|
|
|
|
|
|
|
|
#resize panes with HJKL
|
|
|
|
bind -r H resize-pane -L 5
|
|
|
|
bind -r J resize-pane -D 5
|
|
|
|
bind -r K resize-pane -U 5
|
|
|
|
bind -r L resize-pane -R 5
|
2019-01-25 16:50:37 +01:00
|
|
|
#sorta-kinda vim keys for copy and paste
|
|
|
|
bind-key -T copy-mode-vi v send-keys -X begin-selection
|
|
|
|
bind-key -T copy-mode-vi y send-keys -X copy-selection
|
|
|
|
bind-key -T copy-mode-vi y send-keys -X copy-pipe "xclip -sel clip -i"
|
|
|
|
bind-key -T copy-mode-vi r send-keys -X rectangle-toggle
|
|
|
|
|
2018-02-22 19:51:35 +01:00
|
|
|
|
2018-08-11 06:47:36 +02:00
|
|
|
#moving panes between windows.
|
|
|
|
bind-key b command-prompt -p "bring pane from:" "join-pane -s '%%'"
|
|
|
|
bind-key s command-prompt -p "sent pane to:" "join-pane -t '%%'"
|
|
|
|
|
2018-08-09 21:44:29 +02:00
|
|
|
#reload conf with r
|
2019-01-25 16:50:37 +01:00
|
|
|
bind r source-file ~/.tmux.conf
|
2018-08-09 21:44:29 +02:00
|
|
|
|
2018-07-10 11:33:58 +02:00
|
|
|
#fix annoying escape behavior
|
|
|
|
set -sg escape-time 0
|
2018-07-17 05:02:50 +02:00
|
|
|
|
|
|
|
#customizing ma tmux status line!
|
|
|
|
#make sure the left status line can hold the stuff we are about to give it.
|
|
|
|
set -g status-left-length 20
|
|
|
|
#have the left side status line display my hostname.
|
|
|
|
set -g status-left " #{host_short} | "
|
|
|
|
#also lengthen the right side status, by mutch more.
|
|
|
|
set -g status-right-length 60
|
|
|
|
#have the right side status bar display the current battery status and the time/date.
|
2021-08-26 22:30:15 +02:00
|
|
|
set -g status-right 'battery:#(acpi | grep -Eo "[0-9]+%" | tr "\n" " " | sed "s/\s\+$//") | %H:%M %d/%m/%y '
|