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"
fi
if (( $+commands[zellij] )); then
alias ide="zellij --layout ${HOME}/.config/zellij/layouts/ide.kdl"
fi
if (( $+commands[coreutils] )); then
alias [
alias arch="coreutils arch"

View File

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

21
zshrc
View File

@ -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