My experience of using Notepad ++ for writing speeches, plays and short Auto Hotkey Scripts.
I cannot always save my custom “programming language” as the default language, when I reopen the program.
I would like to know how the form for programming language form is filled for C programming language to get a good example.
I would like the Document Map to show the headings of the collapsible C - styled text
If you mean that you would like to apply your User Defined Language (whatever you named it) to a file when you first create a new file in Notepad++, it doesn’t work that way. If you immediately save that file with the extension that you’ve defined in Language > Define Your Language, User language:
<chosen language>, Ext.:
____, then as soon as it’s saved, it will switch to using that syntax highlighting.
- I would like to know how the form for programming language form is filled for C programming language to get a good example.
It is possible to develop a code lexer as a Notepad++ plugin, and you can see “Extend functionality with plugins” in the official docs for how to get started in plugin development. You can google for examples of “Notepad++ lexer plugin source code” available on the web if you want more specific examples.
- I would like the Document Map to show the headings of the collapsible C - styled text
That’s not the purpose of the Document Map. If you want the function list, look in the View menu, one row below Document Map: the Function List will list all the functions (which is what I assume you meant by “headings of the collapsible c - styled text”) in the current source code file.
This post is deleted!
I can write a simple script, yet I am not a developer.
I find notepad++ to be very convenient for my trade.
My experience is that the custom language is not left as default and has to switched on manually.
Then how would I know how to define a new language? I don’t understand what many terms on many of the fields stand for? Is there an example that can show me?
I cannot use the function list, because the program doesn’t know what are functions. I cannot define my headings to be seen as “functions”.
I really like the collapsible CPL - like layout for my writings, speeches, etc. It is easy on my eyes to read such shorthanded text that looks a lot like a programming language
I am sure that more and more people will eventually find that a simple single- font text is a lot easier to glance at. Windows Notepad was just too limited in it’s functionality to write, rewrite, organize ideas, as I do.
I want to create something that Notepad ++ would recognize as a programming language and that I could use to organize my speeches and other writings.
Then how would I know how to define a new language? I don’t understand what many terms on many of the fields stand for?
The official docs have a page on User Defined Languages (UDL), which give an overview; those docs, and the Language > Define Your Language… dialog both link to Ivan Radić’s excellent UDL documents, which delve into the details.
the custom language is not left as default and has to switched on manually.
When defining your language, if your language files are always going to end in the extension
.vlad, then set the extension box to
vladin the UDL dialog box. If the filename extension matches the custom extension in the UDL dialog, then Notepad++ will automatically apply that UDL to that file. I described that in the first reply.
I cannot use the function list, because the program doesn’t know what are functions.
Standard/default languages have the FunctionList definition included with Notepad++. For custom languages, you will have to edit
%AppData%\Notepad++\functionList.xml; after editing that, you will have to save/exit then reload Notepad++. The Function List document gives a description on how to customize that.
Taking one of my custom UDL where I do have a function list defined, and stripping out proprietary information, an example of the functionList.xml portions:
<associationMap> ... <association id="fn_udl_vlad" userDefinedLangName="Vladimir's UDL" /> <association id="fn_udl_vlad" ext=".vlad" /> </associationMap>
<parsers> <parser id="fn_udl_vlad" displayName="Vladimir's UDL" commentExpr="((--.*?$))" > <function mainExpr="^[\s]*(private[\s]+)?(procedure|function)[\s]*[\w_]+" displayMode="$functionName" > <functionName> <nameExpr expr="^[\s]*(private[\s]+)?(procedure|function)[\s]*[\w_]+" /> </functionName> </function> </parser> ... </parsers>
If you then look at this Example Document saved as
example.vlad, and turn on the Function List, you will see two items in the list.
private procedure name(arguments) ... function fnname() ...
Note: for this example to work, the UDL would have to be named “Vladimir’s UDL”, and the extension would need to be set to