Docs/centralize helpdoc (#18)
* feat: support vim.g.oil declarative configuration
Problem: oil.nvim requires an imperative require("oil").setup(opts)
call to initialize. The Neovim ecosystem is moving toward vim.g.plugin
as a declarative config source that works without explicit setup calls.
Solution: fall back to vim.g.oil in config.setup() when no opts are
passed, and add plugin/oil.lua to auto-initialize when vim.g.oil is
set. Explicit setup(opts) calls still take precedence. Update docs
and add tests for the new resolution order.
Closes: barrettruth/oil.nvim#1
* doc: minor phrasing "improvements"
* fix(doc): restore Q/A format in FAQ and close lua block
This commit is contained in:
parent
856716e6dc
commit
0f8b084e4a
1 changed files with 14 additions and 9 deletions
23
README.md
23
README.md
|
|
@ -80,7 +80,7 @@ luarocks install oil.nvim
|
||||||
|
|
||||||
## FAQ
|
## FAQ
|
||||||
|
|
||||||
**How do I migrate from `stevearc/oil.nvim` to `barrettruth/oil.nvim`?**
|
**Q: How do I migrate from `stevearc/oil.nvim` to `barrettruth/oil.nvim`?**
|
||||||
|
|
||||||
Replace your `setup()` call with a `vim.g.oil` assignment. For example, with
|
Replace your `setup()` call with a `vim.g.oil` assignment. For example, with
|
||||||
[lazy.nvim](https://github.com/folke/lazy.nvim):
|
[lazy.nvim](https://github.com/folke/lazy.nvim):
|
||||||
|
|
@ -99,25 +99,28 @@ Replace your `setup()` call with a `vim.g.oil` assignment. For example, with
|
||||||
|
|
||||||
-- after
|
-- after
|
||||||
{
|
{
|
||||||
'stevearc/oil.nvim',
|
'barrettruth/oil.nvim',
|
||||||
init = function()
|
init = function()
|
||||||
vim.g.oil = {
|
vim.g.oil = {
|
||||||
columns = { "icon", "size" },
|
columns = { "icon", "size" },
|
||||||
delete_to_trash = true,
|
delete_to_trash = true,
|
||||||
}
|
}
|
||||||
end
|
end,
|
||||||
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
**Why "oil"**?
|
**Q: Why "oil"?**
|
||||||
|
|
||||||
From the [vim-vinegar](https://github.com/tpope/vim-vinegar) README, a quote by Drew Neil:
|
**A:** From the [vim-vinegar](https://github.com/tpope/vim-vinegar) README, a quote by Drew Neil:
|
||||||
|
|
||||||
> Split windows and the project drawer go together like oil and vinegar
|
> Split windows and the project drawer go together like oil and vinegar
|
||||||
|
|
||||||
Vinegar was taken. Let's be oil.
|
Vinegar was taken. Let's be oil.
|
||||||
Plus, I think it's pretty slick ;)
|
Plus, I think it's pretty slick ;)
|
||||||
|
|
||||||
**Why would I want to use oil vs any other plugin?**
|
**Q: Why would I want to use oil vs any other plugin?**
|
||||||
|
|
||||||
|
**A:**
|
||||||
|
|
||||||
- You like to use a netrw-like view to browse directories (as opposed to a file tree)
|
- You like to use a netrw-like view to browse directories (as opposed to a file tree)
|
||||||
- AND you want to be able to edit your filesystem like a buffer
|
- AND you want to be able to edit your filesystem like a buffer
|
||||||
|
|
@ -125,11 +128,13 @@ Plus, I think it's pretty slick ;)
|
||||||
|
|
||||||
If you don't need those features specifically, check out the alternatives listed below
|
If you don't need those features specifically, check out the alternatives listed below
|
||||||
|
|
||||||
**Can oil display files as a tree view**?
|
**Q: Can oil display files as a tree view?**
|
||||||
|
|
||||||
No. A tree view would require a completely different methodology, necessitating a complete rewrite.
|
**A:** No. A tree view would require a completely different methodology, necessitating a complete rewrite.
|
||||||
|
|
||||||
**What are some alternatives?**
|
**Q: What are some alternatives?**
|
||||||
|
|
||||||
|
**A:**
|
||||||
|
|
||||||
- [the original](https://github.com/stevearc/oil.nvim): the lesser-maintained but
|
- [the original](https://github.com/stevearc/oil.nvim): the lesser-maintained but
|
||||||
official `oil.nvim`
|
official `oil.nvim`
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue