Created
April 1, 2025 14:49
-
-
Save markgarrigan/2bde9a7943355aa73c369f97fbbddcac to your computer and use it in GitHub Desktop.
This file contains hidden or 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
function dev() { | |
local home="$HOME" | |
local dir | |
dir=$(find "$home" -type d \( \ | |
-path "$home/Music" -o \ | |
-path "$home/Library" -o \ | |
-path "$home/Downloads" -o \ | |
-path "$home/Desktop" -o \ | |
-path "$home/Documents" -o \ | |
-path "$home/Photos" -o \ | |
-path "$home/Pictures" -o \ | |
-path "$home/.Trash" -o \ | |
-path "*/pack*" -o \ | |
-path "*/node_modules*" -o \ | |
-path "*/.git*" -o \ | |
-path "*/.npm*" -o \ | |
-path "*/.yarn*" -o \ | |
-path "*/.cargo*" -o \ | |
-path "*/.pnpm-store*" -o \ | |
-path "*/.venv*" -o \ | |
-path "*/.mypy_cache*" -o \ | |
-path "*/.pytest_cache*" -o \ | |
-path "*/.gradle*" -o \ | |
-path "*/.m2*" -o \ | |
-path "*/.terraform*" -o \ | |
-path "*/.dart_tool*" -o \ | |
-path "*/target*" -o \ | |
-path "*/__pycache__*" -o \ | |
-exec test -f "{}/package.json" \; \ | |
\) -prune -false -o -type d -print | head -n 200 | \ | |
fzf --height=40% --reverse --prompt="Choose directory: " \ | |
--preview 'ls -la {}' --preview-window=right:50%) | |
if [[ -n "$dir" ]]; then | |
cd "$dir" || return | |
echo -ne "\033]0;nvim: ${dir##*/}\007" | |
nvim "$dir" | |
fi | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment