开发者

VSCode - Is there a way to apply snippets to each line of a selection?

I have a snippet. I want to select multiple lines - a set of relative paths to images that I have pasted in - and have the snippet be applied to each line separately. The snippet menu doesn't seem to have the same capabilities as Emmet (* treats 开发者_如何学Ceach line separately)


  • add multi cursors at each line: use Ctrl+Alt+Down or Ctrl+Alt+Up
  • or any other method for multi cursor if you have few Alt+Click or a lot Shift+Alt+Click
  • select the text of each line
  • type the snippet prefix and select the snippet

this works if the snippet uses the variable ${TM_SELECTED_TEXT}

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜