diff options
Diffstat (limited to 'docs/configuration/custom_commands/git_ignored')
-rwxr-xr-x | docs/configuration/custom_commands/git_ignored | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/docs/configuration/custom_commands/git_ignored b/docs/configuration/custom_commands/git_ignored new file mode 100755 index 0000000..fa35764 --- /dev/null +++ b/docs/configuration/custom_commands/git_ignored @@ -0,0 +1,21 @@ +#!/bin/bash + +CURRENT_PATH="$PWD" +GIT_PATH="$(git rev-parse --show-toplevel)" + +cd $GIT_PATH +GIT_PATH="$PWD" + +IFS=$'\n' FILES=($(git ls-files . --ignored --exclude-standard --others)) + + +cnt=${#FILES[@]} +for ((i=0;i<cnt;i++)); do + FILES[i]=$(realpath --relative-to "$CURRENT_PATH" "${GIT_PATH}/${FILES[i]}") +done + +cd $CURRENT_PATH + +echo "${FILES[*]}" \ + | fzf --ansi --preview 'bat -n $(echo {})' \ + | cut -d ":" -f1 |