• Login
Community
  • Login

My experience of using Notepad ++ for writing speeches, plays and short Auto Hotkey Scripts.

Scheduled Pinned Locked Moved General Discussion
6 Posts 3 Posters 1.8k Views
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • V
    Vladimir Tolskiy
    last edited by Dec 2, 2019, 3:24 AM

    1. I cannot always save my custom “programming language” as the default language, when I reopen the program.

    2. I would like to know how the form for programming language form is filled for C programming language to get a good example.

    3. I would like the Document Map to show the headings of the collapsible C - styled text

    P 1 Reply Last reply Dec 2, 2019, 2:57 PM Reply Quote 0
    • P
      PeterJones @Vladimir Tolskiy
      last edited by PeterJones Dec 2, 2019, 2:58 PM Dec 2, 2019, 2:57 PM

      @Vladimir-Tolskiy said in My experience of using Notepad ++ for writing speeches, plays and short Auto Hotkey Scripts.:

      1. I cannot always save my custom “programming language” as the default language, when I reopen the program.

      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.

      1. I would like to know how the form for programming language form is filled for C programming language to get a good example.

      That’s part of the Scintilla source code embedded in Notepad++ (where Scintilla is the editor component that Notepad++ uses internally). It’s not user-customizeable.

      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.

      1. 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.

      1 Reply Last reply Reply Quote 2
      • V
        Vladimir Tolskiy
        last edited by Dec 9, 2019, 8:41 AM

        This post is deleted!
        V 1 Reply Last reply Dec 9, 2019, 9:16 AM Reply Quote 0
        • V
          Vladimir Tolskiy @Vladimir Tolskiy
          last edited by Vladimir Tolskiy Dec 9, 2019, 9:16 AM Dec 9, 2019, 9:16 AM

          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.

          Thank you.

          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.

          1 Reply Last reply Reply Quote 0
          • P
            PeterJones
            last edited by PeterJones Dec 9, 2019, 2:52 PM Dec 9, 2019, 2:50 PM

            @Vladimir-Tolskiy ,

            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 vlad in 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:
            Example <association> entries

                <associationMap>
                    ...
                    <association id="fn_udl_vlad"          userDefinedLangName="Vladimir's UDL" />
                    <association id="fn_udl_vlad"          ext=".vlad"                          />
                </associationMap>
            

            Example <parser> definition

                <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 .vlad

            1 Reply Last reply Reply Quote 1
            • D
              Dido Lod
              last edited by Oct 1, 2022, 8:25 PM

              привіт, цікаво

              1 Reply Last reply Reply Quote 0
              • P PeterJones locked this topic on Oct 1, 2022, 9:52 PM
              • First post
                Last post
              The Community of users of the Notepad++ text editor.
              Powered by NodeBB | Contributors