12

Is there a way to have this feature in Notepad++:

  1. select some text
  2. insert an html <tag>``</tag> around it (ie. <strong>, <em> etc)
6

4 Answers 4

10

I've found a plugin that does that, Webedit and it's available in Notepad++'s Plugin Manager (Plugins > Plugin Manager > Show Plugin Manager).

1
4

There's three ways to do this


Using the fingertext plugin

  1. install "FingerText" plugin. (tested 0.5.60 version).
  2. download finger text snippet.
  3. select text, press alt+/.
  4. for example type b (you can create your own "snippet tag" later).
    Notes: some version notepad++ must edit:
    $[![]!] to $[![(key)SELECTION]!]
  5. press tab or enter

  1. You can install any of this:

  2. select text, found and click menu "wrap with abbreviation".

  3. type your tag
  4. press Ok

Using multiple edit steps:

  1. Preparation step

    • click "Setting" > "Preferences" menu.
    • click Editing tab.
    • check "Enable (Ctrl+Mouse click/selection)" in "Multi Editing Settings" groupbox
  2. Execute this step

    1. Click before text, Ctrl+Click after text, like this:

      ` click here  `   text    Ctrl+` click here `
      
    2. Typing whatever <tag>, will be around like this:

      <tag>text<tag>

    3. Press Ctrl+ twice, and type /

4
  • You can and should consolidate all 3 posts into one answer, actually
    – Journeyman Geek
    Nov 21, 2012 at 1:50
  • 1
    please explain fingertext again, that's confusing me. Let say a simple text "abc" and i want to enclose it in <b>abc</b> how to add its snippet.
    – Wasim A.
    Jul 19, 2015 at 8:28
  • this should be the accepted answer . +1 Oct 4, 2015 at 15:41
  • How did you know about the SELECTION option? It's nowhere in the docs and this is the only reference I've found online about it. Are there others? Looking through the binary, I see SELECTIONORPASTE also.
    – pbarney
    Mar 15 at 2:55
1

Solution found at https://stackoverflow.com/questions/34724634/notepad-shortcut-to-add-brackets-around-highlighted-text

1) Mark text
2) Goto Macro -> start recording
3) Cut highlighted text (CTRL+C)
4) Type: "{" then do CTRL-V then Type "}"
5) goto Macro -> Stop Macro
6) Save Macro as a shortcut
0
0

From a related question

Try going into TextFX / TextFX Settings and check 'auto close XHTML tags'. This makes it work in plain HTML files too. You may need to install it if using a newer version of Notepad++

Click Plugins > Plugin Manager > Show Plugin Manager On the "available" tab check the box by "TextFX Characters" Click Install Restart Notepad++ Enable the auto-close XHTM features as described above.

Is this what you had in mind?

1
  • Interesting, bit doesn't work for multi-line selection. So doesn't when you want to insert multiple <li> tags. Only the last <li> is closed with </li>.
    – Nux
    Jul 22, 2020 at 13:04

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .