Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

VS code shortcut to wrap multiple lines of text in same tag?

I have a text file containing 100 lines of words.
Need to wrap them all in li tags to display as bullet points on a website.
How to do so fast in VS code using some shortcut?
If I paste the text in VS code, it takes up 100 lines with one word on each line.

>Solution :

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

  1. Hit Ctrl + H
  2. Enable Regular Expression
  3. Enter ^(.*)$ in Find
  4. Enter <li>$1</li> in Replace
  5. Profit
foo
bar
baz asdad
foo bar baz 123

Becomes

<li>foo</li>
<li>bar</li>
<li>baz asdad</li>
<li>foo bar baz 123</li>
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading