Skip to content

voronkovich/gitignore.plugin.zsh

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

521 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gitignore.plugin.zsh

Tests Update Templates

ZSH plugin for creating .gitignore files.

Demo

gif

Usage

# Write templates to the standard output
gi TEMPLATE

# Append templates to the local .gitignore file
gii TEMPLATE

# Open .gitignore file in editor ($EDITOR)
gie

Example:

gi vim eclipse symfony

Installation

antigen bundle voronkovich/gitignore.plugin.zsh
zplug "voronkovich/gitignore.plugin.zsh"
git clone --recurse-submodules https://github.com/voronkovich/gitignore.plugin.zsh ~/.oh-my-zsh/custom/plugins/gitignore

Edit .zshrc to enable the plugin:

plugins=(... gitignore)

Manual

Clone this repo:

git clone --recurse-submodules https://github.com/voronkovich/gitignore.plugin.zsh path/to/repo

And add this into your .zshrc:

source path/to/repo/gitignore.plugin.zsh

Advanced Usage

Global gitignore

The 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
gi -g

# Append templates to the global gitignore file
gii -g TEMPLATE

# Open global gitignore file in editor ($EDITOR)
gie -g

Custom templates

If 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"

Updating templates

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 antigen update.

License

Copyright (c) Voronkovich Oleg. Distributed under the MIT.

About

ZSH plugin for creating .gitignore files.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages