Skip to content
Discussion options

You must be logged in to vote

Short answer: You can't add tabstops directly to surround definitions, but you can build snippets that wrap selected text — effectively achieving "surround with tabstops" — using the $TM_SELECTED_TEXT/$VISUAL variable. This is supported in version 0.100.0 and later.

How it works

The snippet system supports $TM_SELECTED_TEXT (and the vim alias $VISUAL), which resolves to whatever text is selected when the snippet is expanded. Combined with the :snippet ex command (which works in visual mode), this gives you surround-with-tabstops behavior.

Example: JSON snippet file

Create a .json file in your snippet directory (configured in Settings → Vim Motions → Snippets):

{
    "Wrap in link": {
    …

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by LexiAgneboGudmunds
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