A neovim plugin for generating .gitignore files.
A neovim plugin for generating .gitignore files in seconds, by allowing you to select from a huge number of different technologies.
This plugin is functionally identical to the service offered by
gitignore.io, but capable of
generating .gitignore
files offline, and directly from within neovim.
gitignore.nvim
depends on
telescope.nvim,
please install that plugin first!
After installing telescope.nvim
, you can install gitignore.nvim
like this:
Using vim-plug:
Plug 'wintermute-cell/gitignore.nvim'
Using dein:
call dein#add("wintermute-cell/gitignore.nvim")
Using packer.nvim:
use({
"wintermute-cell/gitignore.nvim",
requires = {
"nvim-telescope/telescope.nvim"
}
})
This plugin ships with only one command which when run,
it will create a buffer with the .gitignore
contents:
:Gitignore
The buffer will not save automatically, so there is no risk of overwriting an existing .gitignore
.
Alternatively, you can use the corresponding lua
function directly, for example
to create a keymap:
local gitignore = require("gitignore")
vim.keymap.set("n", "<leader>gi", gitignore.generate)
gitignore.nvim
makes use of telescope.nvim
's multi-selection keybinds.
This means that by default, you can (de-)select multiple keywords with <Tab>
,
and confirm your selection with <CR>
(Enter).
In case of multiple selected keywords,
the keyword highlighted you press <CR>
on will not be added to the selection!
For convenience, when no multi-selection is made before pressing <CR>
,
<CR>
will actually add the highlighted item to the selection, and create
a .gitignore
file for the single keyword.
Thanks to Toptal for providing a huge list of ignore-templates!