Community
    • 登入

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

    已排程 已置頂 已鎖定 已移動 General Discussion
    6 貼文 3 Posters 1.8k 瀏覽
    正在載入更多貼文
    • 從舊到新
    • 從新到舊
    • 最多點贊
    回覆
    • 在新貼文中回覆
    登入後回覆
    此主題已被刪除。只有擁有主題管理權限的使用者可以查看。
    • Vladimir TolskiyV
      Vladimir Tolskiy
      最後由 編輯

      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

      PeterJonesP 1 條回覆 最後回覆 回覆 引用 0
      • PeterJonesP
        PeterJones @Vladimir Tolskiy
        最後由 PeterJones 編輯

        @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 條回覆 最後回覆 回覆 引用 2
        • Vladimir TolskiyV
          Vladimir Tolskiy
          最後由 編輯

          此回覆已被刪除!
          Vladimir TolskiyV 1 條回覆 最後回覆 回覆 引用 0
          • Vladimir TolskiyV
            Vladimir Tolskiy @Vladimir Tolskiy
            最後由 Vladimir Tolskiy 編輯

            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 條回覆 最後回覆 回覆 引用 0
            • PeterJonesP
              PeterJones
              最後由 PeterJones 編輯

              @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 條回覆 最後回覆 回覆 引用 1
              • Dido LodD
                Dido Lod
                最後由 編輯

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

                1 條回覆 最後回覆 回覆 引用 0
                • PeterJonesP PeterJones locked this topic on
                • 第一個貼文
                  最後的貼文
                The Community of users of the Notepad++ text editor.
                Powered by NodeBB | Contributors