From 962958568d1d29f42f74750d5be1f61274c21882 Mon Sep 17 00:00:00 2001 From: Nathan Steel Date: Fri, 6 Aug 2021 12:22:15 +0100 Subject: [PATCH 1/3] Add additional keybindings - Add basic keybinds for display, pane, and window controls - Add basic keybinds for buffers --- .tmux.conf | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/.tmux.conf b/.tmux.conf index d76cd75..2aec515 100644 --- a/.tmux.conf +++ b/.tmux.conf @@ -32,6 +32,29 @@ set -g mouse on # Disable auto renames set-option -g allow-rename off +# Display +set -g base-index 1 # Start window numbering at 1 +setw -g pane-base-index 1 # Start pane numbering at 1 + +set -g renumber-windows on # Renumber windows on close + +# Pane Controls +bind -r > swap-pane -D # Next pane +bind -r < swap-pane -U # Prev Pan +bind -n M-> swap-pane -D # Next pane +bind -n M-< swap-pane -U # Next pane + +# Window Controls +unbind n +unbind p +bind -r C-h previous-window # select previous window +bind -r C-l next-window # select next window +bind Tab last-window # move to last active window + +# Buffers +bind b list-buffers # list paste buffers +bind p paste-buffer # paste from the top paste buffer +bind P choose-buffer # Popup Session #bind -n M-g display-popup -E "tmux new-session -A -s scratch" From 013f9b4c2f3b755def17f460593f07096d215a95 Mon Sep 17 00:00:00 2001 From: Nathan Steel Date: Fri, 6 Aug 2021 17:09:42 +0100 Subject: [PATCH 2/3] [WIP] Tmux keybinds, and styling to try - WIP. To be fleshed out in the next commit - Add additional keykindings - Add basic styling --- .tmux.conf | 55 ++++++++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 45 insertions(+), 10 deletions(-) diff --git a/.tmux.conf b/.tmux.conf index 2aec515..426d673 100644 --- a/.tmux.conf +++ b/.tmux.conf @@ -11,16 +11,16 @@ bind k select-pane -U bind l select-pane -R # switch panes using CRTL+hjkl -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 -n M-h select-pane -L +bind -n M-j select-pane -D +bind -n M-k select-pane -U +bind -n M-l select-pane -R # Resize Panes with CTRL+Shift+HJKL (or just caps) -#bind -n C-H resize-pane -L 2 -#bind -n C-J resize-pane -D 2 -#bind -n C-K resize-pane -U 2 -#bind -n C-L resize-pane -R 2 +bind -n C-S-h resize-pane -L 2 +bind -n C-S-j resize-pane -D 2 +bind -n C-S-k resize-pane -U 2 +bind -n C-S-l resize-pane -R 2 # Zoom into the current pane bind-key z resize-pane -Z @@ -45,17 +45,52 @@ bind -n M-> swap-pane -D # Next pane bind -n M-< swap-pane -U # Next pane # Window Controls -unbind n -unbind p +#unbind n +#unbind p bind -r C-h previous-window # select previous window bind -r C-l next-window # select next window bind Tab last-window # move to last active window +# Sessions +bind -n C-s new-session + # Buffers bind b list-buffers # list paste buffers bind p paste-buffer # paste from the top paste buffer bind P choose-buffer +# Split keys +#bind / split-window -h # Split panes horizontal +#bind \ split-window -v # Split panes vertically + +# ? +set -g status-keys vi +set -g mode-keys vi + # Popup Session #bind -n M-g display-popup -E "tmux new-session -A -s scratch" +# THEME +# https://gist.github.com/spicycode/1229612 +set -g status-bg black +set -g status-fg white +#set -g window-status-current-bg white +#set -g window-status-current-fg black +#set -g window-status-current-attr bold +set -g status-interval 60 +set -g status-left-length 30 + +# https://www.hamvocke.com/blog/a-guide-to-customizing-your-tmux-conf/ +# loud or quiet? +set -g visual-activity off +set -g visual-bell off +set -g visual-silence off +setw -g monitor-activity off +set -g bell-action none + +# statusbar +set -g status-position bottom +#set -g status-justify center +#set -g status-right-length 50 +#set -g status-left-length 20 + From 80a4e55e10159aa60786c8b024ecd4dd5e159ef2 Mon Sep 17 00:00:00 2001 From: Nathan Steel Date: Sat, 7 Aug 2021 17:25:14 +0100 Subject: [PATCH 3/3] Add keybinds, and basic theme to tmux - Finalised the WIP to add keybinds I like - Primarily for WSL/floating window managers --- .tmux.conf | 64 ++++++++++++++++++++++++++++-------------------------- 1 file changed, 33 insertions(+), 31 deletions(-) diff --git a/.tmux.conf b/.tmux.conf index 426d673..db3e870 100644 --- a/.tmux.conf +++ b/.tmux.conf @@ -4,6 +4,9 @@ bind r source ~/.tmux.conf # Remove ESC moving panes, etc set -s escape-time 0 +# ------ Controls ------ +# ---- Pane Controls ---- + # Vim binding for pane switching (needs to take multiple inputs tho) bind h select-pane -L bind j select-pane -D @@ -22,36 +25,28 @@ bind -n C-S-j resize-pane -D 2 bind -n C-S-k resize-pane -U 2 bind -n C-S-l resize-pane -R 2 -# Zoom into the current pane -bind-key z resize-pane -Z -bind -n C-z resize-pane -Z - -# Enable mouse control (clickable windows, panes, resizable panes) -set -g mouse on - -# Disable auto renames -set-option -g allow-rename off - -# Display -set -g base-index 1 # Start window numbering at 1 -setw -g pane-base-index 1 # Start pane numbering at 1 - -set -g renumber-windows on # Renumber windows on close - -# Pane Controls +# Switch Panes bind -r > swap-pane -D # Next pane bind -r < swap-pane -U # Prev Pan bind -n M-> swap-pane -D # Next pane bind -n M-< swap-pane -U # Next pane -# Window Controls +# Splits +bind -n M-/ split-window -h # Split panes horizontal +bind -n M-? split-window -v # Split panes vertically + +# Zoom into the current pane +bind-key z resize-pane -Z +bind -n C-z resize-pane -Z + +# ---- Window Controls ---- #unbind n #unbind p bind -r C-h previous-window # select previous window bind -r C-l next-window # select next window bind Tab last-window # move to last active window -# Sessions +# ---- Session Controls ---- bind -n C-s new-session # Buffers @@ -59,24 +54,31 @@ bind b list-buffers # list paste buffers bind p paste-buffer # paste from the top paste buffer bind P choose-buffer -# Split keys -#bind / split-window -h # Split panes horizontal -#bind \ split-window -v # Split panes vertically +# Popup Session +#bind -n M-g display-popup -E "tmux new-session -A -s scratch" + +# ------ General ------ +# Enable mouse control (clickable windows, panes, resizable panes) +#set -g mouse on + +# Disable auto renames +set-option -g allow-rename off +setw -g automatic-rename off + +# Display +set -g base-index 1 # Start window numbering at 1 +setw -g pane-base-index 1 # Start pane numbering at 1 + +set -g renumber-windows on # Renumber windows on close -# ? set -g status-keys vi set -g mode-keys vi -# Popup Session -#bind -n M-g display-popup -E "tmux new-session -A -s scratch" - -# THEME +# ------ Theme ------ # https://gist.github.com/spicycode/1229612 set -g status-bg black set -g status-fg white -#set -g window-status-current-bg white -#set -g window-status-current-fg black -#set -g window-status-current-attr bold +set-window-option -g window-status-current-style fg=black,bg=white set -g status-interval 60 set -g status-left-length 30 @@ -90,7 +92,7 @@ set -g bell-action none # statusbar set -g status-position bottom -#set -g status-justify center +set -g status-justify centre #set -g status-right-length 50 #set -g status-left-length 20