zsh: add cdf() (cd file)

This commit is contained in:
PowerUser64 2021-10-27 23:34:32 -07:00
parent 1fd0917970
commit fca220a01e

7
.zshrc
View file

@ -171,6 +171,13 @@
fi 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 # toggles whether a file or group of files is executable
chx() { chx() {
for FILE in "$@";do for FILE in "$@";do