Last active
March 14, 2018 07:13
-
-
Save chemzqm/3d2927b3a05bb4b3556a91a12bf3c0b9 to your computer and use it in GitHub Desktop.
Quickly find a directory and file in terminal with fzy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# brew install ag | |
# brew install fzy | |
# Usage: e [part of filename] | |
function e | |
set -l file (ag . --silent -l -g '' | fzy -q $argv) | |
if test -z $file | |
return | |
else | |
nvim $file | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# brew install fzy | |
# Usage: fcd [part of foldname] | |
function fcd | |
set -l dir (find . -type d | fzy -q $argv) | |
if test -z $dir | |
return | |
else | |
cd $dir | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment