Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

In fish, I have an abbreviation that automatically expands double dots into ../ so that you can just spam double dots and visually see how far you're going.

  # Modified from
  # https://github.com/fish-shell/fish-shell/issues/1891#issuecomment-451961517
  function append-slash-to-double-dot -d 'expand .. to ../'
   # Get commandline up to cursor
   set -l cmd (commandline --cut-at-cursor)
  
   # Match last line
   switch $cmd[-1]
   case '*.'
    commandline --insert './'
   case '*'
    commandline --insert '.'
   end
  end


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: