diff options
author | Guangxiong Lin <[email protected]> | 2022-09-26 20:29:48 +0800 |
---|---|---|
committer | Guangxiong Lin <[email protected]> | 2022-09-26 20:29:48 +0800 |
commit | 4e34842a89a626c031160381fcd683d06bd53ce3 (patch) | |
tree | d1d1c73e2ce4a2dbf44442a64dd9045dcb3c75a0 | |
parent | 8a8499bcad1a4b820dbfcb08c5bdbb1feea93377 (diff) | |
download | dotfiles-4e34842a89a626c031160381fcd683d06bd53ce3.tar.gz dotfiles-4e34842a89a626c031160381fcd683d06bd53ce3.tar.bz2 dotfiles-4e34842a89a626c031160381fcd683d06bd53ce3.zip |
Add fcd command to help quickly switch directory
-rwxr-xr-x | .fzfrc | 14 |
1 files changed, 14 insertions, 0 deletions
@@ -32,6 +32,20 @@ esac # functions +fcd () { + local dir dirs + if command -v fd &> /dev/null; then + dirs=$( + fd --type directory --hidden \ + --exclude .git --no-ignore + ) + fi + dir=$(echo "$dirs" | fzf) + if [ $? -eq 0 ]; then + cd "$dir" + fi +} + fco () { local tags branches target branches=$( |