{"id":13681376,"url":"https://github.com/laggardkernel/git-ignore","last_synced_at":"2026-01-12T02:56:56.175Z","repository":{"id":103434589,"uuid":"166738976","full_name":"laggardkernel/git-ignore","owner":"laggardkernel","description":"Generate .gitignore files with templates from gitignore.io offline","archived":false,"fork":false,"pushed_at":"2019-05-07T08:43:09.000Z","size":196,"stargazers_count":28,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-11-12T00:36:39.334Z","etag":null,"topics":["fuzzy-matching","fzf","fzf-scripts","gitignore","gitignore-generator","gitignore-templates","prezto","zplugin","zsh","zsh-plugin"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/laggardkernel.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2019-01-21T02:56:06.000Z","updated_at":"2024-10-28T15:17:19.000Z","dependencies_parsed_at":"2024-01-03T04:17:11.119Z","dependency_job_id":"6f87a646-38f9-4748-8233-3a826ef9afcd","html_url":"https://github.com/laggardkernel/git-ignore","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/laggardkernel%2Fgit-ignore","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/laggardkernel%2Fgit-ignore/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/laggardkernel%2Fgit-ignore/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/laggardkernel%2Fgit-ignore/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/laggardkernel","download_url":"https://codeload.github.com/laggardkernel/git-ignore/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251635209,"owners_count":21619170,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["fuzzy-matching","fzf","fzf-scripts","gitignore","gitignore-generator","gitignore-templates","prezto","zplugin","zsh","zsh-plugin"],"created_at":"2024-08-02T13:01:30.068Z","updated_at":"2026-01-12T02:56:56.169Z","avatar_url":"https://github.com/laggardkernel.png","language":"Shell","readme":"# git-ignore\n\n[![License: MIT][license icon]][license]\n\nZSH plugin. Generate `.gitignore` with templates from [gitignore.io][gitignore.io]\n**offline**, taking the advantage of [`fzf`][fzf] fuzzy finder,\n[`bat`][bat] syntax highlighting and ZSH completion.\n\n![images/preview-01.jpg](../assets/images/preview-01.jpg?raw=true)\n\n## Feature\n\nBasically, this plugin is an offline variant of [gitignore.io][gitignore.io]\nwith ZSH goodies:\n- imitating template generation behavior of [gitignore.io][gitignore.io] exactly\n- fuzzy finder [`fzf`][fzf] selection with preview\n- ZSH completion\n- pull/update templates from command line (no need to update this plugin)\n\n## Installation\n\n### [Zplugin][zplugin]\n\nThe only ZSH plugin manager solves the time-consuming init for\n`nvm`, `nodenv`, `pyenv`, `rvm`, `rbenv`, `thefuck`, `fasd`, etc,\nwith its amazing async [Turbo Mode][turbo mode].\n\n```zsh\nzplugin ice pick'init.zsh' blockf\nzplugin light laggardkernel/git-ignore\nalias gi=\"git-ignore\"\n```\n\nUpdate the plugin with\n\n```zsh\n$ zplg update laggardkernel/git-ignore\n```\n\n### [Prezto][prezto]\n\nThe only framework does **optimizations** in plugins with sophisticated coding skill:\n- [refreshing `.zcompdump` every 20h][prezto zcompdump 1]\n- [compiling `.zcompdump` as bytecode in the background][prezto zcompdump 2]\n- [caching init script for fasd][prezto fasd]\n- saving `*env` startup time with [`init - --no-rehash` for `rbenv`, `pyenv`, `nodenv`][prezto *env]\n- [removing the horribly time-consuming `brew command` from `command-not-found`][prezto brew command]\n\n```zsh\nmkdir -p ${ZDOTDIR:-$HOME}/.zprezto/contrib 2\u003e/dev/null\ngit clone https://github.com/laggardkernel/git-ignore.git ${ZDOTDIR:-$HOME}/.zprezto/contrib/git-ignore\n```\n\n## Usage\n\n```zsh\n$ alias gi=\"git-ignore\"\n\n# Depends on fzf\n$ gi # then press \u003cEnter\u003e\n\n# Separate params with spaces or commas\n$ gi macos linux windows vim emacs \u003e\u003e ./.gitignore\n\n# Overwrite existing .gitignore\n$ gi macos,linux,windows vim emacs \u003e| ./.gitignore\n```\n\n### New CLI （`v1.1.0+`)\n\n```zsh\n❯ alias gi=\"git-ignore\"\n\n❯ gi -h\ngit-ignore 1.1.0 by laggardkernel \u003claggardkernel@gmail.com\u003e\nhttps://github.com/laggardkernel/git-ignore\n\nGenerates .gitignore files offline using templates from gitignore.io\n\nUsage:\n  git-ignore [options]\n  git-ignore keyword1 keyword2 keyword3\n\nExample:\n  git-ignore macos,linux,windows vim emacs \u003e\u003e ./.gitignore\n\nOptions:\n  -l, --list                List available templates\n  -s, --search keyword      Search template with keyword in filenames\n  -u, --update              Init/Update local templates repo\n  -c, --clean               Clean local gitignore templates repo\n  -h, --help                Display this help screen\n  -v, --version             Display version information and exit\n\n❯ gi -l\n1C,1C-Bitrix,A-Frame,Actionscript,Ada,Adobe,AdvancedInstaller,Agda,AL...\n# omitted because it is too long\nTotal: 479\n\n❯ gi -s py # then press \u003cTab\u003e for completion\npycharm      pycharm+all  pycharm+iml  pydev        python\n\n❯ gi -u\n[Info] Updating gitignore repo...\nAlready up to date.\n\n❯ gi -c\n[Info] No available local gitignore repo\n[Info] Use `gi -u` to init\n```\n\n### Environment Variables\n`GI_TEMPLATE`: location for templates storage. It fallbacks to:\n1. `.git-ignore` directory under plugin's root folder\n2. `${XDG_DATA_HOME}/git-ignore` (in case the script is not used as a ZSH plugin)\n3. `$HOME/.local/share/git-ignore`\n\n## Optional Dependencies\n- [`fzf`][fzf]: Command-line fuzzy finder\n- [`bat`][bat]: Syntax highlighting for `.gitignore` templates.\n\n### Default Keybindings for `fzf`\n\n| Keybind                                       | Action                  |\n| :-------------------------------------------: | ----------------------- |\n| \u003ckbd\u003eEnter\u003c/kbd\u003e                              | Confirm                 |\n| \u003ckbd\u003eTab\u003c/kbd\u003e                                | Toggle mark             |\n| \u003ckbd\u003e?\u003c/kbd\u003e                                  | Toggle preview window   |\n| \u003ckbd\u003eCtrl\u003c/kbd\u003e - \u003ckbd\u003eR\u003c/kbd\u003e                | Toggle selection        |\n| \u003ckbd\u003eAlt\u003c/kbd\u003e - \u003ckbd\u003eW\u003c/kbd\u003e                 | Toggle preview wrap     |\n| \u003ckbd\u003eCtrl\u003c/kbd\u003e - \u003ckbd\u003eK\u003c/kbd\u003e / \u003ckbd\u003eP\u003c/kbd\u003e | Selection up            |\n| \u003ckbd\u003eCtrl\u003c/kbd\u003e - \u003ckbd\u003eJ\u003c/kbd\u003e / \u003ckbd\u003eN\u003c/kbd\u003e | Selection down          |\n| \u003ckbd\u003eAlt\u003c/kbd\u003e - \u003ckbd\u003eK\u003c/kbd\u003e / \u003ckbd\u003eP\u003c/kbd\u003e  | Preview up              |\n| \u003ckbd\u003eAlt\u003c/kbd\u003e - \u003ckbd\u003eJ\u003c/kbd\u003e / \u003ckbd\u003eN\u003c/kbd\u003e  | Preview down            |\n\n## Todo\n\n- [ ] Support all types of templates files from [dvcs/gitignore][dvcs/gitignore]\n  - [x] Templates\n  - [x] Patch\n  - [x] Stack\n  - [ ] Order\n- [x] Remove unnecessary external dependencies: ~~`sed`~~, ~~`awk`~~\n- [x] ZSH completion\n  - [x] Separate `compdef` into file `functions/_git-ignore`\n- [x] `git` sub-command `git ignore`\n- [x] Options like `--list`, `--update`, `--search`, etc\n- ~~[ ] Configure the plugin with `zstyle`~~\n  - [x] custom template storage location with `GI_TEMPLATE`\n- [ ] Script file compatible with BASH\n\n## Related projects\n\n[wfxr/forgit][wfxr/forgit]: [git-ignore][git-ignore] was designed to be a feature of\nit. And generating `.gitignore` files **offline** was first introduced by me into it.\nLater, [git-ignore](https://github.com/laggardkernel) is separated from forgit\nbecause of disagreement on implementation.\n\n[dvcs/gitignore][dvcs/gitignore]: The largest collection of useful `.gitignore`\ntemplates, maintained by [https://www.gitignore.io][gitignore.io].\n\n[simonwhitaker/gibo][simonwhitaker/gibo]: Another `.gitignore` generator using\ntemplates from [github/gitignore][github/gitignore] written in POSIX sh.\n\n## License\n\nThe MIT License (MIT)\n\nCopyright (c) 2019 laggardkernel\n\nCopyright (c) 2019 Wenxuan Zhang\n\n[license icon]: https://img.shields.io/badge/License-MIT-yellow.svg\n[license]: https://opensource.org/licenses/MIT\n[gitignore.io]: https://www.gitignore.io/\n[fzf]: https://github.com/junegunn/fzf\n[bat]: https://github.com/sharkdp/bat\n[dvcs/gitignore]: https://github.com/dvcs/gitignore\n[zplugin]: https://github.com/zdharma/zplugin\n[turbo mode]: https://github.com/zdharma/zplugin#turbo-mode-zsh--53\n[prezto]: https://github.com/sorin-ionescu/prezto\n[prezto zcompdump 1]: https://github.com/sorin-ionescu/prezto/blob/4abbc5572149baa6a5e7e38393a4b2006f01024f/modules/completion/init.zsh#L31-L41\n[prezto zcompdump 2]: https://github.com/sorin-ionescu/prezto/blob/4abbc5572149baa6a5e7e38393a4b2006f01024f/runcoms/zlogin#L9-L15\n[prezto fasd]: https://github.com/sorin-ionescu/prezto/blob/4abbc5572149baa6a5e7e38393a4b2006f01024f/modules/fasd/init.zsh#L22-L36\n[prezto *env]: https://github.com/sorin-ionescu/prezto/blob/4abbc5572149baa6a5e7e38393a4b2006f01024f/modules/python/init.zsh#L22\n[prezto brew command]: https://github.com/sorin-ionescu/prezto/blob/4abbc5572149baa6a5e7e38393a4b2006f01024f/modules/command-not-found/init.zsh\n[wfxr/forgit]: https://github.com/wfxr/forgit\n[git-ignore]: https://github.com/laggardkernel/git-ignore\n[simonwhitaker/gibo]: https://github.com/simonwhitaker/gibo\n[github/gitignore]: https://github.com/github/gitignore\n","funding_links":[],"categories":["Shell","Plugins"],"sub_categories":["Zinit (née zplugin)"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flaggardkernel%2Fgit-ignore","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flaggardkernel%2Fgit-ignore","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flaggardkernel%2Fgit-ignore/lists"}