mirror of
https://github.com/zoriya/auto-save.nvim.git
synced 2025-12-06 06:36:11 +00:00
docs: add installation instructions for lazy.nvim
This commit is contained in:
30
README.md
30
README.md
@@ -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" },
|
||||
},
|
||||
...
|
||||
},
|
||||
|
||||
```
|
||||
|
||||
|
||||
|
||||
### 🪴 Usage
|
||||
|
||||
Reference in New Issue
Block a user