• Disconnect on save with NPPFTP

    3
    0 Votes
    3 Posts
    1k Views
    iChal2112I

    I’ve recently returned to using NppFTP and have noticed the same thing - it’s very annoying!
    After finding the work-around I’ve described below, it leads me to believe that the problem (in my case) might be that the default cache location is not writable without admin privileges (which have recently been changed on my work PC due to a security breach).
    I haven’t ‘upgraded’ to Windows 11 yet, so can’t say whether Notepad++ is trying to cache the files a privileged location, but it worked for me.

    I found that the problem went away when I assigned a (writeable) local path to the external path. I haven’t had any problem since.

    I hope this helps.

    Untitled.png

  • Macro for Open, Find and Replace and Save

    22
    0 Votes
    22 Posts
    7k Views
    Jaguar AsadJ

    @guy038 said in Macro for Open, Find and Replace and Save:

    Hello, @josé-luis-montero-castellanos, @aln-kilborn and all,

    @josé-luis-montero-castellanos, regarding your regex S/R :

    SEARCH (?s)(<St)(.)(/S)(.)(<Xt)(.)(/X)|(<Xt)(.)(/X)(.)(<St)(.)(/S)

    REPLACE ?1\5\2\7\4\1\6\3:${12}${9}${14}${11}${8}${13}${10}

    Why do you need the leading in-line modifier (?s), in the search part ? Do you mean that the single char . in group 2, 4, 6, 9, 11 and 13 may also represent a line-break char ( \r or \n ) ?

    I suppose not ! Then, your correct search regex is rather :

    (?-s)(<St)(.)(/S)(.)(<Xt)(.)(/X)|(<Xt)(.)(/X)(.)(<St)(.)(/S)

    where any . single char will represent a non-break char, only !

    Now, I noticed that the groups used, in replacement, for each alternative of the search regex, are in the same order ! Then, you can use, preferably, a specific feature of the Boost Regex engine, called Branch Reset

    For instance, in your regex, the numbers of each group are :

    (?-s)(<St)(.)(/S)(.)(<Xt)(.)(/X)|(<Xt)(.)(/X)(.)(<St)(.)(/S) Gr : 1 2 3 4 5 6 7 |8 9 10 11 12 13 14

    If we use the Branch Reset feature the search regex becomes :

    (?-s)(?|(<St)(.)(/S)(.)(<Xt)(.)(/X)|(<Xt)(.)(/X)(.)(<St)(.)(/S)) Gr: 1 2 3 4 5 6 7 |1 2 3 4 5 6 7

    Thus, your entire regex S/R can be simplified as below :

    SEARCH (?-s)(?|(<St)(.)(/S)(.)(<Xt)(.)(/X)|(<Xt)(.)(/X)(.)(<St)(.)(/S))

    REPLACE \5\2\7\4\1\6\3

    For instance, given this INPUT text :

    <St2/S4<Xt6/X <Xt9/XB<StD/S

    You would get the OUTPUT text, below :

    <Xt2/X4<St6/S <St9/SB<XtD/X

    Notes :

    The Regular expression option must be selected

    Preferably, tick the [Wrap around](https://www.ahijoy.com/) option

    Best Regards,

    guy038

    I tried it but didn’t work

  • Make NPP list its current shorcut key assignments?

    9
    0 Votes
    9 Posts
    5k Views
    PeterJonesP

    Future reference:

    More of the solution to this, with example scripts, is found here

  • Replace specific line #s within multiple programs

    8
    0 Votes
    8 Posts
    2k Views
    Alan KilbornA

    @Scott-Raskin said in Replace specific line #s within multiple programs:

    how to replace that with all of that text below

    Arguably the easiest way is to do this:

    select your desired replacement text:
    955b70e6-212a-41a3-a9a9-1ba3ca2813f5-image.png

    press Ctrl+Shift+f to bring up Find in Files window; your desired replacement data will be in the Find what box (not in Replace with where you want it):
    c7416569-fac0-4b52-b7a4-75f5d8381692-image.png

    press the “up/down arrow” – aka “swap” – button to move your data from Find what to Replace with:
    61e5360d-2997-4480-a9c3-8df561aaf540-image.png

    put your search expression into Find what, and continue on with hopefully obvious steps to accomplish your replacement operation

  • Closing when connecting

    8
    0 Votes
    8 Posts
    474 Views
    Alan KilbornA

    @ArlynSilverthorn

    If all you are capable of doing is saying “it doesn’t work”, then no one can help you. Please reference Peter’s prior post.

  • File explorer initial remote directory - hide unwanted path from root

    8
    1 Votes
    8 Posts
    830 Views
    erik parkerE

    @PeterJones Yes, what you wrote is correctly what i have on mind.

    The reason why i dont want to see what is before initial dir is:

    waste of space on explorer annoying scrolling when there are more subdirs when you resume your work (after opening NPP) and you CTRL+S the file, File explorer starts from the root, which makes it very annoying to go back to the saved file position. Imagine i have like 10+dirs from the root.

    At the moment im doing it like this: I open NPP, i close all tabs which are already opened, then i connect to the server and open files again.

  • Delete some lines

    3
    0 Votes
    3 Posts
    240 Views
    Roel JongmanR

    Thank you Allan,

    I was aware of the find-and-replace option, but did not know how to select the whole line.
    I worked just fine for me.

  • Windows Updates Problems

    8
    0 Votes
    8 Posts
    2k Views
    ghwmorgG

    @Terry-R

    The funny thing is that before receiving for you, the idea of opening N++ without plugins, after Windows updates, N++ could not stay open. But it has been shown that without plugins; Yes.

    That information, as it is, is curious.

    Greetings.

  • Remove columns

    4
    0 Votes
    4 Posts
    19k Views
    TheNainBoyT

    @guy038 you saved my life men , hats off u buddy…

  • Printing also gives gray background

    3
    0 Votes
    3 Posts
    703 Views
    Michael RochollM

    @PeterJones said in Printing also gives gray background:

    @Michael-Rocholl ,

    See the “Known issues” section at the bottom of this FAQ.

    Thanks for quick response - Michael

  • New NPP Install issues for UDL features install

    14
    0 Votes
    14 Posts
    871 Views
    Lycan ThropeL

    @PeterJones ,

    Thanks for those clarifications. I’m glad I’m not going mad. :)

  • AutoHotkey: Ctrl+Shift+M adds blank line instead of triggering function

    7
    0 Votes
    7 Posts
    905 Views
    Mister MechM

    Yeah, it turned out to be the unmapped shortcuts. Thanks to everyone for the detailed explanations. It helped with this and it will help in the future.

  • Folding and collapsing indented children. Possible?

    4
    0 Votes
    4 Posts
    335 Views
    GedijorgeG

    @Alan-Kilborn
    Thank you! 🤗 Works the way I wanted. 🎉
    In combination with the shortcuts it should be very handy.

    aa.jpg

  • Wonky display of double musical note character

    8
    1 Votes
    8 Posts
    570 Views
    PeterJonesP

    Aside: the font that my browser is using for monospace has a mistake in its gylphs:
    1db47ef2-3de0-47a8-b4cb-28d310f10872-image.png
    The non-monospace font (in black) correctly shows U+266B ♫ as beamed eighth notes. The monospace font (in red) shows that same character as beamed sixteenth notes instead. Whoops.

    No, my browser says it’s using DejaVu Sans Mono for fixed-pitch, and charmap shows that DejaVu Sans Mono has four separate glyphs for those notes.

    80ece08d-4d00-43ba-8b7f-ac1b8571b218-image.png

    And Notepad++, which is set to use the same font as well, shows the correct glyphs for those four characters
    869ae6ca-141c-43f1-bde4-9f9d91a7039e-image.png

    Oh, I bet that the forum stylesheets are overriding my font choices.

    -----
    Edit: Yes, the CSS has its own list of fonts before using what the browser is set at. How rude. 24c7109c-0a36-4420-abd1-a3dd122fd0ab-image.png

    I don’t have Menlo or Monaco, so it would try Consolas, which doesn’t have that glyph, then Courier New, which doesn’t either, then monospace … so it should be trying DejaVu Sans Mono at that point… but doesn’t seem to be. Oh well, browser issue.

  • 4 Votes
    5 Posts
    562 Views
    Dimitri SudomoinD

    @Alan-Kilborn said in (Pythonscript) Status bar to display word count & understanding SCINTILLANOTIFICATION:

    Is this causing some sort of problem for you, or does it merely bother you?

    Mostly the latter, haha.

    In any case, I don’t really notice any impact on performance so I’m going to let it go. Here is my final script that I ended up writing for those that come along and want to see it.

    from re import findall def callback_sci_UPDATEUI(args): SPEECH_SEC_PER_WORD = 0.66 # 0.55 = fast, 0.66 = normal, 0.75 = paused if editor.getTextLength() < 100000 and args['updated']: # don't search "big" files if editor.getSelections() == 1 and not editor.getSelectionEmpty(): # show word count for selection text = editor.getSelText() sel_info = ' (For Selected)' else: # show word count for entire document text = editor.getText() sel_info = '' word_count = len(findall(r'\w+', text)) speech_minutes = (word_count * SPEECH_SEC_PER_WORD / 60) % 60 speech_seconds = (word_count * SPEECH_SEC_PER_WORD) % 60 speaking_time_str = "%02dm%02ds" % (speech_minutes, speech_seconds) sbar_value = 'Words: {} Speaking Time: {}{}'.format(word_count, speaking_time_str, sel_info) notepad.setStatusBar(STATUSBARSECTION.DOCTYPE, sbar_value) editor.callback(callback_sci_UPDATEUI, [SCINTILLANOTIFICATION.UPDATEUI])
  • N++ Tabs Setting

    4
    0 Votes
    4 Posts
    320 Views
    Alan KilbornA

    @lamprey13 said in N++ Tabs Setting:

    please delete

    Only you can remove your postings, but there’s no harm in leaving it.

  • Open Notepad++ via command line with a certain character set

    14
    1 Votes
    14 Posts
    2k Views
    Alan KilbornA

    Earlier I had said:

    IMO, it makes more sense to have your proposed command line work as follows:

    notepad++ yourfile1.ext -charset=“OEM 850” yourfile2.ext -charset=“UTF-8 BOM” yourfile3.ext yourfile4.txt

    While that’s an idyllic command line, logically, it doesn’t really suit how Notepad++ currently works; example:

    notepad++ -multiInst -n15 yourfile1.txt -n10 yourfile2.txt

    While this will open “yourfile1.txt” at line 15, it will NOT open “yourfile2.txt” at line 10.

    But this:

    notepad++ -multiInst -n15 yourfile1.txt yourfile2.txt

    will open both files at line 15.

    So I think it is reasonable to allow only one -charset=... on a command line, that affects all following files; example:

    notepad++ yourfile1.ext -charset="UTF-8 BOM" yourfile3.ext yourfile4.txt <-- contains only ONE charset directive.

    If a second -charset is encountered on the command-line, it would be ignored.

  • 0 Votes
    3 Posts
    795 Views
    PeterJonesP

    @Jimmy-C_1013 ,

    If I am understanding correctly, you have hundreds/thousands of files, each with a particular naming scheme. Inside each of these files, you have the word number at least once, and you want to replace that word with part of the filename (extracted from the filename, based on the scheme you mentioned).

    Notepad++ search-and-replace does not have access to the filename, so it cannot be done natively inside Notepad++.

    However, by a clever combination of command-line and Notepad++ manipulation, you may be able to implement something that will work for you. For example, earlier this year someone asked about just inserting the whole filename into their file(s) overtop of a PLACEHOLDER variable in the discussion here – my reply, and the follow-ons, show one way in which this can be accomplished. Using the same command-line portion, and then tweaking the regex to use number instead of PLACEHOLDER should get you pretty close to what you want.

    Good luck.

    ----

    Useful References Please Read Before Posting Template for Search/Replace Questions Formatting Forum Posts FAQ: Where to find regular expressions (regex) documentation Notepad++ Online User Manual: Searching/Regex
  • accented characters as hex

    3
    0 Votes
    3 Posts
    2k Views
    gerdb42G

    @Zsolt-Tomo,

    your xml file should have an XML-Prolog in the first line which states the encoding to use:
    <?xml version="1.0" encoding="Windows-1252"?>
    If this line is missing, UTF-8 will be assumed since that is the default for XML files. If the prolog is set, the XML-lexer will set the document encoding accordingly.

  • Problem replacing huge number of characters

    2
    0 Votes
    2 Posts
    797 Views
    PeterJonesP

    @José-Federico-Sánchez-Sevilla ,

    Bioinformatic data is often huge files. Above about 200MB, Notepad++ starts having difficulty with large files, because of all the “extra” stuff that Notepad++ is trying to do, like syntax highlighting, and “smart match”, line-wrap, and other similar features.

    At some point, Notepad++ developers put in a hook that above 200MB, it would arbitrarily turn off syntax highlighting, but not the other features, which helped some, but not enough for some users. (Whereas other users hated that their file would syntax-highlight at 190MB but not at 210MB.)

    In the upcoming v8.4.7, there is a new tab on the Settings>Preferences dialog for changing performance settings, including changing whether it’s at 200MB or some other threshold, and the ability to enable or disable other high-performance-drag features so that you can decide how much to use. You might want to grab the release candidate for v8.4.7 and see if those options allow you to improve the performance enough to be usable for you.