Skip to content

Commit

Permalink
rm misleading docs for function* used in opts spec
Browse files Browse the repository at this point in the history
  • Loading branch information
siduck committed Oct 1, 2023
1 parent f9c1cbb commit 91be187
Showing 1 changed file with 21 additions and 20 deletions.
41 changes: 21 additions & 20 deletions src/routes/(index)/docs/config/plugins.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ M.plugins = "custom.plugins"

<br/>
- **custom/plugins.lua**

```lua
local plugins = {

Expand All @@ -47,28 +48,28 @@ local plugins = {
ensure_installed = {"html", "css", "bash"},
},
},

-- if you load some function or module within your opt, wrap it with a function

{
"nvim-telescope/telescope.nvim",
opts = {
defaults = {
mappings = {
i = {
["<esc>"] = function(...)
require("telescope.actions").close(...)
end,
},
},
},
},
},

{
"folke/which-key.nvim",
enabled = false,
}
"folke/which-key.nvim",
enabled = false,
},

-- If your opts uses a function call, then make opts spec a function*
-- should return the modified default config as well
-- here we just call the default telescope config
-- and then assign a function to some of its options
{
"nvim-telescope/telescope.nvim",
opts = function()
local conf = require "plugins.configs.telescope"
conf.defaults.mappings.i = {
["<C-j>"] = require("telescope.actions").move_selection_next,
["<Esc>"] = require("telescope.actions").close,
}

return conf
end,
}
}

return plugins
Expand Down

0 comments on commit 91be187

Please sign in to comment.