Update tmux config

- Add layout managment via tmuxp
- Add function to run z and tmuxp
- move tmux config from home folder to config folder
This commit is contained in:
Alexander Navarro 2023-10-28 19:47:32 -03:00
parent 6fda168c66
commit eebd9d4a78
10 changed files with 45 additions and 17 deletions

3
.gitignore vendored
View file

@ -5,6 +5,9 @@ config/vifm/Trash
config/vifm/vifminfo.json
config/lazygit/state.yml
config/mpv/shaders
config/tmux/plugins/*
!config/tmux/plugins/.gitkeep
config/spicetify/Backup
# nixos/hardware-configuration.nix

View file

@ -67,6 +67,7 @@ return {
disable_insert_on_commit = "auto",
kind = "replace",
disable_line_numbers = false,
console_timeout = 8000,
-- commit_editor = {
-- kind = "tab",
-- },

View file

View file

@ -66,7 +66,13 @@ bind l next-window
# set -g status-right '#(bartib current | sed -n 3p | awk \'{print $NF}\')'
## Plugins
run -b '~/.tmux/plugins/tpm/tpm'
## Auto install plugins
if "test ! -d ~/.config/tmux/plugins/tpm" \
"run 'git clone https://github.com/tmux-plugins/tpm ~/.config/tmux/plugins/tpm && ~/.config/tmux/plugins/tpm/bin/install_plugins'"
set-environment -g TMUX_PLUGIN_MANAGER_PATH '~/.config/tmux/plugins/tpm'
run -b '~/.config/tmux/plugins/tpm/tpm'
set -g @plugin 'catppuccin/tmux'
# set -g @plugin 'rwxd/catppuccin-tmux'

7
config/tmuxp/coding.yml Normal file
View file

@ -0,0 +1,7 @@
session_name: shorthands
windows:
- window_name: main
layout: main-vertical
panes:
- shell_command: vi
- shell_command: pnpm dev

View file

@ -0,0 +1,8 @@
session_name: persona-page
windows:
layout: main-vertical
panes:
- shell_command:
- nvim
focus: true
- pnpm

View file

@ -27,3 +27,15 @@ tm() {
fi
session=$(tmux list-sessions -F "#{session_name}" 2>/dev/null | fzf --exit-0 --select-1) && tmux $change -t "$session" || echo "No sessions found."
}
ta() {
export START_DIRECTORY="$(z -l 2>&1 | fzf --height 40% --nth 2.. --reverse --inline-info +s --tac --query "${*##-* }" | sed 's/^[0-9,.]* *//')"
if [[ -z START_DIRECTORY ]]; then
exit 0
fi
export SESSION_NAME="$(basename $START_DIRECTORY)"
tmuxp load $(fd -e yml . ~/.config/tmuxp | fzf)
}

View file

@ -3,6 +3,7 @@ dnf-plugin-system-upgrade
duf
exa
fd-find
firefox-dev
flatpak
fzf
gcc
@ -13,6 +14,7 @@ lazygit
neovim
nodejs
papirus-icon-theme
python3-tmuxp
remove-retired-packages
ripgrep
sd
@ -21,4 +23,3 @@ tealdeer
tmux
tree-sitter-cli
zsh
firefox-dev

View file

@ -9,7 +9,6 @@ readarray -t configs < <(
fd -d 1 \
--exclude "*.old" \
--exclude "create*" \
--exclude "tmux" \
--exclude "git"
)

View file

@ -1,9 +0,0 @@
#!/usr/bin/env bash
echo -e "\n${BLD}${SUL}${GRN}Setting up tmux...${RST}\n"
setup_zsh() {
symlink "$DOTS/config/tmux/tmux.conf" "$HOME"/.tmux.conf
}
setup_zsh