Header plugin
-
Hello friends, can you tell me if there is any add-on or plugin for Notepad++ for the following purpose.
There is a very large text, divided by headings, I need to be able to view all headings and quickly go to them, to the desired place in the text by clicking the mouse. -
@Aleksandr-Shchepkin
How large of a file is it? 10MB? 100MB or larger? A few hundred KB? Is it plain text, or is it some special file type like INI?The best solution is going to depend on your answer to those questions.
-
My first thought would be “custom FunctionList” definition. How effective and/or difficult that is will depend on your answers to Mark’s questions.
But if you have a unique extension (maybe
*.myfile
), and/or the file is already in a built-in file format or you have a User Defined Language for the file type – maybe the Markdown UDL that ships with N++, for example – then you just need to figure out a regex that will find the “headings”, and then can create a FunctionList definition that will put those in the FunctionList panel. But even if it’s a plaintext.txt
file, you can use thefunctionList\normal.xml
to define a Function List rule for even plaintext. -
Friends, you’ve helped me so much, I’m so happy. I have a txt file with more than 16000 lines, size 1,6 mb. I created an xml file in the functionList folder with the following code:
<NotepadPlus>
<functionList>
<parser displayName=“XML” id=“xml”>
<function
mainExpr=“#([^#<]+)”
displayMode=“$functionName”>
</function>
</parser>
</functionList>
</NotepadPlus>And indeed now, I have a set of headers displayed on the right (the headers start with the # symbol).
The file is constantly growing, so far everything is working very well, thanks.