repo: Remove traces of tmux configuration
While I never disliked tmux I have not been using it for absolute ages now, ever since starting to multiplex with wezterm. Wezterm can (at least with my current setup) *not* replace all tmux functionality - especially running multiple sessions in a detachable way on a remote server - but I have never needed those in a long time now. Detachable sessions I can create instead with `abduco`.
This commit is contained in:
parent
0237b7d569
commit
2c1487ab93
17 changed files with 3 additions and 539 deletions
|
|
@ -1,57 +0,0 @@
|
|||
#!/usr/bin/env sh
|
||||
|
||||
exist() { type "$1" >/dev/null 2>&1; }
|
||||
|
||||
# alias tmux to follow xdg-specification
|
||||
# shellcheck disable=2139
|
||||
alias tmux="tmux -f ${XDG_CONFIG_HOME:-$HOME/.config}/tmux/tmux.conf"
|
||||
|
||||
# fzf
|
||||
if exist fzf; then
|
||||
# fzf select a tmux session to connect to, with pane preview
|
||||
alias tm='_fzf_tmux_attach_start_session'
|
||||
alias tl=tm
|
||||
else
|
||||
alias tm='tmux_attach_start'
|
||||
# show a list of running tmux sessions
|
||||
alias tl='tmux list-sessions -F "#{session_name}" 2>/dev/null '
|
||||
fi
|
||||
|
||||
_fzf_tmux_list_sessions() {
|
||||
tmux list-sessions -F "#{session_name}" 2>/dev/null | fzf \
|
||||
--layout=reverse \
|
||||
--height=50% \
|
||||
--border \
|
||||
--prompt="Session> " \
|
||||
--preview="tmux_pane_tree {}" \
|
||||
--preview-window=right:80% \
|
||||
--print-query
|
||||
}
|
||||
|
||||
_fzf_tmux_attach_start_session() {
|
||||
if [ -z "$1" ]; then
|
||||
result=$(_fzf_tmux_list_sessions)
|
||||
case "$?" in
|
||||
0)
|
||||
# found a session, attaching
|
||||
tmux_attach_start "$(echo "$result" | tail --lines=1)"
|
||||
;;
|
||||
1)
|
||||
# did not find a session, creating
|
||||
result=$(echo "$result" | head --lines=1)
|
||||
# if . was only thing entered, create one for current dir
|
||||
if [ "$result" = "." ]; then
|
||||
tmux_attach_start
|
||||
# create for query name
|
||||
else
|
||||
tmux_attach_start "$result"
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
else
|
||||
tmux_attach_start "$1"
|
||||
fi
|
||||
}
|
||||
|
||||
unset choice
|
||||
unset -f exist
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
rename-window dot-git
|
||||
send-keys "cd ~/.dotfiles; while true; do [[ -z $(git status -s) ]] && { fd -t f --hidden | entr -cd tea issue ;} || { fd -t f --hidden | entr -cd git -c color.ui=always diff ;} ; done"
|
||||
split-window -h "cd ~/.dotfiles; while true; do fd -t f --hidden --exclude .git/objects | entr -cd git -c color.ui=always status; done"
|
||||
split-window -v
|
||||
send-keys "cd ~/.dotfiles; clear" C-m L C-m
|
||||
select-pane -t 1
|
||||
split-window -v "cd ~/.dotfiles; while true; do fd -t f --hidden --exclude .git/objects | entr -cd git -c color.ui=always log --graph --date=short --decorate --oneline --all --remotes; done"
|
||||
select-pane -t 4
|
||||
new-window -n code
|
||||
send-keys "cd ~/.dotfiles; v ." C-m zo
|
||||
new-window -n test
|
||||
select-window -t 1
|
||||
attach-session -t . -c ~/.dotfiles
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
rename-window server
|
||||
send-keys "mopidy" C-m
|
||||
new-window -n player
|
||||
send-keys "ncmpcpp" C-m
|
||||
new-window -n mixer
|
||||
send-keys "pulsemixer" C-m
|
||||
new-window -n bluetooth
|
||||
send-keys "bluetoothctl" C-m
|
||||
select-window -t 2
|
||||
|
|
@ -1,7 +0,0 @@
|
|||
rename-window notes
|
||||
send-keys vm Space $WIKIROOT Space $LIBRARY C-m
|
||||
new-window -n notepad
|
||||
send-keys cd Space $WIKIROOT C-m
|
||||
send-keys v C-m
|
||||
send-keys Space w w
|
||||
attach-session -t . -c $WIKIROOT
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
rename-window mail
|
||||
send-keys "neomutt" C-m
|
||||
new-window -n news
|
||||
send-keys "newsboat" C-m
|
||||
split-window -h
|
||||
send-keys "tut" C-m
|
||||
new-window -n matrix
|
||||
send-keys "gomuks" C-m
|
||||
new-window -n signal
|
||||
send-keys "siggo" C-m
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
rename-window stats
|
||||
send-keys "cd ~/documents/records; v workout.md" C-m
|
||||
new-window -n routine
|
||||
send-keys "cd ~/documents/records; sc-im workout.csv" C-m
|
||||
|
|
@ -1,15 +0,0 @@
|
|||
rename-window focus
|
||||
send-keys tasksh C-m "+TODAY" C-m
|
||||
new-window -n dash
|
||||
send-keys "cd ${XDG_DATA_HOME:-~/.local/share}/task/; fd . | entr -c task next" C-m
|
||||
split-window -h -l 71
|
||||
send-keys "cd ${XDG_DATA_HOME:-~/.local/share}/task/; fd . | entr -c task summary" C-m
|
||||
split-window -v "cd ${XDG_DATA_HOME:-~/.local/share}/task/; fd . | entr -c task status:pending or +ACTIVE burndown"
|
||||
select-pane -t 1
|
||||
split-window -v -l 5
|
||||
send-keys "t" Space
|
||||
new-window -n journal
|
||||
send-keys "calcurse" C-m
|
||||
split-window -h -l 35% "ls ~/documents/records/jrnl.md | entr -c jrnl -5"
|
||||
split-window -v -l 10%
|
||||
select-window -t 2
|
||||
|
|
@ -1,183 +0,0 @@
|
|||
# Layout of this conf file:
|
||||
# 1. Global Settings
|
||||
# 2. Plugins
|
||||
# 3. Keybinds
|
||||
# 4. Theme
|
||||
|
||||
# For rapid change prototyping, disabled normally:
|
||||
# bind-key r source-file ~/.config/tmux/tmux.conf \; display-message "config reloaded."
|
||||
|
||||
######################
|
||||
### 1. GLOBAL SETTINGS
|
||||
######################
|
||||
|
||||
# show that activity happens but don't display a huge 'activity happening' notification
|
||||
setw -g monitor-activity on
|
||||
set -g visual-activity off
|
||||
|
||||
# Start counting windows and panes at 1
|
||||
set -g base-index 1
|
||||
setw -g pane-base-index 1
|
||||
set -g renumber-windows on
|
||||
|
||||
# Terminal improvements
|
||||
set-window-option -g automatic-rename on
|
||||
set-option -g set-titles on
|
||||
set -g mouse on
|
||||
# allow truecolor support
|
||||
set -g default-terminal 'xterm-256color'
|
||||
set -ga terminal-overrides ',xterm-256color:Tc'
|
||||
set -g status-keys vi
|
||||
set-window-option -g mode-keys vi
|
||||
set -g history-limit 10000
|
||||
|
||||
# Screen size is based on the smallest client looking at the current windows, not the smallest
|
||||
# client connected to the overall session. If two clients are connected to the same session but not
|
||||
# looking at the same window, why would they care about each others screen size?
|
||||
setw -g aggressive-resize on
|
||||
|
||||
# No delay for escape key press
|
||||
set -sg escape-time 0
|
||||
|
||||
# to enable autoread option in neovim
|
||||
set-option -g focus-events on
|
||||
|
||||
####################
|
||||
## 2. PLUGINS ##
|
||||
####################
|
||||
|
||||
set -g @tpm_plugins ' \
|
||||
tmux-plugins/tpm \
|
||||
tmux-plugins/tmux-sensible \
|
||||
christoomey/vim-tmux-navigator \
|
||||
Morantron/tmux-fingers \
|
||||
'
|
||||
|
||||
set -g @fingers-key F
|
||||
|
||||
# make sure tpm is installed
|
||||
if-shell "test ! -d $TMUX_PLUGIN_MANAGER_PATH/tpm" \
|
||||
"run 'git clone https://github.com/tmux-plugins/tpm $TMUX_PLUGIN_MANAGER_PATH/tpm && $TMUX_PLUGIN_MANAGER_PATH/tpm/bin/install_plugins'" \
|
||||
|
||||
# optinally add this to install plugins on each start -- adds small lag to startup
|
||||
# "run-shell $TMUX_PLUGIN_MANAGER_PATH/tpm/bin/install_plugins"
|
||||
|
||||
#####################
|
||||
## 3. KEYBINDINGS ##
|
||||
#####################
|
||||
|
||||
# Unbind some defaults
|
||||
unbind '"'
|
||||
unbind %
|
||||
|
||||
# Custom modifier key
|
||||
set -g prefix C-a
|
||||
unbind-key C-b
|
||||
bind-key -r C-a send-prefix
|
||||
|
||||
# Window Navigation - Prefix + Vim Keys
|
||||
bind-key -r C-h select-window -t :-
|
||||
bind-key -r C-l select-window -t :+
|
||||
|
||||
# Resize Panes
|
||||
bind-key -r H resize-pane -L 3
|
||||
bind-key -r J resize-pane -D 1
|
||||
bind-key -r K resize-pane -U 1
|
||||
bind-key -r L resize-pane -R 3
|
||||
|
||||
bind-key -r C-H resize-pane -L 10
|
||||
bind-key -r C-J resize-pane -D 5
|
||||
bind-key -r C-K resize-pane -U 5
|
||||
bind-key -r C-L resize-pane -R 10
|
||||
|
||||
# Send Pane to a new window (but stay on current window), join it back into the current window
|
||||
bind-key B break-pane -d
|
||||
bind-key C-b command-prompt -p "join pane from: " "join-pane -h -s '%%'"
|
||||
|
||||
# Swap panes within the current window (swaps pane # entered with currently selected pane)
|
||||
bind-key b display-panes\; command-prompt -p "pane #: " "swap-pane -t '%%'"
|
||||
|
||||
# Kill tabs quicker
|
||||
bind-key x kill-pane
|
||||
bind-key C-x kill-window
|
||||
|
||||
# Split Window into panes - automatically handled by plugin
|
||||
bind-key '\' split-window -h -c '#{pane_current_path}'
|
||||
bind-key '-' split-window -v -c '#{pane_current_path}'
|
||||
|
||||
# Open a sessions chooser
|
||||
bind C-s split-window -v "tmux list-sessions | sed -E 's/:.*$//' | grep -v \"^$(tmux display-message -p '#S')\$\" | fzf --reverse | xargs tmux switch-client -t"
|
||||
|
||||
# Make visual selections act a little more like vim
|
||||
bind-key -T copy-mode-vi v send -X begin-selection
|
||||
bind-key -T copy-mode-vi V send -X select-line
|
||||
bind-key -T copy-mode-vi y send -X copy-pipe-and-cancel 'wl-copy' \; send -X rectangle-off
|
||||
bind-key -T copy-mode-vi 'C-v' send -X begin-selection \; send -X rectangle-on
|
||||
|
||||
#####################
|
||||
## 4. THEME ##
|
||||
#####################
|
||||
|
||||
# Status update interval
|
||||
set -g status-interval 1
|
||||
# Clock mode
|
||||
set -g clock-mode-colour colour24
|
||||
set -g clock-mode-style 24
|
||||
|
||||
# This tmux statusbar config was created by tmuxline.vim
|
||||
# on Wed, 13 Mar 2019
|
||||
|
||||
set -g message-command-style bg="#2e2e2e",fg="#c8c8c8"
|
||||
set -g message-style bg="#2e2e2e",fg="#c8c8c8"
|
||||
set -g pane-active-border-style fg="#2e2e2e"
|
||||
set -g pane-border-style fg="#2e2e2e"
|
||||
set -g status-justify "centre"
|
||||
set -g status "on"
|
||||
set -g status-style "none"
|
||||
set -g status-style "none"
|
||||
set -g status-left-length "100"
|
||||
set -g status-right-length "100"
|
||||
setw -g window-status-style fg="#c8c8c8",bg="#2e2e2e","none"
|
||||
setw -g window-status-activity-style bg="#2e2e2e",fg="#c8c8c8","underscore"
|
||||
setw -g window-status-separator ""
|
||||
set -g status-left "#[fg=#c8c8c8,bg=#2e2e2e] #S #[fg=#2e2e2e,bg=#2e2e2e,nobold,nounderscore,noitalics]#[fg=#c8c8c8,bg=#2e2e2e] #I:#P #[fg=#2e2e2e,bg=#2e2e2e,nobold,nounderscore,noitalics]#[fg=#c8c8c8,bg=#2e2e2e] #[fg=#2e2e2e,bg=#2e2e2e,nobold,nounderscore,noitalics]"
|
||||
set -g status-right "#[fg=#2e2e2e,bg=#2e2e2e,nobold,nounderscore,noitalics] #[fg=#c8c8c8,bg=#2e2e2e] #{?client_prefix,#[fg=colour232]#[bg=brightblue],} #(whoami) #[fg=#2e2e2e,bg=#2e2e2e,nobold,nounderscore,noitalics]#[fg=#c8c8c8,bg=#2e2e2e] %d-%b-%y #[fg=#2e2e2e,bg=#2e2e2e,nobold,nounderscore,noitalics]#[fg=#c8c8c8,bg=#2e2e2e] #H "
|
||||
setw -g window-status-format "#[fg=#2e2e2e,bg=#2e2e2e,nobold,nounderscore,noitalics]#[default] #I #W #[fg=#2e2e2e,bg=#2e2e2e,nobold,nounderscore,noitalics]"
|
||||
setw -g window-status-current-format "#[fg=#2e2e2e,bg=#2e2e2e,nobold,nounderscore,noitalics]#[fg=#c8c8c8,bg=#2e2e2e] #I #W #[fg=#2e2e2e,bg=#2e2e2e,nobold,nounderscore,noitalics]"
|
||||
|
||||
########################
|
||||
## 5. Nested Sessions ##
|
||||
########################
|
||||
# from: https://github.com/samoshkin/tmux-config/blob/master/tmux/tmux.conf
|
||||
# all credit to samoshkin
|
||||
|
||||
# Session is considered to be remote when we ssh into host
|
||||
if-shell 'test -n "$SSH_CLIENT"' \
|
||||
'source-file $XDG_CONFIG_HOME/tmux/tmux.remote.conf'
|
||||
|
||||
# We want to have single prefix key "C-a", usable both for local and remote session
|
||||
# we don't want to "C-a" + "a" approach either
|
||||
# Idea is to turn off all key bindings and prefix handling on local session,
|
||||
# so that all keystrokes are passed to inner/remote session
|
||||
|
||||
# see: toggle on/off all keybindings · Issue #237 · tmux/tmux - https://github.com/tmux/tmux/issues/237
|
||||
|
||||
# Also, change some visual styles when window keys are off
|
||||
bind -T root F12 \
|
||||
set prefix None \;\
|
||||
set key-table off \;\
|
||||
set status-style fg="colour245",bg="colour238" \;\
|
||||
set window-status-current-format "#[fg=$color_window_off_status_bg,bg=$color_window_off_status_current_bg]$separator_powerline_right#[default] #I:#W# #[fg=$color_window_off_status_current_bg,bg=$color_window_off_status_bg]$separator_powerline_right#[default]" \;\
|
||||
set window-status-current-style fg="colour232",bg="colour254","bold" \;\
|
||||
if -F '#{pane_in_mode}' 'send-keys -X cancel' \;\
|
||||
refresh-client -S \;\
|
||||
|
||||
bind -T off F12 \
|
||||
set -u prefix \;\
|
||||
set -u key-table \;\
|
||||
set -u status-style \;\
|
||||
set -u window-status-current-style \;\
|
||||
set -u window-status-current-format \;\
|
||||
refresh-client -S
|
||||
|
||||
run -b "$TMUX_PLUGIN_MANAGER_PATH/tpm/tpm"
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
# show status bar at bottom for remote session,
|
||||
set -g status-position bottom
|
||||
|
||||
# Set port of SSH remote tunnel, where tmux will pipe buffers to transfer on local machine for copy
|
||||
set -g @copy_backend_remote_tunnel_port 11988
|
||||
|
||||
# In remote mode we don't show "clock" and "battery status" widgets
|
||||
set -g status-left "#[fg=#c8c8c8,bg=#2e2e2e][SSH]#S #[fg=#2e2e2e,bg=#2e2e2e,nobold,nounderscore,noitalics]#[fg=#c8c8c8,bg=#2e2e2e] #(whoami) #[fg=#2e2e2e,bg=#2e2e2e,nobold,nounderscore,noitalics]#[fg=#c8c8c8,bg=#2e2e2e] #I:#P #[fg=#2e2e2e,bg=#2e2e2e,nobold,nounderscore,noitalics]"
|
||||
set -g status-right "#{prefix_highlight} $wg_is_keys_off $wg_is_zoomed #{sysstat_cpu} | #{sysstat_mem} | #{sysstat_loadavg} | $wg_user_host | #{online_status}"
|
||||
set -g status-right "#[fg=#2e2e2e,bg=#2e2e2e,nobold,nounderscore,noitalics]#{prefix_highlight} #H "
|
||||
|
|
@ -1,12 +0,0 @@
|
|||
#compdef _tmux_attach_start
|
||||
#
|
||||
# Requires tmux_attach_start script in path
|
||||
#
|
||||
# Enables completion for zsh of tmux_attach_start function
|
||||
# with currently open sessions, or tmux options.
|
||||
|
||||
_tmux_attach_start() {
|
||||
_alternative \
|
||||
"sessions:user sessions:($(tmux list-sessions -F'#{session_name}' 2>/dev/null))"
|
||||
}
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue