diff --git a/tmux.conf b/tmux.conf index cfd5a023..a8a21342 100644 --- a/tmux.conf +++ b/tmux.conf @@ -1,6 +1,4 @@ ## Behavior ############### -# set correct Term -# set-option -g default-terminal "screen-256color" # Zero-based indexing is fine in programming languages, but not so much in # a multiplexer when zero is on the other side of the keyboard. set -g base-index 1 @@ -23,7 +21,7 @@ set-option -g default-command "reattach-to-user-namespace -l zsh" ## Key bindings ########### # Remap the key prefix -set -g prefix C-a +set -g prefix C-Space unbind C-b # Restore go-to-start-of-line shortcut bind C-a send-prefix @@ -47,30 +45,22 @@ bind-key -t vi-copy Enter copy-pipe "reattach-to-user-namespace pbcopy" # Better splitting keybinds unbind % unbind '"' -bind H split-window -v -bind V split-window -h +bind s split-window -v +bind v split-window -h # Navigate between panes -bind h select-pane -L -bind j select-pane -D -bind k select-pane -U -bind l select-pane -R -bind-key -r C-h select-window -t :- -bind-key -r C-l select-window -t :+ bind -n C-h run "(tmux display-message -p '#{pane_current_command}' | grep -iqE '(^|\/)g?(view|vim?)(diff)?$' && tmux send-keys C-h) || tmux select-pane -L" bind -n C-j run "(tmux display-message -p '#{pane_current_command}' | grep -iqE '(^|\/)g?(view|vim?)(diff)?$' && tmux send-keys C-j) || tmux select-pane -D" bind -n C-k run "(tmux display-message -p '#{pane_current_command}' | grep -iqE '(^|\/)g?(view|vim?)(diff)?$' && tmux send-keys C-k) || tmux select-pane -U" bind -n C-l run "(tmux display-message -p '#{pane_current_command}' | grep -iqE '(^|\/)g?(view|vim?)(diff)?$' && tmux send-keys C-l) || tmux select-pane -R" bind -n C-\ run "(tmux display-message -p '#{pane_current_command}' | grep -iqE '(^|\/)g?(view|vim?)(diff)?$' && tmux send-keys 'C-\\') || tmux select-pane -l" +# bind-key -r C-h select-window -t :- +# bind-key -r C-l select-window -t :+ # after copying to a tmux buffer, hit y again to copy to clipboard bind y run "tmux save-buffer - | reattach-to-user-namespace pbcopy" # quick view of processes bind '~' split-window "exec top" -# Cycling through windows -bind-key -n C-right next -bind-key -n C-left prev - ## Looks ######################## # make tmux display things in 256 colors