refactor: move git ignore alias to own script

This commit is contained in:
Moritz Böhme 2023-08-26 11:37:18 +02:00
parent ec1a6acebc
commit 92e2e149bc
No known key found for this signature in database
GPG key ID: 970C6E89EB0547A9
2 changed files with 31 additions and 20 deletions

View file

@ -50,24 +50,6 @@ in
${exportedVariables}
'';
functions = {
gi = ''
set url https://www.gitignore.io/api
if test (count $argv) -eq 0
set choice ( curl -sL $url/list \
| string split "," \
| ${getExe pkgs.fzf} -m \
| string join "," )
else
set choice (string join "," $argv[1..])
end
if ${getExe pkgs.gum} confirm "Overwrite current .gitignore?"
${getExe pkgs.curl} -sL $url/$choice > .gitignore
else
${getExe pkgs.curl} -sL $url/$choice >> .gitignore
end
'';
fish_greeting = "";
cheat = "cht.sh $argv | bat -p";
};