Default User Defined Language ?



  • Is there a way to make user defined language by default?
    I’ve been searching for 1h and the only thing I found are post from over 3 years ago, which are probably outdated.

    Thanks.



  • I am assuming you mean “set a specific UDL as the default language for a new file” – akin to Settings > Preferences > New Document > Default Language, but with the ability to select a UDL rather than a builtin.

    I don’t know of a way directly.

    However, if you have your UDL defined with a particular extension, then if you create a new file and immediately save-as to a filename with that extension, and it will immediately change over to that UDL. (This has the side benefit of immediately naming your file, so you’re not trying to figure out two days later “which file was new 1, which was new 42, …?”)



  • Well, I want the first thing you mentionned.

    For the second thing, I guess that can work. But first, how do do that? And second, mine is not a coding language. It just need to be a txt with SOME modification (My modification is only folding. Literally nothing else)



  • @XiarnoYTooShort said:

    how do do that?

    How do you do what? I assume you know how to save a file with a specific extension. Given that you implied you already had a UDL, I had originally thought you would know how to add an extension to UDL, but if not: Go to Language > Define your language, select your desired language from the pulldown, and in the Ext.: box, type the extension (without the dot, using spaces to separate multiple extensions) – so, for example, I have a customized Markdown UDL, so I entered md markdown in that box, so files that end in .md or .markdown utilize that UDL.

    If you happen to use an extension (like txt) that defaults to some other lanugage, Notepad++ will see that you used that extension for your UDL instead, and will apply the UDL rather than the default language for that extension.

    second, mine is not a coding language

    Notepad++ and UDL don’t care whether they are programming languages, text formatting languages, or anything else that you want to apply lexing, syntax highlighting, and/or folding to: it doesn’t matter whether you’re defining D-flat-plus-minus programming, Ultra-Markup-Markside-Ubertext, a specific flavor of XML-based markup, a syntax for making simple TODO lists with folding, or a movie subtitle file – they are all treated the same, and called a “language”.



  • @PeterJones said:

    I have a customized Markdown UDL

    Oooh, is it cool? Care to share? :)



  • @Alan-Kilborn said:

    Oooh, is it cool? Care to share? :)

    Not really cool; it’s just one I made before Don started shipping his Markdown UDL with Notepad++, and I got used to it’s quirks, so haven’t transferred over to using Don’s quirks instead.

    But if you want to try to convert your quirks:

    <NotepadPlus>
        <UserLang name="Markdown" ext="md markdown readme" udlVersion="2.1">
            <Settings>
                <Global caseIgnored="yes" allowFoldOfComments="no" foldCompact="no" forcePureLC="0" decimalSeparator="0" />
                <Prefix Keywords1="yes" Keywords2="yes" Keywords3="yes" Keywords4="yes" Keywords5="yes" Keywords6="no" Keywords7="no" Keywords8="no" />
            </Settings>
            <KeywordLists>
                <Keywords name="Comments">00# 01 02((EOL)) 03&lt;!-- 04--&gt;</Keywords>
                <Keywords name="Numbers, prefix1"></Keywords>
                <Keywords name="Numbers, prefix2"></Keywords>
                <Keywords name="Numbers, extras1"></Keywords>
                <Keywords name="Numbers, extras2"></Keywords>
                <Keywords name="Numbers, suffix1">.</Keywords>
                <Keywords name="Numbers, suffix2">.</Keywords>
                <Keywords name="Numbers, range"></Keywords>
                <Keywords name="Operators1">@ &lt; &gt; \&lt; \&gt; \\ \` \_ \{ \} [ ] \( \) \# \+ \- \. \! \~ :|: |: :| | \|</Keywords>
                <Keywords name="Operators2">* - +</Keywords>
                <Keywords name="Folders in code1, open"></Keywords>
                <Keywords name="Folders in code1, middle"></Keywords>
                <Keywords name="Folders in code1, close"></Keywords>
                <Keywords name="Folders in code2, open"></Keywords>
                <Keywords name="Folders in code2, middle"></Keywords>
                <Keywords name="Folders in code2, close"></Keywords>
                <Keywords name="Folders in comment, open"></Keywords>
                <Keywords name="Folders in comment, middle"></Keywords>
                <Keywords name="Folders in comment, close"></Keywords>
                <Keywords name="Keywords1">http:// (http:// https:// (https:// mailto: (mailto: ftp:// (ftp:// ftps:// (ftps:// (/ / file:// (file://</Keywords>
                <Keywords name="Keywords2">==== ----</Keywords>
                <Keywords name="Keywords3">*** ___</Keywords>
                <Keywords name="Keywords4">** __</Keywords>
                <Keywords name="Keywords5">* _</Keywords>
                <Keywords name="Keywords6">** __</Keywords>
                <Keywords name="Keywords7">* _</Keywords>
                <Keywords name="Keywords8"></Keywords>
                <Keywords name="Delimiters">00![ 00[ 01\ 02] 02] 03``` 03` 03~~~ 04\ 05``` 05((EOL `)) 05~~~ 06*** 07\ 08((EOL ***)) 09** 10\ 11((EOL **)) 12* 13\ 14((EOL *)) 15** 16\ 17((EOL **)) 18* 19\ 20((EOL *)) 21~~ 22\ 23~~</Keywords>
            </KeywordLists>
            <Styles>
                <WordsStyle name="DEFAULT" fgColor="333333" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" />
                <WordsStyle name="COMMENTS" fgColor="008000" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" />
                <WordsStyle name="LINE COMMENTS" fgColor="FF8040" bgColor="FFFFFF" fontName="" fontStyle="1" nesting="67108864" />
                <WordsStyle name="NUMBERS" fgColor="0000FF" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" />
                <WordsStyle name="KEYWORDS1" fgColor="408080" bgColor="FFFFFF" fontName="" fontStyle="4" nesting="0" />
                <WordsStyle name="KEYWORDS2" fgColor="FF8080" bgColor="FFFFFF" fontName="" fontStyle="1" nesting="0" />
                <WordsStyle name="KEYWORDS3" fgColor="000080" bgColor="FFFFA0" fontName="" fontStyle="3" nesting="0" />
                <WordsStyle name="KEYWORDS4" fgColor="400080" bgColor="FFFFFF" fontName="" fontStyle="1" nesting="0" />
                <WordsStyle name="KEYWORDS5" fgColor="000080" bgColor="FFFFFF" fontName="" fontStyle="2" nesting="0" />
                <WordsStyle name="KEYWORDS6" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" />
                <WordsStyle name="KEYWORDS7" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" />
                <WordsStyle name="KEYWORDS8" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" />
                <WordsStyle name="OPERATORS" fgColor="0000FF" bgColor="FFFF00" fontName="" fontStyle="1" nesting="0" />
                <WordsStyle name="FOLDER IN CODE1" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" />
                <WordsStyle name="FOLDER IN CODE2" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" />
                <WordsStyle name="FOLDER IN COMMENT" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" />
                <WordsStyle name="DELIMITERS1" fgColor="408080" bgColor="FFFFFF" fontName="" fontStyle="1" nesting="0" />
                <WordsStyle name="DELIMITERS2" fgColor="000000" bgColor="CCFFFF" fontName="" fontStyle="0" nesting="0" />
                <WordsStyle name="DELIMITERS3" fgColor="008000" bgColor="FFFFFF" fontName="" fontStyle="1" nesting="0" />
                <WordsStyle name="DELIMITERS4" fgColor="FF8000" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" />
                <WordsStyle name="DELIMITERS5" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" />
                <WordsStyle name="DELIMITERS6" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" />
                <WordsStyle name="DELIMITERS7" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" />
                <WordsStyle name="DELIMITERS8" fgColor="C0C0C0" bgColor="FFFFFF" fontName="" fontStyle="4" nesting="0" />
            </Styles>
        </UserLang>
    </NotepadPlus>

Log in to reply