Search code examples
replacemacrosnotepad++

Notepad++, shortcut to add brackets around highlighted text


I recorded a macro to type curly braces {} using a given shortcut

Can I record a macro that takes any given highlighted text (word(s)), and adds the curly braces around it?

So I can highlight the words:

test here

and click the shortcut created with a macro, and turn the text to:

{test here}

Solution

  • This will work with one or many words:

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

    this should do the trick