diff --git a/.gitconfig b/.gitconfig index 2308077d..ca0ed678 100644 --- a/.gitconfig +++ b/.gitconfig @@ -233,4 +233,5 @@ ours = "!f() { git checkout --ours $@ && git add $@; }; f" theirs = "!f() { git checkout --theirs $@ && git add $@; }; f" subrepo = !sh -c 'git filter-branch --prune-empty --subdirectory-filter $1 master' - - human = name-rev --name-only --refs=refs/heads/* + human = name-rev --name-only --refs=refs/heads/* + ig = "!f() { gitignore \"$@\"; }; f" diff --git a/.local/bin/gitignore b/.local/bin/gitignore new file mode 100755 index 00000000..6fd361ca --- /dev/null +++ b/.local/bin/gitignore @@ -0,0 +1,13 @@ +#!/bin/bash + +function __gi() { + curl -L -s https://www.gitignore.io/api/"$@" +} + + +IFS="," +selected_profiles=$(for item in $(__gi list); do echo $item; done | fzf --multi --ansi | paste -s -d "," -) +if [ -n "$selected_profiles" ]; then + echo "$selected_profiles" | { read result && __gi "$result" > .gitignore; echo "Created .gitignore"; } +fi +