From add7517e60b0cf427208867b505b616bacec8680 Mon Sep 17 00:00:00 2001 From: aktersnurra Date: Tue, 16 Feb 2021 22:48:28 +0100 Subject: fixed color bug in tmux, and option key usage on mac in alacritty --- .config/tmux/.tmux.conf | 85 +++++++++++++++++++++---------------------------- 1 file changed, 37 insertions(+), 48 deletions(-) (limited to '.config/tmux/.tmux.conf') diff --git a/.config/tmux/.tmux.conf b/.config/tmux/.tmux.conf index 41070f7..bcf1583 100644 --- a/.config/tmux/.tmux.conf +++ b/.config/tmux/.tmux.conf @@ -1,4 +1,22 @@ # Stolen from: https://gist.github.com/spicycode/1229612 +# show session, window, pane in left status bar +set -g terminal-overrides ',xterm-256color:Tc' +set -g default-terminal "screen-256color" +set -as terminal-overrides ',xterm*:sitm=\E[3m' + +set -g status-position top # statusbar position +set -g status-interval 1 +set -g status-left-length 40 +set-option -g status-left '#[fg=white]⚡️#(whoami)@#(hostname -s) | #[fg=green]' +set-option -g status-right '#[fg=aqua]%b %_d %H:%M' + + +#+--- Colors ---+ +set -g status-bg black +set -g status-fg white +setw -g clock-mode-colour cyan + + # 0 is too far from ` ;) set -g base-index 1 @@ -12,11 +30,14 @@ set -g history-limit 10000 setw -g mode-keys vi setw -g mouse on -setw -g monitor-activity on -setw -g alternate-screen on +#setw -g monitor-activity on +#setw -g alternate-screen on -bind-key v split-window -h -bind-key s split-window -v +# split panes using | and - +bind | split-window -h +bind - split-window -v +unbind '"' +unbind % bind-key J resize-pane -D 5 bind-key K resize-pane -U 5 @@ -50,51 +71,19 @@ bind -n M-Down select-pane -D bind -n S-Left previous-window bind -n S-Right next-window + +bind Escape copy-mode +bind p paste-buffer +bind -T copy-mode-vi v send -X begin-selection +bind -T copy-mode-vi y send-keys -X copy-pipe-and-cancel "pbcopy" +bind -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel "pbcopy" +bind -T copy-mode-vi Enter send-keys -X copy-pipe-and-cancel "pbcopy" + + # No delay for escape key press set -sg escape-time 0 # Reload tmux config -bind r source-file ~/.config/tmux/.tmux.conf - - -# Nord Theme -NORD_TMUX_COLOR_THEME_FILE=src/nord.conf -NORD_TMUX_VERSION=0.3.0 -NORD_TMUX_STATUS_CONTENT_FILE="src/nord-status-content.conf" -NORD_TMUX_STATUS_CONTENT_NO_PATCHED_FONT_FILE="src/nord-status-content-no-patched-font.conf" -NORD_TMUX_STATUS_CONTENT_OPTION="@nord_tmux_show_status_content" -NORD_TMUX_NO_PATCHED_FONT_OPTION="@nord_tmux_no_patched_font" -_current_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" - -__cleanup() { - unset -v NORD_TMUX_COLOR_THEME_FILE NORD_TMUX_VERSION - unset -v NORD_TMUX_STATUS_CONTENT_FILE NORD_TMUX_STATUS_CONTENT_NO_PATCHED_FONT_FILE - unset -v NORD_TMUX_STATUS_CONTENT_OPTION NORD_TMUX_NO_PATCHED_FONT_OPTION - unset -v _current_dir - unset -f __load __cleanup - tmux set-environment -gu NORD_TMUX_STATUS_TIME_FORMAT -} - -__load() { - tmux source-file "$_current_dir/$NORD_TMUX_COLOR_THEME_FILE" - - local status_content=$(tmux show-option -gqv "$NORD_TMUX_STATUS_CONTENT_OPTION") - local no_patched_font=$(tmux show-option -gqv "$NORD_TMUX_NO_PATCHED_FONT_OPTION") - - if [ "$(tmux show-option -gqv "clock-mode-style")" == '12' ]; then - tmux set-environment -g NORD_TMUX_STATUS_TIME_FORMAT "%I:%M %p" - else - tmux set-environment -g NORD_TMUX_STATUS_TIME_FORMAT "%H:%M" - fi - - if [ "$status_content" != "0" ]; then - if [ "$no_patched_font" != "1" ]; then - tmux source-file "$_current_dir/$NORD_TMUX_STATUS_CONTENT_FILE" - else - tmux source-file "$_current_dir/$NORD_TMUX_STATUS_CONTENT_NO_PATCHED_FONT_FILE" - fi - fi -} - -__load -__cleanup +bind r source-file $HOME/.config/tmux/.tmux.conf + +if-shell 'test "$SSH_CONNECTION"' 'set -g status-bg red' -- cgit v1.2.3-70-g09d2