I have a small function that I keep in my profile to give me quick access to some config files:
viconf ()
{
COLUMNS=12;
printf "Edit config file:\n\n";
select x in ~/.bashrc ~/.bash_profile ~/.bash_login ~/.profile ~/.inputrc ~/.vimrc;
do
vim $x;
break;
done
}
It creates output like this:
1) /home/boss/.bashrc
2) /home/boss/.bash_profile
3) /home/boss/.bash_login
4) /home/boss/.profile
5) /home/boss/.inputrc
6) /home/boss/.vimrc
#?
I'm not really happy with this. I want the #?
to have a \n
and then say Select a config file to edit with vi?
. I've tried lots of ways to edit PS3
but everything I try fails to achieve this (specifically, the \n
always fails). How do I make my function have a custom prompt?