• dark mode & Compare plugin

    7
    0 Votes
    7 Posts
    9k Views
    Sserddae KaflaerS

    I forgot to mention some things in my earlier post:

    The scripted switch between light and dark mode doesn’t work while Notepad++ is open. You have to close it, run the script and open it again (should be no problem if Notepad++ remembers the current session for the next launch and regular backups are made).

    For Linux-users: setting custom colors in the Compare plugin settings windows doesn’t work (at least on my Mint box, probably because of a link to a missing Windows system color picker). You have to modify the color codes manually in the config files. If you stick to dark mode all the time, you can just set the custom colors once in ComparePlugin.ini and omit the custom light and dark config files and the switching scripts.

    @Phantom-Lord: coincidentally, I called my script to switch to light mode “Hit the lights” (Metallica in-joke).

  • Replace the comma between two selected words using regex replacement

    4
    0 Votes
    4 Posts
    449 Views
    Alan KilbornA

    @voska7 said in Replace the comma between two selected words using regex replacement:

    i want to replace comma only inside [ABC] [/ABC]

    If you go to the FAQ on this site…
    And from there go HERE
    One of the choices there will take you HERE…which seems to be what you need.

  • Remove unicode characters within range

    3
    0 Votes
    3 Posts
    1k Views
    Dan WierD

    @PeterJones Thank you so much for not only the answer but explaining the difference notation. I may need to adjust my range but it felt like a good place to start to see what I get back from these documents.

  • How to highlight numbers WITHIN words

    3
    0 Votes
    3 Posts
    1k Views
    PeterJonesP

    @Sean-Voltaire said in How to highlight numbers WITHIN words:

    I have already tried toggling the setting “Match whole words only”

    Preferences>Highlighting>Smart Highlighting only affects what is shown when you manually select a piece of text: if you select 314159 here, then it will look like:

    Any Whole Words Only 0110005c-2c89-4945-afbf-cba3a4e8c751-image.png 5a9ee64c-1b2a-4aa4-aad4-322950bf95aa-image.png

    But that will only show you exactly the digits that are currently selected – so it finds the digits of pi, but not the digits of e, since the digits of pi are the ones I had selected.

    That option does not affect UDLs.

    I wasn’t sure if that was tried as a way to change the behavior of the UDL, or if that “match whole word only” was meant to affect something else other than manually selecting text and having it highlight all other text that matches the selection.

    If you couldn’t think of other ways to manually select/mark digits: use the Search > Mark (Ctrl+M) and use a regular expression to manually mark all strings of digits.

    04917b6d-291b-4a74-9aa7-7dd2f9395ae8-image.png

    But given your focus on UDL in the rest of your question, I wonder if you are really just trying to change UDL behavior. You cannot do that with any of the options in the Preferences dialog; UDL is controlled via the UDL dialog/panel and that’s it.

    As far as UDL syntax goes: no, there is no ((SPACE)). ((EOL)) is the only fancy escape… well, except for enclosing a term in quotes: "key word" will match key word but not key other word

    cf28a316-8c9f-4b96-9138-77011b395f0d-image.png

    The quote-around-spaces works for keywords and folding-in-code-2, but in my experiments today, I couldn’t get it to work in folding-in-code-1 or comment-line or operators or delimiters. So that might work for your ((SPACE)) desire, in certain circumstances.

    If you’re really looking to highlight extra numbers that are in weird situations and would like to be able to use a regex but otherwise treat it as a UDL, you can use @Ekopalypse’s Enhance Any Lexer. For example, if I have a UDL called “voltaire” which uses an aqua-like color similar to what you have for its “number style”, and in Enhance Any Lexer, set

    [voltaire] 0xFFFF00 = (?<=[\l\u_])\d+|\d+(?=[\l\u_])

    which will set digits to bright cyan if they have upper or lowercase or underscore to the left or right; otherwise, if the UDL thinks of it as a “word” of numbers (spaces or operators to either side), then the UDL will highlight them with the aqua.

    adc84e21-736b-4a56-b90d-d31c8dc9d19d-image.png

  • List of open tabs are not scrollable

    4
    1 Votes
    4 Posts
    784 Views
    Alan KilbornA

    I noticed a similar open issue for this sort of thing, so I added a comment to the issue, see HERE.

  • Syntax for functionList.xml for R statistical programming language

    15
    1 Votes
    15 Posts
    1k Views
    Monte ShafferM

    @PeterJones I have had NOTEPAD++ on this laptop for a LONG, LONG time (6+ years).

    I was doing some maintenance UPGRADES in R and thought ‘I wonder if I can get this syntax thing to work’ in NOTEPAD++, so here we are.

    Here is the actual example of a function that I have failing:

    stats.summary = function(x, tukey=TRUE, type=1, signif.digits=options("digits")$digits, names = c("min", "-Q1-", "median", "Mean", "-Q3-", "max"), ... ) { # do stuff here! }

    Cheers,

  • how to view .dat file

    3
    0 Votes
    3 Posts
    7k Views
    PeterJonesP

    @Haffy-Ree said in how to view .dat file:

    I opened a .dat file that is supposed to have numbers and letters (text only)

    As Alan hinted, you supposed incorrectly. That file obviously has many binary bytes beyond plain text. Usually files that are named .dat are binary files, not text files.

    We actually have a whole FAQ on that

  • Really save modified file when closing Notepad++

    2
    0 Votes
    2 Posts
    376 Views
    Alan KilbornA

    @Michael-Binz said in Really save modified file when closing Notepad++:

    This seems to be a new feature that was added over the last year

    Nope, as far as I know this capability has existed in Notepad++ for decades. But, you are IMO smart for not wanting to use this feature.

    You will get the behavior you seek by unticking this box:

    46a6cec9-95ef-41cb-8579-9f7f3cf8db43-image.png

    To get there, go to “Settings” menu and choose “Preferences”.

  • Pasting copied text in a search window in a macro

    9
    0 Votes
    9 Posts
    723 Views
    PeterJonesP

    @Raúl-ALR ,

    The instructions for installing and running this script are in the FAQ: How to install and run a script in PythonScript

    The script-specific instructions are found in the script’s code itself.

    # encoding=utf-8 """in response to https://community.notepad-plus-plus.org/topic/23339/pasting-copied-text-in-a-search-window-in-a-macro This searches in the "objects" file for every line: <ObjectRef ref="..."/> It grabs the ref ID, and searches for that ID in the "hosts" file <Host id="id4843X9273" name="object_name" comment="" ro="False"> It grabs the name field from the matching line in the "hosts" file It then replaces the whole <ObjectRef.../> with that name field In the lines below, change the paths to the two files: - The first path is the "objects" file, - The second is the "hosts" file. - Both must be opened in Notepad++, but it doesn't matter which view they are in. - Full paths are required. It makes it a single undo action, so if you don't like the results, you can just hit UNDO """ from Npp import editor,notepad,console class Class23339(object): def go(self, object_fname, host_fname): self.object_fname = object_fname self.host_fname = host_fname notepad.activateFile(object_fname) editor.rereplace(r'<ObjectRef ref="([^"]*)"/>', lambda m: self.repl_in_objects(m)) def repl_in_objects(self, m): notepad.activateFile(self.host_fname) editor.research(r'<Host id="{}" name="(.*?)"'.format(m.group(1)), lambda ms: self.find_in_hosts(ms)) notepad.activateFile(self.object_fname) return self.found_in_hosts def find_in_hosts(self, m): self.found_in_hosts = m.group(1) editor.beginUndoAction() Class23339().go( r"c:\users\peter.jones\downloads\tempdata\nppCommunity\objects.xml", r"c:\users\peter.jones\downloads\tempdata\nppCommunity\hosts.xml" ) editor.endUndoAction()

    If you want to ever customize these, the editor.rereplace(...) line starts with the regex that will match lines in the “objects” file and put the ref-ID value in group(1); the editor.research(...) line starts with the regex that will find the specific ref-ID in the “hosts” file, and grab the value of the host name out of there.

  • Alt key interferes with work

    11
    0 Votes
    11 Posts
    934 Views
    Lee HoganL

    @Lee-Hogan I also having the same problem regarding the typing in a computer. So, we can say that its a common problem facing by the people globally.

  • UDL - parser for journal file "' 0:<" delimeters

    4
    0 Votes
    4 Posts
    367 Views
    naumanmyN

    Hi Ron
    Were you able to fix the issues and use the UDL?
    Can you please share the current copy of the Journal file highlighting?
    Thanks

  • How do I recongnize slightly different coding characters?

    8
    0 Votes
    8 Posts
    1k Views
    M

    @guy038 it looks good, however I don’t have an ANSI file so I can’t practice it

  • To add the button "Save as..." in the toolbar

    3
    0 Votes
    3 Posts
    2k Views
    Jacques PrestreauJ

    @PeterJones
    Hello Peter,

    Thanks a lot for your help.

    Great ! Your procedure works !

    I had troubles to reproduce it. I didn’t understand why it didn’t work the first times until I thought “Gosh ! The semicolons at the beginning of the lines are probably there to transform these lines to comments !”

    Then I removed the semicolon which was the first character on the newly created line, and… Ha ha ! Won ! The button appeared ! And with its tooltip. And it works.

    :)

    Now it will be a piece of cake to modify the icon and put a small bitmap in its place using the last step of your explanation.

    Thanks a lot again, Peter !

    Cheers !
    Jacques (from France)

  • How to enable syntax error

    3
    0 Votes
    3 Posts
    3k Views
    Metro CityM

    @Ekopalypse Great ^^

  • Ctrl+down to jump to the beginning of the next paragraph

    3
    0 Votes
    3 Posts
    475 Views
    Alan KilbornA

    This can be seen/changed in the “Shortcut Mapper”, the area of the Notepad++ software that allows customization of keycombos. Invoke it:

    e70ecd40-0823-4b2c-9f47-9813225047dd-image.png

    And change to the “Scintilla commands” tab and do some downscrolling:

    6c679e17-4457-4a11-b6f7-28b8480625b7-image.png

    So, as a user you probably don’t care about “Scintilla” or even know what it is – it is an editing component that Notepad++ embeds to get its real work (editing text!) accomplished.

    Thus, you’d have to have some intuition about what “SCI_PARADOWN” means, but for the most part this isn’t too difficult.

    BTW, you could remap this command to Ctrl+down if you wanted, but that keycombo is tied by default to a different command, so you’d have to remap the other command as well so as to not have a conflict.

  • Export Hex view in Txt format

    3
    0 Votes
    3 Posts
    3k Views
    Cyril Di ValentinC

    Tanks a lot for your answer. I will try to use xxd as you mentonned.
    I can also use hexedit but the size of the file (dump file .bin) is too big for hexedit so that i don"t have the whole file…
    Therefore if you already used a similar application, I would be very interested in that.

    Thanks and have a good week.

    Cyril

  • Changing the default save as type to all types (*.*)

    4
    0 Votes
    4 Posts
    276 Views
    MaximillianMM

    @Alan-Kilborn Thanks so much!
    Cheers

  • Clear read only flag

    2
    1 Votes
    2 Posts
    180 Views
  • Add a character to the beginning of each bookmarked line

    2
    0 Votes
    2 Posts
    453 Views
    guy038G

    Hello, @zean-yauh and All,

    Do you mean something like that ?

    SEARCH (?-s)\R(?!.+:)

    REPLACE \x20

    Tick the Wrap around option

    Select the Regular expression search mode

    Click on the Replace All button

    Best Regards,

    guy038