3 ms·
I have aliases for zsh to quickly edit all my configs, it's pretty neat : declare -x -A configs configs=( gdb "$XDG_CONFIG_HOME
by cassepipe 3y ago
I have aliases for zsh to quickly edit all my configs, it's pretty neat :
declare -x -A configs
configs=(
gdb "$XDG_CONFIG_HOME/gdb/gdbinit"
git "$XDG_CONFIG_HOME/git/config"
vim "$HOME/.vimrc"
wezterm "$XDG_CONFIG_HOME/wezterm"
zsh "$HOME/.zshrc"
)
for key value in ${(kv)configs}; do
if [[ $key == "zsh" ]]
then
alias ${key}config="$EDITOR $value && source $value && echo
$configs[zsh] has been sourced"
else
alias ${key}config="$EDITOR $value"
fi
done
Just use zshconfig now if you need to add a new config file to the array and get a new alias
- yanzhang0219 3y agofzf is the final solution.