ZSH plugin for creating .gitignore files.
# Write templates to the standard output
gitignore TEMPLATE
# Append templates to the local .gitignore file
gitignore-append TEMPLATE
# Open .gitignore file in editor ($EDITOR)
gitignore-editExample:
gitignore vim eclipse symfonyFor convenience, the following aliases are provided:
gi: Alias forgitignoregia: Alias forgitignore-appendgie: Alias forgitignore-edit
zinit light voronkovich/gitignore.plugin.zshzplug "voronkovich/gitignore.plugin.zsh"git clone --recurse-submodules https://github.com/voronkovich/gitignore.plugin.zsh ~/.oh-my-zsh/custom/plugins/gitignoreEdit .zshrc to enable the plugin:
plugins=(... gitignore)Clone this repo:
git clone --recurse-submodules https://github.com/voronkovich/gitignore.plugin.zsh path/to/repoAnd add this into your .zshrc:
source path/to/repo/gitignore.plugin.zshThe plugin also supports global gitignore files. To use the global gitignore file instead of the local one, add the --global flag to any command:
# Show current global gitignore file's content
gitignore -g
# Append templates to the global gitignore file
gitignore-append -g TEMPLATE
# Open global gitignore file in editor ($EDITOR)
gitignore-edit -gIf you want to override an existing template or add your own custom one, you can use an environment variable ZSH_PLUGIN_GITIGNORE_TEMPLATE_PATHS (it behaves like the $PATH variable):
export ZSH_PLUGIN_GITIGNORE_TEMPLATE_PATHS="${HOME}/.gitignore_templates:${ZSH_PLUGIN_GITIGNORE_TEMPLATE_PATHS}:/etc/global_gitignore"Every day a GitHub Actions scheduled workflow runs a job that updates a submodule with templates and commits the changes. So, templates are always up to date. You should just use zinit update.
Copyright (c) Voronkovich Oleg. Distributed under the MIT.
