开发者

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

开发者 https://www.devze.com 2022-12-07 19:50 出处:网络
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

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

精彩评论

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