diff options
author | Cody Hiar <cody@hiar.ca> | 2021-11-25 11:30:46 -0700 |
---|---|---|
committer | Cody Hiar <cody@hiar.ca> | 2021-11-25 11:30:46 -0700 |
commit | 2e7676ad969cb3dcfe085f643d422577baa48148 (patch) | |
tree | 90993e34afe00884bb6dcfed23a0451ce887744f | |
parent | 5859c5812f75d1714b79272139d2c4df5031e569 (diff) |
trying some new things
-rwxr-xr-x | scripts/window_renum | 23 | ||||
-rw-r--r-- | stow/tmux/.tmux.conf | 24 |
2 files changed, 14 insertions, 33 deletions
diff --git a/scripts/window_renum b/scripts/window_renum deleted file mode 100755 index ef0a87f..0000000 --- a/scripts/window_renum +++ /dev/null @@ -1,23 +0,0 @@ -#!/usr/bin/env bash -# vim: set filetype=sh -# -# Author: Unknown -# Date: 2016-11-09 -# -# Description: Renumber tmux windows (1, 3, 4, 6) -> (1, 2, 3, 4) - -for session in $(tmux ls | awk -F: '{print $1}') ; do - active_window=$(tmux lsw -t ${session} | awk -F: '/\(active\)$/ {print $1}') - inum=1 - for window in $(tmux lsw -t ${session} | awk -F: '{print $1}') ;do - if [ ${window} -gt ${inum} ] ;then - echo "${session}:${window} -> ${session}:${inum}" - tmux movew -d -s ${session}:${window} -t ${session}:${inum} - fi - if [ ${window} = ${active_window} ] ;then - new_active_window=${inum} - fi - inum=$((${inum}+1)) - done - tmux select-window -t ${session}:${new_active_window} -done diff --git a/stow/tmux/.tmux.conf b/stow/tmux/.tmux.conf index bf4fb10..db37de0 100644 --- a/stow/tmux/.tmux.conf +++ b/stow/tmux/.tmux.conf @@ -3,6 +3,11 @@ ##################################### +# Try using space as the prefix +# I hate over-writing ctrl+b for vim +unbind C-Space +set -g prefix C-Space +bind C-Space send-prefix # Splits always start in the current pane's working directory unbind '"' unbind % @@ -28,11 +33,13 @@ bind C-e run-shell "~/.tmux/scripts/rolodex new" # Faster window switching bind C-n next-window bind C-p previous-window -bind S switch-client -l +# Use C-b to switch to last session +unbind C-b +bind C-b switch-client -l # Synchronize mode bind a set-window-option synchronize-panes # Remap zoom, sleeping tmux way too much -bind C-b resize-pane -Z +bind C-Space resize-pane -Z # I constantly mix up copy/paste. Very annoying/dangerous if cliboard has commands in it unbind [ bind C-f copy-mode @@ -45,8 +52,7 @@ bind -Tcopy-mode-vi Enter send -X copy-pipe "tmux save-buffer - | xp" # clock mode is over written by sessionist bind C-t clock-mode # Use fzf for switching sessions -unbind s -bind s \ +bind C-d \ display-popup \ -E \ "tmux list-sessions \ @@ -54,8 +60,6 @@ bind s \ | grep -v \"^$(tmux display-message -p '#S')\$\" \ | fzf --reverse \ | xargs tmux switch-client -t" -# Renumber the windows -bind C-w run-shell "~/.tmux/scripts/window_renum" ##################################### # Settings @@ -96,15 +100,15 @@ set-option -g status-left-length 110 set-option -g status-left "#S [#H]" set-option -g status-right "#{?window_bigger,[#{window_offset_x}#,#{window_offset_y}] ,}\"#{=21:pane_title}\" %H:%M %Y-%m-%d" set-option -g focus-events on +# If you have windows 1, 2, 3 and delete 2 I want the remaining to be 1, 2 not 1, 3 +set-option -g renumber-windows on + # Log focus to file set-hook -g pane-focus-in 'run "echo I #{pane_id} $(date) >>/tmp/focus"' # List of plugins set -g @plugin 'tmux-plugins/tpm' -set -g @plugin 'Thornycrackers-Forks/tmux-sessionist' -set -g @plugin 'Thornycrackers-Forks/tmux-open' -set -g @plugin 'Thornycrackers-Forks/tmux-fingers' -set -g @fingers-main-action 'tmux save-buffer - | xp' +# No plugins for now # Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf) run '~/.tmux/plugins/tpm/tpm' |