docs: add installation instructions for lazy.nvim

This commit is contained in:
Oula Kuuva
2023-03-20 21:27:31 +02:00
committed by okuuva
parent b4772196c1
commit 57cdc6f0d1

View File

@@ -40,6 +40,23 @@
Install the plugin with your favourite package manager:
<details>
<summary><a href="https://github.com/folke/lazy.nvim">Lazy.nvim</a></summary>
```lua
{
"okuuva/auto-save.nvim",
cmd = "ASToggle", -- optional for lazy loading on command
event = { "InsertLeave", "TextChanged" } -- optional for lazy loading on trigger events
opts = {
-- your config goes here
-- or just leave it empty :)
},
},
```
</details>
<details>
<summary><a href="https://github.com/wbthomason/packer.nvim">Packer.nvim</a></summary>
@@ -122,6 +139,19 @@ Additionally you may want to set up a key mapping to toggle auto-save:
vim.api.nvim_set_keymap("n", "<leader>n", ":ASToggle<CR>", {})
```
or as part of the `lazy.nvim` plugin spec:
```lua
{
"okuuva/auto-save.nvim",
keys = {
{ "<leader>n", ":ASToggle<CR>", desc = "Toggle auto-save" },
},
...
},
```
&nbsp;
### 🪴 Usage