Gitignore.plugin.zsh Save

ZSH plugin for creating .gitignore files.

Project README

gitignore.plugin.zsh Build Status

ZSH plugin for creating .gitignore files.

Installation

Antigen

antigen bundle voronkovich/gitignore.plugin.zsh

Zplug

zplug "voronkovich/gitignore.plugin.zsh"

Oh My Zsh

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

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

Usage

# Write templates to the standard output
gi TEMPLATE 

# Write templates to the local .gitignore file
gii TEMPLATE 

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

Example:

gi vim eclipse symfony

Global gitignore

The plugin also supports global gitignore files. To use global gitignore file instead of local one add --global flag to any command:

# Output content of the global gitignore file
gi -g

# Write 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_teplates:${ZSH_PLUGIN_GITIGNORE_TEMPLATE_PATHS}:/etc/global_gitignore"

Updating templates

Every day the Travis CI runs a job (see tools/update-templates) that updates a submodule with templates and commits the changes. So, templates are always up to date. You should just use antigen update.

Demo

gif

License

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

Open Source Agenda is not affiliated with "Gitignore.plugin.zsh" Project. README Source: voronkovich/gitignore.plugin.zsh
Stars
53
Open Issues
0
Last Commit
1 month ago
License
MIT

Open Source Agenda Badge

Open Source Agenda Rating