This PR uses Neovim's built-in ftplugin feature (see :h runtimepath) to make sure this plugin initialises itself lazily, when opening a oil filetype.
As a nice side-effect, this also means that users (or plugin managers) don't have to worry about the order in which oil.nvim and this plugin are configured (oil.nvim must be loaded in order for Neovim to know about the oil filetype).
The setup function only sets the config, but doesn't load anything.
I've also added a small health check.
And, since setup now only overrides the default configuration, I have added support for configuring this plugin with a vim.g.oil_git_status table.
This has two benefits over a setup function:
If the plugin is not installed or loaded, Neovim won't error on a require call (allowing users to disable the plugin without deleting the config).
It allows configuration from vimscript: g:oil_git_status = { "show_ignored": 1 }
Hey :wave:
Nice plugin!
I would love to use it, but the need to call a
setup
function to enable this plugin's functionality has some caveats:setup
function, even without using oil.nvim.This PR uses Neovim's built-in
ftplugin
feature (see:h runtimepath
) to make sure this plugin initialises itself lazily, when opening aoil
filetype. As a nice side-effect, this also means that users (or plugin managers) don't have to worry about the order in which oil.nvim and this plugin are configured (oil.nvim must be loaded in order for Neovim to know about theoil
filetype). Thesetup
function only sets the config, but doesn't load anything.I've also added a small health check.
And, since
setup
now only overrides the default configuration, I have added support for configuring this plugin with avim.g.oil_git_status
table. This has two benefits over asetup
function:require
call (allowing users to disable the plugin without deleting the config).g:oil_git_status = { "show_ignored": 1 }