@@ -24,18 +24,29 @@ Install with any plugin manager or as a NeoVim package.
2424The plugin supports lazy-loading:
2525
2626``` lua
27- cmd = { ' IndentToggle' , ' IndentEnable' , ' IndentDisable' },
28- config = function ()
29- require (" indentmini" ).setup ({
30- only_current = false ,
31- enabled = false ,
32- char = ' ▏' ,
33- minlevel = 2 ,
34- key = ' <F5>' ,
35- exclude = { ' markdown' , ' help' , ' text' , ' rst' },
36- exclude_nodetype = { ' string' , ' comment' }
37- })
38- end
27+ -- Either declare `vim.g.indentmini_key` before you load the plugin:
28+ vim .g .indentmini_key = ' <F5>'
29+
30+ -- or use your plugin manager, for example Lazy.nvim:
31+ {
32+ url = ' https://github.com/nvimdev/indentmini.nvim' ,
33+ cmd = { ' IndentToggle' , ' IndentEnable' , ' IndentDisable' },
34+ keys = {
35+ {' <F5>' , ' <Cmd>IndentToggle<CR>' , desc = ' Toggle indent guides' },
36+ },
37+ lazy = true ,
38+ config = function ()
39+ require (" indentmini" ).setup ({
40+ only_current = false ,
41+ enabled = false ,
42+ char = ' ▏' ,
43+ key = ' <F5>' , -- optional, can be set here if you don't lazy-load
44+ minlevel = 2 ,
45+ exclude = { ' markdown' , ' help' , ' text' , ' rst' },
46+ exclude_nodetype = { ' string' , ' comment' }
47+ })
48+ end
49+ }
3950```
4051
4152## Toggle functionality
@@ -50,6 +61,12 @@ You can toggle the guides via:
5061
5162#### Hotkey
5263
64+ For lazy-loading setups, set the global variable before the plugin loads:
65+ ``` lua
66+ vim .g .indentmini_key = ' <F5>'
67+ ```
68+
69+ For non-lazy setups, use the ` key ` option in ` setup() ` :
5370``` lua
5471require (" indentmini" ).setup ({
5572 key = ' <F5>' ,
0 commit comments