0

Is there a way in notepad++ to save a text, like a copyright comment

<?xml version="1.0" encoding="utf-8"?>
<!--
    I did write this one day, it's my work
-->

and later (even after closing notepad++), insert it in a file ?

Somehow, just like a macro, but I don't want to start recording a macro, then (carefully) type my text and save that macro.

(may be already answered, but I don't very see what keywords to use)


Edited (exact scenario)

I have a lot of XML files with:

<?xml version="1.0" encoding="utf-8"?>
<localization xml:lang="en">
<!-- Some XML nodes -->
</localization>

One file for each language, one set of all languages for each project. In one of these file (en.xml), I've wrote a comment about how these files work:

<!--
Use loc: namespace for each localization entry.
Nodes without this "loc:" namespace should be containers
and should contain "loc:" nodes or other containers.

@todo    Check every entry for typing mismistakes
@todo    Assign the XSD
-->

Now, I want to "save" this text in notepad++ (like a macro, but I don't want to start recording the macro and retype the text). Then, later, I open fr.xml, and tell notepad++ to paste the saved text at the beginning of the file. Then, I copy nodes from fr.xml, paste them somewhere, and mess with Ctrl+C Ctrl+V inside/outside my fr.xml (usual stuff). Now, I copy a node from fr.xml (like <loc:foo/>) and paste it in de.xml. And I want to still be able to "paste" the saved text, aka the comment <!-- Use loc:..., inside de.xml even if I did copy/paste before (so I cannot Ctrl+C the comment because it would erase/be erased by the copy of <loc:foo/>).

Currently, the only way I have to do this is:

  • start recording a macro
  • retype the text I don't want to do this step: I have verbose comments to "record"
  • stop recording
  • save the macro (with a shortcut).

Retyping the text (some are much longer) while recording the macro is a pain.

Is there a way to create the macro without retyping the text? If not, is there a way to "save" a text and insert it later in other files (without Ctrl+C/Ctrl+V)?

Xenos
  • 3,351
  • 2
  • 27
  • 50

1 Answers1

0

FingerText was the answer.

What I was talking about (save a text "somewhere" in N++ and reuse it later) is called Code Snippets (here, it's intended for texts and comments).

FingerText is accessible at https://github.com/erinata/FingerText or through Notepad++ Plugin Manager.

This question was a duplicate of Manage code snippets in Notepad++

Community
  • 1
  • 1
Xenos
  • 3,351
  • 2
  • 27
  • 50