tmux config

added 'notes' to all the keybinds so they show up in the `prefix-?` key
list
a bit of housekeeping
trying out having the statusbar on top
This commit is contained in:
2024-11-07 13:12:16 -05:00
parent 1dfbc25ddf
commit 2adb6d8fbc
+24 -21
View File
@@ -7,10 +7,12 @@ set -g history-limit 150000
set -g display-time 3000
set -g status-interval 5
set -g focus-events on
set -g status-position top
# Start indexes at 1 instead of 0
set -g base-index 1
setw -g pane-base-index 1
set -g renumber-windows on
# Set term title to current session window
set -g set-titles on
@@ -23,48 +25,49 @@ bind-key C-a send-prefix
# Split windows with | and -
unbind %
bind | split-window -h -c "#{pane_current_path}"
bind-key -N "Add a new pane to the right of the currently active pane" | split-window -h -c "#{pane_current_path}"
unbind '"'
bind - 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
unbind R
bind -N "Reload tmux configuration" R source-file ~/.config/tmux/tmux.conf \; display "Config reloaded."
bind-key -N "Reload tmux configuration" R source-file ~/.config/tmux/tmux.conf \; display "Config reloaded."
# Pane navigation
bind -n C-h select-pane -L
bind -n C-j select-pane -D
bind -n C-k select-pane -U
bind -n C-l select-pane -R
bind-key -N "Navigate one pane to the left" -n C-h select-pane -L
bind-key -N "Navigate one pane down" -n C-j select-pane -D
bind-key -N "Navigate one pane up" -n C-k select-pane -U
bind-key -N "Navigate one pane to the right" -n C-l select-pane -R
# Resize panes
bind -r h resize-pane -L 5
bind -r j resize-pane -D 5
bind -r k resize-pane -U 5
bind -r l resize-pane -R 5
bind-key -N "Resize pane left" -r h resize-pane -L 5
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 right" -r l resize-pane -R 5
# Fullscreen current pane
bind -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
bind c new-window -c "#{pane_current_path}"
bind-key -N "Create a new window within CWD" c new-window -c "#{pane_current_path}"
# Window navigation
bind -n C-p previous-window
bind -n C-n next-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
# Prompt to rename new windows on creation
set-hook -g after-new-window 'command-prompt -I "#{window_pane}" "rename-window '%%'"'
set -g mouse on
set-window-option -g mode-keys vi
setw -g mode-keys vi
setw -g status-keys vi
unbind -T copy-mode-vi Space;
unbind -T copy-mode-vi Enter;
bind-key -T copy-mode-vi 'v' send -X begin-selection
bind-key -T copy-mode-vi 'y' send -X copy-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
unbind -T copy-mode-vi MouseDragEnd1Pane
@@ -100,15 +103,15 @@ set -g @matryoshka_inactive_status_style 'fg=default,bg=brightblack' # TODO: Try
# use fzf to switch sessions
unbind s
bind-key s run-shell -b "$HOME/.config/tmux/plugins/tmux-fzf/scripts/session.sh switch"
bind-key -N "Attach to another session" s run-shell -b "$HOME/.config/tmux/plugins/tmux-fzf/scripts/session.sh switch"
# use fzf to switch windows
unbind w
bind-key w run-shell -b "$HOME/.config/tmux/plugins/tmux-fzf/scripts/window.sh switch"
bind-key -N "Switch to another window (works across any session)" w run-shell -b "$HOME/.config/tmux/plugins/tmux-fzf/scripts/window.sh switch"
##### FZF settings
TMUX_FZF_SESSION_FORMAT="#{session_windows} windows"
bind m run-shell -b "$HOME/.config/tmux/plugins/tmux-fzf/scripts/menu.sh"
bind-key -N "User FZF menu" m run-shell -b "$HOME/.config/tmux/plugins/tmux-fzf/scripts/menu.sh"
# needs 1 or 3+ entries.
TMUX_FZF_MENU=\