Swap out ide alias for a function

This commit is contained in:
Daniel Lynn 2023-03-24 01:39:47 -05:00
parent 77fcf956fe
commit a1dd3a635a
Signed by: daniel
GPG Key ID: 655C07B9B3DDC88B
3 changed files with 10 additions and 21 deletions

View File

@ -11,10 +11,6 @@ if (( $+commands[helix] )); then
alias hx="helix" alias hx="helix"
fi fi
if (( $+commands[zellij] )); then
alias ide="zellij --layout ${HOME}/.config/zellij/layouts/ide.kdl"
fi
if (( $+commands[coreutils] )); then if (( $+commands[coreutils] )); then
alias [ alias [
alias arch="coreutils arch" alias arch="coreutils arch"

View File

@ -63,12 +63,6 @@ keybinds {
bind "8" { GoToTab 8; SwitchToMode "Normal"; } bind "8" { GoToTab 8; SwitchToMode "Normal"; }
bind "9" { GoToTab 9; SwitchToMode "Normal"; } bind "9" { GoToTab 9; SwitchToMode "Normal"; }
bind "Tab" { ToggleTab; } bind "Tab" { ToggleTab; }
bind "i" {
NewTab {
layout "/home/daniel/.config/zellij/layouts/ide.kdl"
}
SwitchToMode "Normal"
}
} }
scroll { scroll {
bind "Ctrl s" { SwitchToMode "Normal"; } bind "Ctrl s" { SwitchToMode "Normal"; }

21
zshrc
View File

@ -106,18 +106,17 @@ if (( $+commands[zellij] )); then
ZELLIJ_AUTO_ATTACH=true ZELLIJ_AUTO_ATTACH=true
eval "$(zellij setup --generate-auto-start zsh)" eval "$(zellij setup --generate-auto-start zsh)"
if (( ${+ZELLIJ} )); then ide() {
zellij_chpwd_hook() { local layout="${HOME}/.config/zellij/layouts/ide.kdl"
local cwd=${PWD##*/} local name=${PWD##*/}
local cwd=${cwd:-/} local name=${name:-/}
zellij action rename-tab $cwd if (( ${+ZELLIJ} )); then
} zellij action new-tab --layout "${layout}" --cwd "${PWD}" --name "${name}"
else
chpwd_functions+=( zellij_chpwd_hook ) zellij --layout "${layout}" $@
fi
zellij_chpwd_hook }
fi
fi fi
# git # git