Skip to content

Instantly share code, notes, and snippets.

@c02y
Last active August 23, 2018 03:25
Show Gist options
  • Save c02y/97b6e32ecb520093abee810d8cad71c7 to your computer and use it in GitHub Desktop.
Save c02y/97b6e32ecb520093abee810d8cad71c7 to your computer and use it in GitHub Desktop.
tweak config.fish
in `function d`
change(type character/number without pressing Enter)
read -l -p 'echo "Goto: "' choice
to
read -n 1 -l -p 'echo "Goto: "' choice
change(echo path without /home/users)
if string match -q -r '^\d+$' $choice
if test $choice -ge 1 -a $choice -le $dirc
cd $uniq_dirs[$choice]
echo cd $uniq_dirs[$choice]
to
if string match -q -r '^\d+$' $choice
if test $choice -ge 1 -a $choice -le $dirc
cd $uniq_dirs[$choice]
set -l dir_short (string match -r "$HOME(/.*|\$)" "$uniq_dirs[$choice]")
set -l cd_dir "~$dir_short[2]"
echo cd $cd_dir
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment