• Astaroth ( Astaroth@lemm.ee ) 
      link
      fedilink
      arrow-up
      2
      ·
      3 years ago

      I use Fish and have keybinds for previous and next directory, 99% of the time when going up in a directory it’s to (one of) the previous directory/ies I was in

        • beeng ( beeng@discuss.tchncs.de ) 
          link
          fedilink
          arrow-up
          1
          ·
          3 years ago

          The dir’s are the same names or similar? A few extra key strokes to get the fullname should be easier than cd’ing back and forth.

          There’s also z foo “space” “tab” as per docs to get interactive list for matches.

          But, just a suggestion!

    • PlexSheep ( PlexSheep@feddit.de ) 
      link
      fedilink
      arrow-up
      1
      ·
      3 years ago

      What I use to automatically extend stuff like ls .... to ls ../../../..

      function expand-dots() {
          local MATCH
          if [[ $LBUFFER =~ '(^| )\.\.\.+' ]]; then
              LBUFFER=$LBUFFER:fs%\.\.\.%../..%
          fi
      }
      
      function expand-dots-then-expand-or-complete() {
          zle expand-dots
          zle expand-or-complete
      }
      
      function expand-dots-then-accept-line() {
          zle expand-dots
          zle accept-line
      }
      
      zle -N expand-dots
      zle -N expand-dots-then-expand-or-complete
      zle -N expand-dots-then-accept-line
      bindkey '^I' expand-dots-then-expand-or-complete
      bindkey '^M' expand-dots-then-accept-line
      

      (for zsh)