# https://github.com/nickeb96/puffer-fish function expand_dots -d 'Expand ... to ../..' set -l item (string split ' ' (commandline --cut-at-cursor))[-1] switch $item case './*' commandline --insert '.' case '*..' commandline --insert '/..' case '*' commandline --insert '.' end end