Skip to content

Help me understand how to use this plugin #51

Answered by kylechui
charlie39 asked this question in Q&A
Discussion options

You must be logged in to vote

Hi there @charlie39! I guess I never really gave too much information on how to use my plugin because I assumed my users were primarily converting from vim-surround or vim-sandwich, so I'll explain a bit here (also see :h nvim-surround). The main idea is that for every character that you have in your pairs table, you should have a table of two "delimiters" that will surround your selections, one for the left and one for the right.

The idea behind associating characters with functions instead of a normal table, is that you can call into the Lua API for more complex, dynamic surrounds, as opposed to always surrounding with the exact same thing every single time. In the two examples configur…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@charlie39
Comment options

@kylechui
Comment options

Answer selected by charlie39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants