-
I kind of know what these are but i am not sure how i would use them?
like separators in a list? shouldn't comma be a more appropriate separator? and how would i use them? It would be nice if it support count as well , like |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
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 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 configured by default, they ask for user input for what should be put on the left or right of your selection. As for the term "separators", I just wanted to make a distinction between delimiters that were different for left and right (pairs), and those that were the same for left and right (separators). Again, this is explained more in For the final question, the format for surrounding depends heavily on (Neo)vim's built-in text-object system, so the appropriate command would be Hopefully this answers a few of your questions, and feel free to drop by and ask more later! Edit: Checking your post's edit history, it might be worth it for you to check out Edit 2: The basic idea behind this plugin (and other similar surround plugins) follows Vim's grammar, e.g.
This methodology extends to other, more complex mappings (at least for inserting), e.g. |
Beta Was this translation helpful? Give feedback.
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
orvim-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 yourpairs
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…