• Setting a font specific to .txt files

    4
    0 Votes
    4 Posts
    2k Views
    PeterJonesP

    @Asher-Stuhlman ,

    I would like to use monospaced font for unknown file types and a specific font only for .txt files if possible.

    That’s not the way that Notepad++ works. All unknown file extensions are interpreted by Notepad++ as “Normal Text”, and all Normal Text, whether it ends in .txt or not, get the Default Style applied. That’s the way Notepad++ was designed.

    You might be able to get your desired behavior by creating a User Defined Language (UDL) associated with the .txt extension, and use the UDL dialog to set the font for just .txt. (This would override .txt so it’s using the UDL lexer, and is no longer considered “Normal Text”)

    official UDL overview: https://npp-user-manual.org/docs/user-defined-language-system/ UDL details: https://ivan-radic.github.io/udl-documentation/
  • 'Find in all files' does not find anything

    3
    0 Votes
    3 Posts
    234 Views
    PeterJonesP

    For example, this worked for me:
    1aa86c85-13c5-4226-9e5b-f08b214ae294-image.png

  • ks syntax highlighting

    2
    0 Votes
    2 Posts
    305 Views
    PeterJonesP

    @MysticMylese ,

    It might depend on what .ks files are. I don’t know of any of the builtin language lexers that expect that file extension, but I don’t know all the lexers myself.

    In general, if there isn’t a builtin lexer, you will have to create a User Defined Language (UDL).

    Official docs UDL overview: https://npp-user-manual.org/docs/user-defined-language-system/ Detailed UDL description: https://ivan-radic.github.io/udl-documentation/

    There is a community-supplied collection of UDL at https://github.com/notepad-plus-plus/userDefinedLanguages/blob/master/udl-list.md , which you can download as described in the official docs UDL overview… but I don’t see any there that immediately jump out and say “I use the extension .ks”

  • Double-click select highlight only cursor occurrence?

    6
    0 Votes
    6 Posts
    1k Views
    Alan KilbornA

    @Vinnie-M said in Double-click select highlight only cursor occurrence?:

    I just expect to see only one thing highlighted

    If you look carefully, the highlights are different. There’s the light-green for the smart highlighting, and a different color for the selected text. Of course the “different color” is a blended version of the light-green and the selected text background color, but that’s because a double-clicked word is selected and smart-highlighted simultaneously.

    for example, 3 different markers for blocks: circle vs. square

    Well, for this you mean folding markers. This type of thing is provided because the underlying component supports it; Notepad++ developers had to code very little to achieve folding, so they probably felt that they needed to do some amount of work. :-) Other settings are similar; someone else coded it, and Notepad++ developers just allow their users to turn it on/off.

    I think it would also be appropriate to ask “is there a setting to do this or not do that”

    Yes, of course, certainly. Ask away.

  • 0 Votes
    12 Posts
    778 Views
    Alan KilbornA

    @guy038 said in Changing the focus from Function List panel to the main editor, and vice-versa:

    At no time did I want to suggest that people should donate to help me get a new laptop !

    Of course not; all my idea.
    Nobody interpreted it as you with your hand out.
    At least I don’t think so.
    I’ll cease with the joking around as perhaps it is making you feel awkward; apologies.

  • Option to automatically trim trailing spaces as you leave a line?

    3
    1 Votes
    3 Posts
    892 Views
    Vinnie MV

    OK, thanks.

  • 'Find Previous' shortcut not working?

    3
    0 Votes
    3 Posts
    1k Views
    PeterJonesP

    @Alan-Kilborn said in 'Find Previous' shortcut not working?:

    backward searching for this has been (mostly) disabled due to unexpected results in certain cases.

    @Nathan-Wailes ,

    To re-enable backwards regex, see the official docs at https://npp-user-manual.org/docs/preferences/#preferences-for-advanced-users

    more issues are reported

    As I’ve said before, sometimes change is “implemented to make the majority more happy, which had the side effect of making the minority more unhappy.” – except, in this case, I’m wondering if the change wasn’t for the minority, making the majority unhappy. :-)

  • 0 Votes
    1 Posts
    102 Views
    No one has replied
  • Function List for Perl

    11
    0 Votes
    11 Posts
    656 Views
    PeterJonesP

    I haven’t had a chance to “live with it” yet, but I took @MAPJe71’s and added yuzhy8701’s attributes/prototypes

    I also allowed (\w*::)* in the function name, to handle that rare-but-valid syntax. (I decided it didn’t need a separate hierarchy, because if you’re doing it in that format, you probably aren’t thinking of it as “belonging” to a class.)

    e710e890-fb34-46e3-a56f-e790a0f7a868-image.png

    <!-- ======================================================== [ PERL ] --> <!-- PERL - Practical Extraction and Reporting Language --> <parser displayName="Perl" id="perl_function" commentExpr="(?x) # free-spacing (see `RegEx - Pattern Modifiers`) (?m-s:\x23.*$) # Single Line Comment | (?s:__(?:END|DATA)__.*\Z) # Discard up till end-of-text " > <classRange mainExpr ="(?x) # free-spacing (see `RegEx - Pattern Modifiers`) (?m) # ^ and $ match at line-breaks (?'PACKAGE_HEADER' ^ # NO leading white-space at start-of-line (?-i:package\b) ) (?s:.*?) # whatever, (?= # ...up till \s* # ...optional leading white-space of (?: (?&amp;PACKAGE_HEADER) # ...next header | \Z # ...or end-of-text ) ) " > <className> <nameExpr expr="(?x) # free-spacing (see `RegEx - Pattern Modifiers`) \s \K # discard text matched so far [^;]+ " /> </className> <function mainExpr="(?x) # free-spacing (see `RegEx - Pattern Modifiers`) (?m) ^\h* sub \s+ (?:\w+\:\:)* # optional prefix::package::names:: \w+ (?:\s*\([^()]*\))? # prototype or signature (?:\s*\:\s*[^{]+)? # attributes \s*\{ # start of function body " > <functionName> <funcNameExpr expr="(?x) # free-spacing (see `RegEx - Pattern Modifiers`) (sub\s+)? \K # discard text matched so far (?:\w+\:\:)* # optional prefix::package::names:: \w+ " /> </functionName> </function> </classRange> <function mainExpr="(?x) # free-spacing (see `RegEx - Pattern Modifiers`) (?m) ^\h* sub \s+ (?:\w+\:\:)* # optional prefix::package::names:: \w+ (?:\s*\([^()]*\))? # prototype or signature (?:\s*\:\s*[^{]+)? # attributes \s*\{ # start of function body " > <functionName> <nameExpr expr="(?x) # free-spacing (see `RegEx - Pattern Modifiers`) (?:sub\s+)? \K # discard text matched so far (?:\w+\:\:)* # optional prefix::package::names:: \w+ " /> </functionName> </function> </parser>
  • I need help with replacing different strings

    4
    1 Votes
    4 Posts
    371 Views
    Olivier ThomasO

    This is not a valid srt timecode.
    Whatever you do, it won’t work.
    00:26.369,0:00:33.450

    The correct code is as follows:
    00:00:36,833 --> 00:00:39,291

  • Very long pattern

    21
    0 Votes
    21 Posts
    2k Views
    Olivier ThomasO

    @astrosofista said in Very long pattern:

    even I upvoted your contribution

    I wish he had done it for me even though I asked him about it.
    he just wrote like this:
    If it works for you, use it. We have given you enough that you can accomplish this task.

    ((\d*[5-9]|\d+[01])\b)|([1-9]?1[2-4]\b)
    Was it not working?

    @PeterJones
    Maybe we’ll bury the war ax and smoke the peace pipe?

    If you have any questions, I will be happy to answer.

  • creare macro eliminare spazi e virgole

    3
    0 Votes
    3 Posts
    406 Views
    massimo la terraM

    perfetto grazie

  • 0 Votes
    8 Posts
    1k Views
    No OneN

    @Alan-Kilborn thank you very much for pointing that out!

  • awk mode

    2
    0 Votes
    2 Posts
    1k Views
    EkopalypseE

    @Joseph-Newcomer

    UDL has its limitations, one way to overcome those is to use a script like this.

    Is your gawk udl available for download if one wants to make some tests?

  • RegEx problems

    28
    0 Votes
    28 Posts
    2k Views
    Olivier ThomasO

    God, it can’t be,
    better not to change.

  • Encoding TXT UTF8NoBom -> UTF8

    5
    0 Votes
    5 Posts
    270 Views
    gstaviG

    Just read better the title.
    Moving from UTF8 wo/BOM to UTF8 w/BOM is not a conversion. All that need to be done is add 3 BOM bytes to the beginning of the file. Just be sure not to add them twice. So basically create a 3 byte file with BOM and do something like (I don’t remember the exact copy syntax of Windows):
    copy bom.txt+file.txt file_new.txt

    Read this to understand Unicode and encoding. You should realize that UTF8 w/BOM is a pretty stupid concept. So unless you need to feed your file into an application that requires UTF8 BOM stay with UTF8 wo/BOM.

  • עזרה בהרצה על הדפדפן

    3
    0 Votes
    3 Posts
    151 Views
    Z

    תודה רבה!

  • Template substitution from list

    2
    0 Votes
    2 Posts
    169 Views
    EkopalypseE

    @Atanvarno-Aldarion

    Yes, there is, and it’s called the PythonScript plugin.
    Probably any other scripting plugin can do this too.

    Here is an example of what it might look like.

    names = [ 'HARRY', 'RON', 'HERMIONE', ] template = ''' STUDENT {0} IS: NAME: {0} ID: 1-{0}-2 BIOGRAPHY: {0}'s biography follows. ''' editor.appendText('\r\n'.join([template.format(x) for x in names]))
  • Nested and hidden text notes

    2
    0 Votes
    2 Posts
    723 Views
    EkopalypseE

    @Michael-Eve

    Define your UDL and create folding points.

  • Mark every line contains less than 3 dots

    4
    0 Votes
    4 Posts
    244 Views
    Mohammed AsifM

    thanks, guys it worked, both of your solutions worked