Skip to content

Latest commit

 

History

History
20 lines (14 loc) · 597 Bytes

README.md

File metadata and controls

20 lines (14 loc) · 597 Bytes

gotodir

add smart searching to cd - osx only

Like the old Norton CD (ncd) utility for OSX or wcd.exe for linux -- used with alias below adds a pseudo-search path to cd:

  • if exact match is found, just cd there
  • otherwise generate a list of possible matches and use fzf (https://github.com/junegunn/fzf) to let user pick one to cd too.

To use, install gotodir.sh somewhere on your search path and add the following to your .bashrc_profile:

function gotodir () { gotodir.sh "$@" 2>/tmp/g.$$ && \
		builtin cd $(</tmp/g.$$) && \
		rm /tmp/g.$$ && pwd ; }
alias cd=gotodir