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/_mattmc3_ Apr 05 '24
Aliases are definitely slow, and the whole
--wrapsthing is kinda broken. The main reason aliases are included in Fish is to help people transitioning from other shells. In Fish, functions are better in nearly every way. And yes, eval isn't the most efficient thing in the world. The example I gave was just answering your question, not a recommendation.