add(tmux): tmux config

This commit is contained in:
Léana 江 2023-04-01 11:55:56 +02:00
parent 1c7e98e0c2
commit c0bcbda34b
4 changed files with 39 additions and 4 deletions

View file

@ -14,7 +14,6 @@ end
## Git
abbr gaa 'git add (git rev-parse --show-toplevel)'
abbr ga 'git add'
abbr ga. 'git add .'
abbr gc 'git commit'
abbr gca 'git commit -a'
@ -46,6 +45,7 @@ abbr t 'tree'
abbr ta 'tree -a'
abbr v nvim
abbr tv tmux-sessionizer
abbr d 'cd ~/.dotfiles/.config/'
abbr r 'cd ~/repos/'
@ -72,3 +72,4 @@ abbr o. 'open .'
## Preferences
abbr vp 'cd ~/.dotfiles/.config/nvim/lua/ && nvim'
abbr fp 'cd ~/.dotfiles/.config/fish/ && nvim config.fish'
abbr tp 'nvim ~/.dotfiles/.tmux.conf'

View file

@ -0,0 +1,16 @@
# idea stolen from the one and only primeagen
# aiming to create one session per directory
function tmux-sessionizer
set -f session (string escape -- $PWD)
tmux start-server
if not tmux has-session -t $session > /dev/null 2>&1
tmux new-session -d -s $session 'nvim'
tmux new-window -t $session:1 'fish'
end
tmux select-window -t $session:0
tmux attach-session -t $session
end