zsh: adds fd
powers to chx()
I was thinking of doing this in the first place, but decided I'd keep it simple. Look where I am now.
This commit is contained in:
parent
fb5cef7aef
commit
f611781a8b
1 changed files with 2 additions and 1 deletions
3
.zshrc
3
.zshrc
|
@ -164,9 +164,10 @@
|
||||||
[ -f "${XDG_CONFIG_HOME:-$HOME/.config}/shell/fnrc" ] && source "${XDG_CONFIG_HOME:-$HOME/.config}/shell/fnrc"
|
[ -f "${XDG_CONFIG_HOME:-$HOME/.config}/shell/fnrc" ] && source "${XDG_CONFIG_HOME:-$HOME/.config}/shell/fnrc"
|
||||||
|
|
||||||
# cd search: cd to a directory, given part of its name
|
# cd search: cd to a directory, given part of its name
|
||||||
|
# (also can take arguments for an `fd` commnd)
|
||||||
cds() {
|
cds() {
|
||||||
if ! [ -z "$1" ];then
|
if ! [ -z "$1" ];then
|
||||||
cd "$(fd --max-results=1 -t d "$1")" && pwd
|
cd "$(fd --max-results=1 -t d $@)" && pwd
|
||||||
else
|
else
|
||||||
echo "$0: no arguments provided"
|
echo "$0: no arguments provided"
|
||||||
return 1
|
return 1
|
||||||
|
|
Loading…
Add table
Reference in a new issue