Depois de fazer um
bind '"\eu":"cd ..\C-m"'
você pode cd ..
pressionando Alt-u
. Eu costumava usar isso em campeonatos chdir ;-)
Se você quiser toda a suíte swift-chdir
ALT+u cd ..
ALT+n enter next dir for selection
ALT+p enter previous dir for selection
ALT+SPC choose selected dir
ALT+l list subdirectories and highlight selection
inclua isso no seu .bashrc
swiftcd-status() {
echo -n -e "\r\0033[1A\0033[J"
}
swiftcd-contents() {
find "$swiftcdpath" -maxdepth 1 -executable -type d
}
swiftcd-setdir ()
{
swiftcdpath=$PWD
swiftcddirnum=1
swiftcddircount=`swiftcd-contents|wc -l`;
swiftcd-status
}
swiftcd-pd ()
{
(( --swiftcddirnum <= 0 )) && swiftcddirnum=$swiftcddircount;
swiftcd-switch $swiftcddirnum
swiftcd-status
}
swiftcd-updir ()
{
cd ..;
swiftcd-setdir
}
swiftcd-list ()
{
local redOn="$(echo -e '\0033[31m\0033[1m')"
local redOff="$(echo -e '\0033[m')"
swiftcd-status
(( swiftcddircount > 1 )) && {
echo
echo $(swiftcd-contents|sed 's!^'"$swiftcdpath"'!!'|sed $swiftcddirnum' s/\(.*\)/'"$redOn"'\1'"$redOff"'/')
}
}
swiftcd-nd ()
{
(( ++swiftcddirnum > swiftcddircount )) && swiftcddirnum=1;
swiftcd-switch $swiftcddirnum
swiftcd-status
}
swiftcd-switch() {
(( $1 <= swiftcddircount && $1 > 0 )) && cd $(swiftcd-contents|sed -n $1' p')
}
bind '"\e ":"swiftcd-setdir\C-m"'
bind '"\ep":"swiftcd-pd\C-m"'
bind '"\eu":"swiftcd-updir\C-m"'
bind '"\en":"swiftcd-nd\C-m"'
bind '"\el":"swiftcd-list\C-m"'
swiftcd-setdir