feat: add detach provider field and vim.g.preview config support (#42)
Problem: viewer processes launched via a string[] `open` command were always killed on buffer deletion with no way to opt out. Configuring the plugin also required an explicit `setup()` call in a `config` hook, preventing config from being declared before the plugin loads. Solution: add a `detach` boolean to `ProviderConfig` that skips SIGTERM on buffer unload. Auto-call `setup()` from `vim.g.preview` at module load time, enabling config via lazy.nvim's `init` hook. Update vimdoc and README accordingly.
This commit is contained in:
parent
bb9ca987e1
commit
f1aed82f42
4 changed files with 40 additions and 7 deletions
14
README.md
14
README.md
|
|
@ -21,8 +21,18 @@ Typst, Markdown, etc.)—diagnostics included.
|
|||
|
||||
## Installation
|
||||
|
||||
Install with your package manager of choice or via
|
||||
[luarocks](https://luarocks.org/modules/barrettruth/preview.nvim):
|
||||
With lazy.nvim:
|
||||
|
||||
```lua
|
||||
{
|
||||
'barrettruth/preview.nvim',
|
||||
init = function()
|
||||
vim.g.preview = { typst = true, latex = true }
|
||||
end,
|
||||
}
|
||||
```
|
||||
|
||||
Or via [luarocks](https://luarocks.org/modules/barrettruth/preview.nvim):
|
||||
|
||||
```
|
||||
luarocks install preview.nvim
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue