feat: add more keybinds for navigation
fix session restore asking to name all windows again
This commit is contained in:
+30
-11
@@ -1,8 +1,19 @@
|
|||||||
# ~/.config/tmux/tmux.conf
|
# ~/.config/tmux/tmux.conf
|
||||||
|
|
||||||
|
# ┌
|
||||||
|
# │ NOTE: $KITTY_LISTEN_ON is not being updated no matter
|
||||||
|
# │ how I try
|
||||||
|
# │ unless the server is killed and restarted.
|
||||||
|
# │ On macOS, I accidentally Cmd+Q often and therefore lose
|
||||||
|
# │ the socket
|
||||||
|
# └
|
||||||
|
set -g update-environment -r
|
||||||
|
setenv -g KITTY_LISTEN_ON $KITTY_LISTEN_ON
|
||||||
|
set -ag update-environment 'KITTY_LISTEN_ON'
|
||||||
|
|
||||||
set -g escape-time 0
|
set -g escape-time 0
|
||||||
set -g default-terminal "tmux-256color"
|
set -g default-terminal "xterm-256color"
|
||||||
set -ag terminal-overrides ",xterm-256color:RGB"
|
set -ag terminal-overrides ",xterm-256color:Tc,xterm-kitty:Tc,alacritty:Tc"
|
||||||
set -g history-limit 150000
|
set -g history-limit 150000
|
||||||
set -g display-time 2500
|
set -g display-time 2500
|
||||||
set -g status-interval 5
|
set -g status-interval 5
|
||||||
@@ -11,23 +22,27 @@ set -g status-position top
|
|||||||
|
|
||||||
# Start indexes at 1 instead of 0
|
# Start indexes at 1 instead of 0
|
||||||
set -g base-index 1
|
set -g base-index 1
|
||||||
setw -g pane-base-index 1
|
set -g pane-base-index 1
|
||||||
set -g renumber-windows on
|
set -g renumber-windows on
|
||||||
|
|
||||||
# Set term title to current session window
|
# Set term title to current session window
|
||||||
set -g set-titles on
|
set -g set-titles on
|
||||||
set -g set-titles-string "#I: #W"
|
set -g set-titles-string "#I: #W"
|
||||||
|
|
||||||
|
setw -g automatic-rename off
|
||||||
|
set -g allow-rename off
|
||||||
|
|
||||||
# Change prefix from ctrl+b to ctrl+a
|
# Change prefix from ctrl+b to ctrl+a
|
||||||
set -g prefix C-a
|
set -g prefix C-a
|
||||||
unbind C-b
|
unbind C-b
|
||||||
bind-key C-a send-prefix
|
# nested session handling?
|
||||||
|
bind-key C-a last-window #send-prefix
|
||||||
|
bind-key a send-prefix
|
||||||
|
|
||||||
# Split windows with | and -
|
# Split windows with | and -
|
||||||
unbind %
|
unbind %
|
||||||
bind-key -N "Add a new pane to the right of the currently active pane" | split-window -h -c "#{pane_current_path}"
|
|
||||||
|
|
||||||
unbind '"'
|
unbind '"'
|
||||||
|
bind-key -N "Add a new pane to the right of the currently active pane" | split-window -h -c "#{pane_current_path}"
|
||||||
bind-key -N "Add a new pane under the currently active pane" - split-window -v -c "#{pane_current_path}"
|
bind-key -N "Add a new pane under the currently active pane" - split-window -v -c "#{pane_current_path}"
|
||||||
|
|
||||||
# Reload config
|
# Reload config
|
||||||
@@ -49,20 +64,23 @@ bind-key -N "Resize pane down" -r j resize-pane -D 5
|
|||||||
bind-key -N "Resize pane up" -r k resize-pane -U 5
|
bind-key -N "Resize pane up" -r k resize-pane -U 5
|
||||||
bind-key -N "Resize pane right" -r l resize-pane -R 5
|
bind-key -N "Resize pane right" -r l resize-pane -R 5
|
||||||
|
|
||||||
|
# window layout
|
||||||
|
bind-key -N "Cycle window layout" enter next-layout
|
||||||
|
bind-key -N "Rotate panes clockwise around window" -n C-o rotate-window
|
||||||
|
|
||||||
# Fullscreen current pane
|
# Fullscreen current pane
|
||||||
bind-key -N "Zoom current pane (fill window)" -r m resize-pane -Z
|
bind-key -N "Zoom current pane (fill window)" -r m resize-pane -Z
|
||||||
|
|
||||||
# create new windows in the same cwd
|
# create new windows in the same cwd
|
||||||
bind-key -N "Create a new window within CWD" c new-window -c "#{pane_current_path}"
|
bind-key -N "Create a new window within CWD" c new-window -c "#{pane_current_path}"
|
||||||
|
|
||||||
|
# Prompt to rename new windows on creation
|
||||||
|
# set-hook -g after-new-window 'command-prompt -I "#{window_pane}" "rename-window '%%'"'
|
||||||
|
|
||||||
# Window navigation
|
# Window navigation
|
||||||
bind-key -N "Move to previous window" -n C-p previous-window
|
bind-key -N "Move to previous window" -n C-p previous-window
|
||||||
bind-key -N "Move to next window" -n C-n next-window
|
bind-key -N "Move to next window" -n C-n next-window
|
||||||
|
|
||||||
# Prompt to rename new windows on creation
|
|
||||||
set-hook -g after-new-window 'command-prompt -I "#{window_pane}" "rename-window '%%'"'
|
|
||||||
|
|
||||||
set -g mouse on
|
|
||||||
|
|
||||||
setw -g mode-keys vi
|
setw -g mode-keys vi
|
||||||
setw -g status-keys vi
|
setw -g status-keys vi
|
||||||
|
|
||||||
@@ -72,6 +90,7 @@ unbind -T copy-mode-vi Enter;
|
|||||||
bind-key -N "Begin selection" -T copy-mode-vi 'v' send -X begin-selection
|
bind-key -N "Begin selection" -T copy-mode-vi 'v' send -X begin-selection
|
||||||
bind-key -N "Copy selection to buffer" -T copy-mode-vi 'y' send -X copy-selection
|
bind-key -N "Copy selection to buffer" -T copy-mode-vi 'y' send -X copy-selection
|
||||||
|
|
||||||
|
set -g mouse on
|
||||||
unbind -T copy-mode-vi MouseDragEnd1Pane
|
unbind -T copy-mode-vi MouseDragEnd1Pane
|
||||||
|
|
||||||
##########################
|
##########################
|
||||||
|
|||||||
Reference in New Issue
Block a user