diff --git a/.zshrc b/.zshrc index caf2e5e..dd272db 100644 --- a/.zshrc +++ b/.zshrc @@ -171,6 +171,13 @@ fi } + # cd file: cd to the containing dir of a file, given part of its name + # can take an `fd` command + # requires that `fzy` is installed + cdf() { + cd "$(dirname "$(fd $@ | fzy)")" && pwd + } + # toggles whether a file or group of files is executable chx() { for FILE in "$@";do