terminal alternative for "cfg" action

This commit is contained in:
Tony Miller 2025-09-29 11:44:15 +10:00
parent 85a84f0d72
commit 70d51f2c2d
2 changed files with 22 additions and 0 deletions

18
.local/bin/cfg Executable file
View File

@ -0,0 +1,18 @@
#!/bin/sh
pushd ${HOME} 2>&1 > /dev/null && { \
sh -c "find $(git ls-files -- \
':!:.oh-my-zsh' ':!:.config/alfred' \
':!:.config/zsh/custom/plugins' \
':!:.config/zsh/custom/themes' \
| xargs -I{} dirname '{}' \
| grep -v '^.$' \
| sort -u \
| xargs -I{} printf "'%s' " '{}') -type f -maxdepth 1 -mindepth 1 -not -path '*.DS_Store' -not -path '*.png' -not -path '*.keep' -not -path '*.plist' -not -path '*.itermcolors' -not -path '*.terminal'"; \
git ls-files ':(glob)*'; \
} | sort -u | uniq | fzf \
--preview 'bat --color=always --style=numbers --line-range=:500 --theme="GitHub" {}' \
--preview-window=right:60%:wrap \
--bind 'enter:execute(nvim {})+abort'

4
.zshrc
View File

@ -297,3 +297,7 @@ add-zsh-hook chpwd git_branch_cache_clear
# Added by Windsurf
export PATH="/Users/tony_miller/.codeium/windsurf/bin:$PATH"
#THIS MUST BE AT THE END OF THE FILE FOR SDKMAN TO WORK!!!
export SDKMAN_DIR="$HOME/.sdkman"
[[ -s "$HOME/.sdkman/bin/sdkman-init.sh" ]] && source "$HOME/.sdkman/bin/sdkman-init.sh"