Update readme

This commit is contained in:
hedy
2023-11-01 14:39:49 +08:00
parent 2258c6bbd0
commit d2f0a4af6a

View File

@@ -172,7 +172,24 @@ Lazy:
{ desc = "SymbolsOutline" }) { desc = "SymbolsOutline" })
require("symbols-outline").setup { require("symbols-outline").setup {
-- Your setup opts here (optional) -- Your setup opts here (leave empty to use defaults)
}
end,
},
```
Lazy with lazy-loading:
```lua
{
"simrat39/symbols-outline.nvim",
cmd = { "SymbolsOutline", "SymbolsOutlineOpen", "SymbolsOutlineClose" },
keys = { "<leader>tt" },
config = function()
-- Example mapping to toggle symbols-outline
vim.keymap.set("n", "<leader>tt", "<cmd>SymbolsOutline<CR>",
{ desc = "SymbolsOutline" })
require("symbols-outline").setup {
-- Your setup opts here (leave empty to use defaults)
} }
end, end,
}, },
@@ -180,13 +197,13 @@ Lazy:
## Setup ## Setup
Put the setup call in your init.lua or any lua file that is sourced. Call the setup function with your configuration options.
**NOTE**: A call to `.setup()` is *required* for this plugin to work! Note that a call to `.setup()` is *required* for this plugin to work
(simrat39/symbols-outline.nvim#213) (simrat39/symbols-outline.nvim#213).
```lua ```lua
require("symbols-outline").setup() require("symbols-outline").setup({})
``` ```
## Configuration ## Configuration
@@ -303,7 +320,7 @@ local opts = {
### Lua ### Lua
``` ```lua
require'symbols-outline'.toggle_outline() require'symbols-outline'.toggle_outline()
require'symbols-outline'.open_outline() require'symbols-outline'.open_outline()
require'symbols-outline'.close_outline() require'symbols-outline'.close_outline()