Swap out ide alias for a function
This commit is contained in:
21
zshrc
21
zshrc
@ -106,18 +106,17 @@ if (( $+commands[zellij] )); then
|
||||
ZELLIJ_AUTO_ATTACH=true
|
||||
eval "$(zellij setup --generate-auto-start zsh)"
|
||||
|
||||
if (( ${+ZELLIJ} )); then
|
||||
zellij_chpwd_hook() {
|
||||
local cwd=${PWD##*/}
|
||||
local cwd=${cwd:-/}
|
||||
ide() {
|
||||
local layout="${HOME}/.config/zellij/layouts/ide.kdl"
|
||||
local name=${PWD##*/}
|
||||
local name=${name:-/}
|
||||
|
||||
zellij action rename-tab $cwd
|
||||
}
|
||||
|
||||
chpwd_functions+=( zellij_chpwd_hook )
|
||||
|
||||
zellij_chpwd_hook
|
||||
fi
|
||||
if (( ${+ZELLIJ} )); then
|
||||
zellij action new-tab --layout "${layout}" --cwd "${PWD}" --name "${name}"
|
||||
else
|
||||
zellij --layout "${layout}" $@
|
||||
fi
|
||||
}
|
||||
fi
|
||||
|
||||
# git
|
||||
|
Reference in New Issue
Block a user