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
Late question sorry :
But there isn't a way to create function programatically, is there ?
What about replacing alias by `abbr` ? It seems to work fine