dotfiles

configuration files for shell, text editor, graphical environment, etc.
git clone git://src.adamsgaard.dk/dotfiles
Log | Files | Refs | README | LICENSE Back to index

commit fad890473e99e6a749679aa94347a9a1ed6f42fb
parent d9ccedaacbe651add8422215d64ac77df7b72eae
Author: Anders Damsgaard <andersd@riseup.net>
Date:   Sat, 21 Oct 2017 13:39:48 -0400

cleanup unused code and move status bar to the top

Diffstat:
Mlinks/.tmux.conf | 69+++++++++------------------------------------------------------------
1 file changed, 9 insertions(+), 60 deletions(-)

diff --git a/links/.tmux.conf b/links/.tmux.conf @@ -1,14 +1,8 @@ -#set-option -g prefix C-Space # C-SPC as tmux key set-option -g prefix C-a bind-key C-s last-window # Go to last window with C-SPC C-s bind-key C-a last-pane # Go to last pane with C-SPC C-a -#set-option -g prefix C-b -#bind-key C-w last-window # Go to last window with C-b C-w -#bind-key C-b last-pane # Go to last pane with C-b C-b # enable reattach-to-user-namespace which fixes pasteboard access and launchctl -# inside tmux -#set-option -g default-command "reattach-to-user-namespace -l zsh" if-shell 'uname | grep -qi Darwin' 'set-option -g default-command "reattach-to-user-namespace -l zsh"' set -g default-terminal "screen-256color" @@ -20,11 +14,7 @@ set -g history-limit 10000 unbind [ bind Escape copy-mode unbind p -#bind p paste-buffer -#bind-key -t vi-copy 'v' begin-selection -#bind-key -t vi-copy 'y' copy-selection bind-key -T copy-mode-vi v send-keys -X begin-selection -#bind-key -T copy-mode-vi y send-keys -X copy-selection # Copy if-shell 'uname | grep -qi Linux && which xclip > /dev/null' 'bind-key -T copy-mode-vi y send-keys -X copy-pipe-and-cancel "DISPLAY=:0 xclip -i -sel clipboard"' @@ -34,34 +24,17 @@ if-shell 'uname | grep -qi Darwin && which reattach-to-user-namespace > /dev/nul if-shell 'uname | grep -qi Linux && which xclip > /dev/null' 'bind p run "DISPLAY=:0 xclip -o | tmux load-buffer - ; tmux paste-buffer"' if-shell 'uname | grep -qi Darwin && which reattach-to-user-namespace > /dev/null' 'bind p run "reattach-to-user-namespace pbpaste | tmux load-buffer - ; tmux paste-buffer"' - -# vi-like movement -#bind-key k select-pane -U -#bind-key j select-pane -D -#bind-key h select-pane -L -#bind-key l select-pane -R -bind -r K resize-pane -U 5 -bind -r J resize-pane -D 5 -bind -r H resize-pane -L 5 -bind -r L resize-pane -R 5 - -# traditional navigation +# vi-like movement and resize 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 K resize-pane -U 5 +bind -r J resize-pane -D 5 +bind -r H resize-pane -L 5 +bind -r L resize-pane -R 5 # Smart pane switching with awareness of vim splits -#is_vim='echo "#{pane_current_command}" | grep -iqE "(^|\/)g?(view|n?vim?)(diff)?$"' -#bind -n C-h if-shell "$is_vim" "send-keys C-h" "select-pane -L" -#bind -n C-j if-shell "$is_vim" "send-keys C-j" "select-pane -D" -#bind -n C-k if-shell "$is_vim" "send-keys C-k" "select-pane -U" -#bind -n C-l if-shell "$is_vim" "send-keys C-l" "select-pane -R" -#bind -n C-\ if-shell "$is_vim" "send-keys C-\\" "select-pane -l" -#bind h run "(tmux display-message -p '#{pane_current_command}' | grep -iq vim && tmux send-keys C-h) || tmux select-pane -L" -#bind j run "(tmux display-message -p '#{pane_current_command}' | grep -iq vim && tmux send-keys C-j) || tmux select-pane -D" -#bind k run "(tmux display-message -p '#{pane_current_command}' | grep -iq vim && tmux send-keys C-k) || tmux select-pane -U" -#bind l run "(tmux display-message -p '#{pane_current_command}' | grep -iq vim && tmux send-keys C-l) || tmux select-pane -R" bind -n C-h run "(tmux display-message -p '#{pane_current_command}' | grep -iqE '(^|\/)n?vim(diff)?$|emacs.*$' && tmux send-keys C-h) || tmux select-pane -L" bind -n C-j run "(tmux display-message -p '#{pane_current_command}' | grep -iqE '(^|\/)n?vim(diff)?$|emacs.*$' && tmux send-keys C-j) || tmux select-pane -D" bind -n C-k run "(tmux display-message -p '#{pane_current_command}' | grep -iqE '(^|\/)n?vim(diff)?$|emacs.*$' && tmux send-keys C-k) || tmux select-pane -U" @@ -93,8 +66,6 @@ set -g renumber-windows on # renumber remaining windows when a window is closed # mouse behavior (2.1+) set -g mouse off -#setw -g utf8 on -#setw -g status-utf8 on setw -g automatic-rename on # Allows us to use C-a a <command> to send commands to a TMUX session inside @@ -107,27 +78,19 @@ bind-key a send-prefix # printf "\x1b[38;5;${i}mcolour${i}\n" # done -# Set status bar on bottom for OSX, on top for Linux -set -g status-position bottom +set -g status-position top #if-shell 'uname | grep -qi Linux > /dev/null' 'set -g status-position top' set -g status-interval 5 set -g status-bg default set -g status-fg cyan -#set -g status-right "#[fg=green]#H" set -g status-left-length 40 -set -g status-left "#[fg=red]#(hostname|sed \"s/\\\\..*$//\") #[fg=green]s:#S #[fg=yellow]w:#I #[fg=cyan]p:#P" -set -g status-right-length 60 +#set -g status-left "#[fg=red]#(hostname|sed \"s/\\\\..*$//\") #[fg=green]s:#S #[fg=yellow]w:#I #[fg=cyan]p:#P" +set -g status-left "#[fg=green]#(hostname|sed \"s/\\\\..*$//\") #[fg=blue]s:#S" +set -g status-right-length 40 if-shell 'uname | grep -qi Darwin' "set -g status-right \"#[fg=#81a2be]#(/usr/local/bin/mpc | head -n 1 | sed 's/volume.*$//' | cut -c 1-22) #[fg=cyan]#(~/bin/battery-osx) #(~/bin/mailstatus.sh) #[fg=yellow]#(uptime|sed 's/.* //') #[fg=green]%Y-%m-%d %R\"" if-shell 'uname | grep -qi Linux' "set -g status-right \"#[fg=cyan]#(acpi|sed 's/Battery//; s/0://; s/Discharging//; s/Full, //; s/remaining//; s/ , //; s/Charging, /+/; s/ until charged/ /; s/, / /; s/Unknown //; s/ $//;') #(~/bin/mailstatus.sh) #[fg=yellow]#(cat /proc/loadavg|awk '{print $1;}') #[fg=green]%Y-%m-%d %R\"" set -g status-justify centre -#set -g status-bg default -#set -g status-fg cyan -#set -g status-interval 4 -#set -g status-left '' -#set -g status-right '' -#set -g status-left '#[fg=white,bold]#S#[fg=cyan] | #[fg=white,bold]#(echo $USER) ' -#set -g status-right '#[fg=white]#H#[fg=cyan] | #[fg=white]#(uname -r)#[default]' # Timeout for pane-numbering in milliseconds set-option -g display-panes-time 3000 @@ -135,16 +98,6 @@ set-option -g display-panes-time 3000 # Speed up commands set-option -sg escape-time 0 -# Highlight active window -#setw -g window-status-fg cyan -#setw -g window-status-bg default -#setw -g window-status-attr dim -#setw -g window-status-current-fg white -#setw -g window-status-current-bg default -#setw -g window-status-current-attr bright - -#setw -g monitor-activity on - # Highlighting the active window in status bar setw -g window-status-current-bg default setw -g window-status-current-fg default @@ -156,18 +109,14 @@ setw -g window-status-activity-fg default setw -g window-status-bell-attr blink setw -g window-status-bell-bg default setw -g window-status-bell-fg default -#setw -g window-status-format '#[fg=default]#[bg=default] #I #[bg=default]#[fg=black,bold] #W ' setw -g window-status-format '#[fg=green]#[bg=default] #I #[bg=default]#[fg=green]#W ' setw -g window-status-current-format '#[fg=red]#[bg=default] #I #[fg=red,bg=default]#W ' -# # Inactive panes set -g pane-border-fg colour238 -#set -g pane-border-bg black # Active panes set -g pane-active-border-fg colour247 -#set -g pane-active-border-bg yellow # Status messages set -g message-fg yellow