commit 549fe0e1ed621d3fd35471678a8975c2c2fd3f5a
parent ca9c2e12f2ad755eda916460edb2e445e1d931d4
Author: tongong <tongong@gmx.net>
Date: Fri, 29 Oct 2021 13:17:47 +0200
added tmux config
Diffstat:
2 files changed, 46 insertions(+), 1 deletion(-)
diff --git a/profile b/profile
@@ -45,6 +45,6 @@ export DIARY_EDITOR=nvim
export DIARY_READER=less
# autostart X at login
-if [ -z "${DISPLAY}" ] && [ "${XDG_VTNR}" -eq 1 ]; then
+if [ -z "${DISPLAY}" ] && [ "${XDG_VTNR}" -eq 1 ] && [ -z "${TMUX}" ]; then
exec startx
fi
diff --git a/tmux.conf b/tmux.conf
@@ -0,0 +1,45 @@
+# prefix key
+unbind C-b
+set-option -g prefix C-Space
+bind C-Space send-prefix
+
+# vim movements for pane switching and resizing
+bind -r h select-pane -L
+bind -r j select-pane -D
+bind -r k select-pane -U
+bind -r l select-pane -R
+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
+bind -r C-h resize-pane -L
+bind -r C-j resize-pane -D
+bind -r C-k resize-pane -U
+bind -r C-l resize-pane -R
+
+# fix escape key
+set -sg escape-time 0
+
+# vim keys for copy mode
+set-window-option -g mode-keys vi
+bind -T prefix Escape copy-mode
+bind -T copy-mode v send -X begin-selection
+bind -T copy-mode y send -X copy-selection
+bind -T prefix P paste-buffer -p
+
+set -g pane-active-border-style fg=color8
+set -g pane-border-style fg=color8
+set -g status-left ''
+set -g status-style default
+set -g window-status-format '#[fg=yellow,bg=color237] #I #[fg=white,bg=color8] #W #[default]'
+set -g window-status-current-format '#[fg=black,bg=yellow] #I #[fg=white,bg=color8] #W #[default]'
+set -g status-right '#{?window_zoomed_flag,#[fg=black]#[bg=yellow] ZOOMED ,}#[fg=yellow,bg=color237] #h #[fg=white,bg=color8] %F %H:%M '
+
+# start counting windows at 1
+set -g base-index 1
+
+# reload config
+bind r source-file ~/.tmux.conf
+
+# set-option -g status off
+bind S { set-option status }