i have many pieces of code same for example like this
alt="Greece"
alt="Greece"
alt="Greece"
alt="Greece"
Can i somehow modify it to this? Is there any kind of function like in Excel or something like that please? Imagination write it manualy each is horrible
alt="Greece 1"
alt="Greece 2"
alt="Greece 3"
...
alt="Greece 200"
CodePudding user response:
Another option - not quite as easy
Snippets have a variable $CURSOR_NUMBER
which is useful here.
Make this keybinding:
{
"key": "alt n",
"command": "editor.action.insertSnippet",
"args": {
"snippet": "$TM_SELECTED $CURSOR_NUMBER"
},
"when": "editorHasSelection"
},
- Do a find on your desired text match:
alt="Greece"
- Ctrl Shift L to select all occurrences of the find match.
- Trigger the snippet via its keybinding.
Demo of this method:
So this second method is more steps but doesn't require an extension.