AndrewRadev/switch.vim

can you please add a configuration example for lua

Closed this issue · 2 comments

hey,

i used switch.vim for the last years.
i recently switched to configuring nvim with lua.
can you maybe add a lua example to the readme?

thx for the plugins you are writing!

The way to configure switch.vim is to set certain global variables to certain values. There's really nothing special to do -- you could find out how to set Vim global variables using the lua api and do that.

This section of the Neovim lua guide should be enough: https://neovim.io/doc/user/lua-guide.html#lua-guide-variables

So I am trying to set up Lazy.nvim with a fresh clean lua config, and I do have Switch installed with it and I can see that it has created the normal mode map for gs to be <Plug>(Switch), but typing gs doesn't do anything. and... it works!

At first I got confused and it's because my usual Switch config setup involves using it to toggle comment on lines (that may be a bit nutty to begin with -- amazing how well it's worked) and that config isn't set up yet in my fresh lua config.