Updated tmux theme to be consistant with nvim.

This commit is contained in:
cyteen 2024-05-03 14:44:48 +01:00
parent 78f7914f9e
commit 807cced418
1 changed files with 329 additions and 303 deletions

View File

@ -12,7 +12,7 @@ set -x
sudo apt update sudo apt update
sudo apt install -y tmux sudo apt install -y tmux
sudo apt install -y tmux-plugin-manager sudo apt install -y tmux-plugin-manager
sudo apt install -y tmuxp # uses python rather than ruby used by tmuxinator. sudo apt install -y python3-tmuxp # uses python rather than ruby used by tmuxinator.
DEST=${1:-/etc/skel} DEST=${1:-/etc/skel}
# http://github.com/Netherdrake/Dotfiles/tree/master/config/tmux # http://github.com/Netherdrake/Dotfiles/tree/master/config/tmux
@ -48,7 +48,8 @@ cat <<-EOF | sudo tee -a "${DEST}"/.profile
fi fi
EOF EOF
cat <<-EOF | tee "${TMUX_CONF_DIR}"/default.sh conf_print_tmux_default() {
cat <<-'EOF' | tee "${TMUX_CONF_DIR}"/default.sh
# Default Theme # Default Theme
TMUX_POWERLINE_SEPARATOR_LEFT_BOLD="" TMUX_POWERLINE_SEPARATOR_LEFT_BOLD=""
TMUX_POWERLINE_SEPARATOR_LEFT_THIN="" TMUX_POWERLINE_SEPARATOR_LEFT_THIN=""
@ -114,15 +115,18 @@ cat <<-EOF | tee "${TMUX_CONF_DIR}"/default.sh
"time 24 255 ${TMUX_POWERLINE_SEPARATOR_LEFT_THIN}" \ "time 24 255 ${TMUX_POWERLINE_SEPARATOR_LEFT_THIN}" \
) )
fi fi
EOF EOF
}
# conf_print_tmux_default | tee "${TMUX_CONF_DIR}"/default.sh
# wget -c --directory-prefix "${DEST}"/.config/tmux/ https://raw.githubusercontent.com/Netherdrake/Dotfiles/master/config/tmux/tmux.conf # wget -c --directory-prefix "${DEST}"/.config/tmux/ https://raw.githubusercontent.com/Netherdrake/Dotfiles/master/config/tmux/tmux.conf
cat <<-EOF | tee "${TMUX_CONF_DIR}"/tmux.conf conf_print_tmux_conf-1() {
cat <<-EOF
# set-environment -g TMUX_PLUGIN_MANAGER_PATH '${TMUX_CONF_DIR}/plugins/tpm' # set-environment -g TMUX_PLUGIN_MANAGER_PATH '${TMUX_CONF_DIR}/plugins/tpm'
# from apt-get install powerline # from apt-get install powerline
source /usr/share/powerline/bindings/tmux/powerline_tmux_1.9_plus.conf source /usr/share/powerline/bindings/tmux/powerline_tmux_2.1_plus.conf
# set-option -g default-shell /bin/fish # set-option -g default-shell /bin/fish
set-option -g default-shell "/usr/bin/zsh" set-option -g default-shell "/usr/bin/zsh"
@ -133,7 +137,9 @@ cat <<-EOF | tee "${TMUX_CONF_DIR}"/tmux.conf
# set-option -g status-utf8 on # set-option -g status-utf8 on
set-option -g status-left-length 60 set-option -g status-left-length 60
set-option -g status-right-length 60 set-option -g status-right-length 60
set-option -g default-terminal xterm-256color
set-option -g default-terminal "tmux-256color"
set -as terminal-overrides ",xterm*:Tc"
setw -g mode-keys vi setw -g mode-keys vi
bind h select-pane -L bind h select-pane -L
@ -189,12 +195,6 @@ cat <<-EOF | tee "${TMUX_CONF_DIR}"/tmux.conf
unbind r unbind r
bind r source-file ~/.tmux.conf \; display "Reloaded!" bind r source-file ~/.tmux.conf \; display "Reloaded!"
# I dont know what I'm doing
#unbind {
#unbind }
#bind H swap-pane -U
#bind L swap-pane -D
# highlight navbar indication of current window # highlight navbar indication of current window
set-window-option -g window-status-current-style fg=colour235 set-window-option -g window-status-current-style fg=colour235
set-window-option -g window-status-current-style bg=colour148 #064 blendin set-window-option -g window-status-current-style bg=colour148 #064 blendin
@ -216,10 +216,12 @@ cat <<-EOF | tee "${TMUX_CONF_DIR}"/tmux.conf
set -g pane-active-border-style fg=colour069 # 24 blue set -g pane-active-border-style fg=colour069 # 24 blue
# set -g pane-border-style bg=black # set -g pane-border-style bg=black
# set -g pane-active-border-style bg=black # set -g pane-active-border-style bg=black
EOF EOF
}
conf_print_tmux_conf-1 | tee "${TMUX_CONF_DIR}"/tmux.conf
## A Tmux theme made to work together with bullet-train.zsh ## A Tmux theme made to work together with bullet-train.zsh
#http://github.com/caiogondim/maglev # http://github.com/caiogondim/maglev
# Depends: Tmux Pain Control Optional: # Depends: Tmux Pain Control Optional:
# Tmux copycat Tmux prefix highlight # Tmux copycat Tmux prefix highlight
@ -228,16 +230,15 @@ EOF
# Overwrites the heredoc above. # Overwrites the heredoc above.
#cat <<-EOF | tee "${DEST}"/.tmux.conf conf_print_tmux_conf-2() {
cat <<-EOF | tee "${TMUX_CONF_DIR}"/tmux.conf cat <<-EOF
# Start windows and panes at 1, not 0 # Start windows and panes at 1, not 0
set -g base-index 1 set -g base-index 1
set -g pane-base-index 1 set -g pane-base-index 1
set-option -g status-position top set-option -g status-position top
set-option -g default-terminal "tmux-256color"
set-option -g repeat-time 0 set-option -g repeat-time 0
# vim-tmux-focus-events requires this or tmux-plugins/tmux-sensible enabled below. # vim-tmux-focus-events requires this or tmux-plugins/tmux-sensible enabled below.
@ -274,18 +275,28 @@ cat <<-EOF | tee "${TMUX_CONF_DIR}"/tmux.conf
set -g @plugin 'whame/tmux-modal' set -g @plugin 'whame/tmux-modal'
set -g @plugin 'MunifTanjim/tmux-mode-indicator' set -g @plugin 'MunifTanjim/tmux-mode-indicator'
set -g @plugin 'arcticicestudio/nord-tmux' set -g @plugin 'arcticicestudio/nord-tmux'
# set -g @plugin 'erikw/tmux-powerline'
set -g @plugin 'catppuccin/tmux'
set -g @catppuccin_flavour 'mocha' # or latte, frappe, macchiato
# extrakto for tmux - quickly select, copy/insert/complete text without a mouse # extrakto for tmux - quickly select, copy/insert/complete text without a mouse
set -g @plugin 'laktak/extrakto' set -g @plugin 'laktak/extrakto'
set -g @extrakto_fzf_tool "~/.local/share/fzf/bin/fzf" set -g @extrakto_fzf_tool "~/.local/share/fzf/bin/fzf"
set -g @extrakto_split_direction "v" set -g @extrakto_split_direction "v"
# tmux-fzf - Use fzf to manage your tmux work environment
# prefix + F (Shift+F)
# uses environment variable because tmux options are slow.
set -g @plugin 'sainnhe/tmux-fzf'
# TMUX_FZF_LAUNCH_KEY="C-f" # change the default to (Ctrl+F)
# tmux-resurrect: restores n/vim sessions if Session.vim exists. # tmux-resurrect: restores n/vim sessions if Session.vim exists.
set -g @plugin 'tmux-plugins/tmux-resurrect' set -g @plugin 'tmux-plugins/tmux-resurrect'
set -g @resurrect-capture-pane-contents 'on' set -g @resurrect-capture-pane-contents 'on'
set -g @resurrect-save-shell-history 'on' set -g @resurrect-save-shell-history 'on'
set -g @resurrect-strategy-nvim 'session' set -g @resurrect-strategy-nvim 'session'
set -g @rsurrect-strategy-vim 'session' set -g @resurrect-strategy-vim 'session'
# tmux-continuum # tmux-continuum
set -g @plugin 'tmux-plugins/tmux-continuum' set -g @plugin 'tmux-plugins/tmux-continuum'
@ -295,32 +306,35 @@ cat <<-EOF | tee "${TMUX_CONF_DIR}"/tmux.conf
#set -g @tmp_plugins ' \ #set -g @tmp_plugins ' \
# tmux-plugins/tmux-sensible \ # tmux-plugins/tmux-sensible \
#' #'
EOF
# tmux-resurrect will now restore vim and neovim sessions if Session.vim file is present. }
# for vim resurrect conf_print_tmux_conf-2 | tee -a "${TMUX_CONF_DIR}"/tmux.conf
set -g @rsurrect-strategy-vim 'session'
EOF
# Last entry to the tmux.conf # Last entry to the tmux.conf
cat <<-EOF | tee "${TMUX_CONF_DIR}"/tmux.conf conf_print_tmux_conf-3() {
cat <<-EOF
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf) # Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run '/usr/share/tmux-plugin-manager/tpm' run '/usr/share/tmux-plugin-manager/tpm'
EOF EOF
}
conf_print_tmux_conf-3 | tee -a "${TMUX_CONF_DIR}"/tmux.conf
# Prefetch the plugins. # Prefetch the plugins.
#/usr/share/tmux-plugin-manager/bin/install_plugins #/usr/share/tmux-plugin-manager/bin/install_plugins
mkdir -p "${DEST}"/.zshrc.d/ # tmuxp completions
cat <<-EOF | tee "${DEST}"/.zshrc.d/001_tmuxp-complete.zsh sudo apt-get install -y python3-shtab
#!/usr/bin/env zsh
eval " $(_TMUXP_COMPLETE=source_zsh tmuxp) "
EOF
mkdir -p "${DEST}"/.bashrc.d # ZSH_COMPLETION_DIR="${DEST}"/.zshrc.d
cat <<-EOF | tee "${DEST}"/.bashrc.d/001_tmuxp-complete.sh ZSH_COMPLETION_DIR="/usr/share/zsh/vendor-completions/"
#!/usr/bin/env bash shtab --shell=zsh -u tmuxp.cli.create_parser |
eval " $(_TMUXP_COMPLETE=source tmuxp) " sudo tee "${ZSH_COMPLETION_DIR}"/_tmuxp
EOF
# BASH_COMPLETION_DIR="${DEST}"/.bashrc.d
BASH_COMPLETION_DIR="/usr/share/bash-completions"
shtab --shell=bash -u tmuxp.cli.create_parser |
sudo tee "${BASH_COMPLETION_DIR}"/tmuxp
# HOME="${DEST}" TMUX_PLUGIN_MANAGER_PATH=""${DEST}"/.tmux/plugins" bash /usr/share/tmux-plugin-manager/bin/install_plugins # HOME="${DEST}" TMUX_PLUGIN_MANAGER_PATH=""${DEST}"/.tmux/plugins" bash /usr/share/tmux-plugin-manager/bin/install_plugins
@ -328,7 +342,8 @@ EOF
# tmux session manager examples. include in your project directory as .tmuxp.{yaml,json} # tmux session manager examples. include in your project directory as .tmuxp.{yaml,json}
# and load with 'tmuxp load .' or 'tmuxp.load {name}' # and load with 'tmuxp load .' or 'tmuxp.load {name}'
# see http://github.com/tony/tmuxp-config # see http://github.com/tony/tmuxp-config
cat <<-EOF | tee "${DEST}"/.config/tmuxp/docker.yaml conf_print_tmuxp_docker() {
cat <<-EOF
session_name: docker session_name: docker
start_directory: ./ start_directory: ./
windows: windows:
@ -374,9 +389,12 @@ cat <<-EOF | tee "${DEST}"/.config/tmuxp/docker.yaml
- :e Dockerfile - :e Dockerfile
- pane - pane
- pane - pane
EOF EOF
}
conf_print_tmuxp_docker | tee "${DEST}"/.config/tmuxp/docker.yaml
cat <<-EOF | tee "${DEST}"/.config/tmuxp/top.yaml conf_print_tmuxp_top() {
cat <<-EOF
session_name: top session_name: top
windows: windows:
- window_name: dev window - window_name: dev window
@ -391,9 +409,12 @@ cat <<-EOF | tee "${DEST}"/.config/tmuxp/top.yaml
- shell_command: - shell_command:
- cd /var/log # run multiple commands in this pane - cd /var/log # run multiple commands in this pane
- sudo tail -f /var/log/messages - sudo tail -f /var/log/messages
EOF EOF
}
conf_print_tmuxp_top | tee "${DEST}"/.config/tmuxp/top.yaml
cat <<-EOF | tee "${DEST}"/.config/tmuxp/tmuxp.yaml conf_print_tmuxp_tmuxp() {
cat <<-EOF
session_name: tmuxp session_name: tmuxp
start_directory: ./ # load session relative to config location (project root). start_directory: ./ # load session relative to config location (project root).
before_script: ./.tmuxp-before-script.sh before_script: ./.tmuxp-before-script.sh
@ -419,9 +440,12 @@ cat <<-EOF | tee "${DEST}"/.config/tmuxp/tmuxp.yaml
- pane - pane
- make serve - make serve
- make SPHINXBUILD='poetry run sphinx-build' watch - make SPHINXBUILD='poetry run sphinx-build' watch
EOF EOF
}
conf_print_tmuxp_tmuxp | tee "${DEST}"/.config/tmuxp/tmuxp.yaml
cat <<-EOF | tee "${DEST}"/.config/tmuxp/tmuxp_testing.yaml conf_print_tmuxp_tmuxp_testing() {
cat <<-EOF | tee "${DEST}"/.config/tmuxp/tmuxp_testing.yaml
language: python language: python
sudo: false sudo: false
dist: bionic # 18.04 dist: bionic # 18.04
@ -487,4 +511,6 @@ cat <<-EOF | tee "${DEST}"/.config/tmuxp/tmuxp_testing.yaml
- libncurses-dev - libncurses-dev
after_success: after_success:
- codecov - codecov
EOF EOF
}
conf_print_tmuxp_tmuxp_testing | tee "${DEST}"/.config/tmuxp/tmuxp_testing.yaml