summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbleacheda <60625523+bleacheda@users.noreply.github.com>2025-02-15 05:32:50 +0200
committerGitHub <noreply@github.com>2025-02-14 22:32:50 -0500
commit96ce7f5d7f07d11734a868a822516448ac97b38a (patch)
treee60e9ac04b2572b601b9a2988a6f0127b1488917
parent7ef0796b94a665c86ca52a6ec42049029d172ac8 (diff)
downloaddots-96ce7f5d7f07d11734a868a822516448ac97b38a.tar.gz
docs: clarify using opts = {} vs config = function() ... require('plu… (#1316)
* docs: clarify using opts = {} vs config = function() ... require('plugin').setup({}) .. end The current documentation mentioning that using "require" is equivalent to using "opts" without detailing the use in the "config = function()" block seems inaccurate. Lower in the configuration the "config = function()" block is used without clarifying why it needed and what it does. This clarification may help new users understand the difference between the two, or how and where to place the "require" statement. * Update init.lua * remove whitespace
-rw-r--r--nvim/init.lua16
1 files changed, 13 insertions, 3 deletions
diff --git a/nvim/init.lua b/nvim/init.lua
index 4eae8e7..99c7c9c 100644
--- a/nvim/init.lua
+++ b/nvim/init.lua
@@ -234,12 +234,22 @@ require('lazy').setup({
-- with the first argument being the link and the following
-- keys can be used to configure plugin behavior/loading/etc.
--
- -- Use `opts = {}` to force a plugin to be loaded.
+ -- Use `opts = {}` to automatically pass options to a plugin's `setup()` function, forcing the plugin to be loaded.
--
+ -- Alternatively, use `config = function() ... end` for full control over the configuration.
+ -- If you prefer to call `setup` explicitly, use:
+ -- {
+ -- 'lewis6991/gitsigns.nvim',
+ -- config = function()
+ -- require('gitsigns').setup({
+ -- -- Your gitsigns configuration here
+ -- })
+ -- end,
+ -- }
+ --
-- Here is a more advanced example where we pass configuration
- -- options to `gitsigns.nvim`. This is equivalent to the following Lua:
- -- require('gitsigns').setup({ ... })
+ -- options to `gitsigns.nvim`.
--
-- See `:help gitsigns` to understand what the configuration keys do
{ -- Adds git related signs to the gutter, as well as utilities for managing changes