Wrap text with tags in Notepad++ A macro can do that and it’s easier than you think. If you need to wrap the text with html tags or WordPress Gutenberg code blocks or paragraph block or a heading block.
Start by selecting the text:
- In Notepad++ menu Click Macro > Start Recording.
- Ctrl+X – Cut the text as the first action.
- Type the text that should go before the original text. for example <p>
- Ctrl+V Paste the original text back at the cursor – goes after the <p> you just typed earlier.
- Type the text that goes after. For example a closing tag </p>
- In Notepad++ menu Click Macro > Stop Recording.
- In the same menu click Save Current Recorded Macro. You can even assign a shortcut key combination to it.
Now whenever you want to wrap text in custom tags you select the text and run the macro.
I recorded macros to build WordPress Gutenberg blocks.
<!-- wp:heading --> <h2>Heading Text</h2> <!-- /wp:heading -->
<!-- wp:paragraph --> <p>Some text</p> <!-- /wp:paragraph -->
<!-- wp:code --> <pre class="wp-block-code"><code>the codes...</code></pre> <!-- /wp:code -->
You can do this trick with any text you might want to wrap around your original text. If can be anything, simple text, tags, brackets, unicorns, anything you want. This post was actually built with these shortcuts. I prefer it like this than the Visual editor Gutenberg for WordPress blocks.