aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.config/tmux/tmux.conf27
1 files changed, 15 insertions, 12 deletions
diff --git a/.config/tmux/tmux.conf b/.config/tmux/tmux.conf
index abaa643..2bcdc40 100644
--- a/.config/tmux/tmux.conf
+++ b/.config/tmux/tmux.conf
@@ -13,17 +13,20 @@ unbind C-b
set -g prefix C-s
#set -g prefix M-Space
-bind -T root F12 \
+# Ensure that we can send Ctrl+s to other apps
+bind C-s send-prefix
+
+# Disable local tmux keys (nested tmux)
+bind -T root C-a \
set prefix None \;\
set key-table off \;\
- set status-style "fg=$color_status_text,bg=$color_window_off_status_bg" \;\
+ if -F '#{pane_in_mode}' 'send-keys -X cancel' \;\
+ refresh-client -S \;\
-bind -T off F12 \
+bind -T off C-a \
set -u prefix \;\
set -u key-table \;\
-
-# Ensure that we can send Ctrl+s to other apps
-bind C-s send-prefix
+ refresh-client -S
# Setting the delay between Prefix and Command
set -sg escape-time 10
@@ -105,11 +108,10 @@ bind -n M-0 select-window -t :=0
# See: https://github.com/christoomey/vim-tmux-navigator
is_vim="ps -o state= -o comm= -t '#{pane_tty}' | grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|l?n?vim?x?)(diff)?$'"
-bind-key -n 'C-h' if-shell "$is_vim" 'send-keys -t=+ C-h' 'if-shell -F "#{pane_in_zoom}" "break-pane" "send-keys -t=+ select-pane -L"'
-bind-key -n 'C-j' if-shell "$is_vim" 'send-keys -t=+ C-j' 'if-shell -F "#{pane_in_zoom}" "break-pane" "send-keys -t=+ select-pane -D"'
-bind-key -n 'C-k' if-shell "$is_vim" 'send-keys -t=+ C-k' 'if-shell -F "#{pane_in_zoom}" "break-pane" "send-keys -t=+ select-pane -U"'
-bind-key -n 'C-l' if-shell "$is_vim" 'send-keys -t=+ C-l' 'if-shell -F "#{pane_in_zoom}" "break-pane" "send-keys -t=+ select-pane -R"'
-#bind-key -n 'C-\\' if-shell "$is_vim" 'send-keys -t=+ C-\\'' 'if-shell -F "#{pane_in_zoom}" "break-pane" "send-keys -t=+ select-pane -l"'
+bind-key -n 'C-h' if-shell "$is_vim" 'send-keys C-h' 'select-pane -L'
+bind-key -n 'C-j' if-shell "$is_vim" 'send-keys C-j' 'select-pane -D'
+bind-key -n 'C-k' if-shell "$is_vim" 'send-keys C-k' 'select-pane -U'
+bind-key -n 'C-l' if-shell "$is_vim" 'send-keys C-l' 'select-pane -R'
tmux_version='$(tmux -V | sed -En "s/^tmux ([0-9]+(.[0-9]+)?).*/\1/p")'
if-shell -b '[ "$(echo "$tmux_version < 3.0" | bc)" = 1 ]' \
@@ -218,7 +220,8 @@ set -g status-justify absolute-centre
set-option -g status-right ""
set -g status-right-length 60
#set -g status-right "#[fg=#50fa7b,bg=default] #{?client_prefix,#[reverse] Prefix #[noreverse] ,} #[bg=default,fg=#50fa7b]#[bg=#50fa7b,fg=black] %H:%M #[bg=default,fg=#50fa7b]"
-set -g status-right "#(cat ~/.vi-mode | awk '/-- NORMAL --/ {print \"#[fg=#39BAE6]#[bg=default]#[bg=#39BAE6,fg=black] %H:%M #[bg=default,fg=#39BAE6]\"} /-- INSERT --/ {print \"#[fg=#50fa7b]#[bg=default]#[bg=#50fa7b,fg=black] %H:%M #[bg=default,fg=#50fa7b]\"}')"
+local_keys_off="#[fg=#50fa7b,bg=default]#([ $(tmux show-option -qv key-table) = 'off' ] && echo 'OFF')#[default]"
+set -g status-right "$local_keys_off #(cat ~/.vi-mode | awk '/-- NORMAL --/ {print \"#[fg=#50fa7b,bg=default] #{?client_prefix,#[reverse] Prefix #[noreverse] ,} #[fg=#39BAE6]#[bg=default]#[bg=#39BAE6,fg=black] %H:%M #[bg=default,fg=#39BAE6]\"} /-- INSERT --/ {print \"#[fg=#39BAE6,bg=default] #{?client_prefix,#[reverse] Prefix #[noreverse] ,} #[fg=#50fa7b]#[bg=default]#[bg=#50fa7b,fg=black] %H:%M #[bg=default,fg=#50fa7b]\"}')"
#set -g status-right "#[fg=white,bg=black]#(cat ~/.vi-mode)"
#set -g status-right "#[fg=white,bg=black]#(cat ~/.vi-mode | awk '/-- NORMAL --/ {print \"#[fg=blue]#[bg=black]-- NORMAL --\"} /-- INSERT --/ {print \"#[fg=green]#[bg=black]-- INSERT --\"}')"