Skip to content

Instantly share code, notes, and snippets.

@chemzqm
Last active March 14, 2018 07:13
Show Gist options
  • Save chemzqm/3d2927b3a05bb4b3556a91a12bf3c0b9 to your computer and use it in GitHub Desktop.
Save chemzqm/3d2927b3a05bb4b3556a91a12bf3c0b9 to your computer and use it in GitHub Desktop.
Quickly find a directory and file in terminal with fzy
# 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
# 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