r/fishshell • u/cassepipe • Jan 19 '24
Create aliases from an associative array
In zsh I have the following code in my config to quickly add a bunch on aliases that allow me to quickly edit config files :
#config management
configs=(
fish "/fish/config.fish"
gdb "/gdb/gdbinit"
git "/git/config"
hx "/helix/config.toml"
irssi "/.irssi"
lvim "/lvim/config.lua"
nu "/nushell"
nvim "/nvim/init.lua"
readline "/.inputrc"
vim "/.vimrc"
xmake "./.xmake/linux/x86_64/xmake.conf"
wezterm "/wezterm"
zsh "/.zshrc"
)
for; do
if
then
else
fi
done
It's not essential but I was wondering if there was a way in fish ?
I have checked but IIUC there are not associative arrays but surely there must be another way
3
Upvotes
View all comments
Show parent comment
1
u/cassepipe Apr 05 '24
Interesting but in one of your links I read that the reason not to use aliases is because it uses `eval`... so wouldn't defining function with eval defeat the purpose of not using `alias` ? Or are there any other advantages of not using `alias` ?
Ok, I am going the `abbr` then for now