• How to enable syntax highlighting for *.ps1 Powershell script files?

    4
    0 Votes
    4 Posts
    189 Views
    PeterJonesP

    @Claudia-Svenson said in How to enable syntax highlighting for *.ps1 Powershell script files?:

    How can I enable syntax highlighting for *.ps1 Powershell script files?

    Which Theme are you using? It’s possible that your theme file is out-of-date, or that you are a using a theme that has never had the powershell highlighting added, which would prevent Notepad++ from syntax highlighting, even when it is named blah.ps1.

    Please see my post here explaining why; and the User Manual’s Themes: Keeping Stylers/Themes Up-to-date entry for more.

  • It changes the encoding every time I open it.txt file

    4
    0 Votes
    4 Posts
    123 Views
    Alan KilbornA

    @xomx

    The problem with uncheckmarking Auto detect character encoding is that most times you want Notepad++ to autodetect the encoding.
    It’s only when it does it wrongly that you don’t want it to. :-)

  • Stop window size from saving to the cloud

    29
    0 Votes
    29 Posts
    716 Views
    Lycan ThropeL

    @Lycan-Thrope ,
    In hindsight, and after re-reading the issue, it seems that other than the app change removing the AppPosition from the config.xml file(unlikely?), @Alan-Kilborn 's suggestion would be the best for using his GoogleDrive Cloud setup with just one config.xml for multiple machines. He has already rebuffed that, so unless he reconsiders, I guess we’ll have to wait and see if his feature request gets approved and implemented. Moving on.

  • [formatting] Autocomplete, auto indent, insert custom snippets

    4
    0 Votes
    4 Posts
    104 Views
    Alan KilbornA

    @Mark-Olson said:

    the core developers of Notepad++ prefer Microsoft Visual Studio to Notepad++ for working on the Notepad++ source code. Make of that what you will.

    That’s probably because an IDE is wanted for this work, and, as you say, Notepad++ is not the greatest IDE.

    and most major programming languages (like the C or C++ it appears you are writing) have better productivity tools elsewhere.

    Well, I for one have done pretty well with only Notepad++ for embedded C/C++ work, as well as Python work.

  • Run multiple search and replace - one after another

    5
    0 Votes
    5 Posts
    121 Views
    Mark OlsonM

    @Ramses505 said in Run multiple search and replace - one after another:

    Out of interest - can I run some sort of python script that would do this as well ?

    Yes. If you already know Python, the PythonScript plugin can let you automate Notepad++ with Python.

    If you don’t know Python, this forum is not the place to discuss how to learn Python. There are countless tutorials on the internet for that purpose. I’ll just mention the re library and leave it at that.

  • Unable to see Data in the Notepad++

    26
    0 Votes
    26 Posts
    2k Views
    PeterJonesP

    @mathlete2 said in Unable to see Data in the Notepad++:

    FWIW, the Delete part was misleading; the actual instructions say to rename the config file, which backs it up.

    You are right, they gave conflicting instructions, saying to “delete/reset” the config file, but then “actually” only saying to rename it. But in general, their advice was bad – and elsewhere, in posts that another moderater had already deleted, that person spammed with links to their own website, which I confirmed had nothing to do with Notepad++, despite claims in the spam posts that going to their website would help solve a N++ problem. They were a spammer, probably assisted with generative AI posts, both of which are forbidden here and grounds for immediate banning.

  • Running external app on window content?

    3
    0 Votes
    3 Posts
    205 Views
    PeterJonesP

    Ah, right. I’ve written so many FAQ for the Community, I forgot FAQ: How do I … Convert my Text exists. That might explain things better, since it had more time put into writing it.

  • RegEx Help with Backreference I think

    58
    0 Votes
    58 Posts
    2k Views
    Robert Or Janet DiebelR

    @guy038 Sorry, that does work. I somehow slipped in a space before the RegEx in the MACRO

  • Notepad++ blank all the time, even with existing files

    4
    0 Votes
    4 Posts
    143 Views
    Alfonso MuñozA

    @PeterJones Thanks a lot for your reply. It was that setting. I have the latest Npp version and it is a checkbox for me. I disabled the DirectWrite, restarted and characters are again visible.
    I don’t recall changing that setting in the past, and I don’t think I have installed any extension recently, so I don’t know how this could have happened.
    It could be that the setting was like that already but something in windows changed. I don’t know. But once again many thanks!

  • Running a macro on all the open docs ?.

    51
    0 Votes
    51 Posts
    1k Views
    Robert Or Janet DiebelR

    @Alan-Kilborn Thank you Alan.

  • Npp v8.7.8 or later hangs for `^.{0,20}` at the end of a file

    5
    1 Votes
    5 Posts
    127 Views
    mpheathM

    @Coises said in Npp v8.7.8 or later hangs for `^.{0,20}` at the end of a file:

    Leading comma within curly braces is not a valid syntax, so it’s searching for the beginning of a line followed by any one character and then the literal characters {,20}.

    Python’s re allows that syntax of omitting the minimum repetition. To use {,20} instead of {0,20} would be like learning a bad habit compared to Boost or other regex libraries.

    https://www.pcre.org/original/doc/html/pcrepattern.html quote:

    An opening curly bracket that appears in a position where a quantifier is not allowed, or one that does not match the syntax of a quantifier, is taken as a literal character. For example, {,6} is not a quantifier, but a literal string of four characters.

    This is stated explicitly that {,6} is a “literal string”.

  • 0 Votes
    6 Posts
    91 Views
    David HimmelsteinD

    @PeterJones That fixed the issue. Thank you for your help!

  • Line operation that deletes first word on each line

    2
    0 Votes
    2 Posts
    48 Views
    Alan KilbornA

    @Sam-J said in Line operation that deletes first word on each line:

    Is this functionality still available?

    Not exactly.

    But you can do a regular expression replacement:

    Find: (?-s)^\w+ +(.*)
    Replace: ${1}

  • New Laptop, old one crashed

    2
    0 Votes
    2 Posts
    52 Views
    PeterJonesP

    @anna-cluckers ,

    Notepad++ itself doesn’t have a way to grab a file off of the old laptop.

    If you had an external backup of the file, you could copy it from the backup to your new laptop, but it’s doubtful that you’d be asking for our help if you had a backup.

    If you had saved your file in a OneDrive or Dropbox or similar cloud folder, then you would be able to download the file to your new laptop from that web service; but, once again, you wouldn’t be asking us for help if it were that easy.

    Depending on how bad the “crash” was on the old laptop, the things I can think of:

    if you can boot the old, then you should be able to copy the file onto a thumb drive and put it on the new laptop the the old laptop cannot boot, maybe you have a tech-savvy friend who can help you take the drive out of the old laptop, and see if you can get it to be read as a second drive in your new laptop, so that you can copy the file across if the old laptop’s drive is not readable, there’s not much that can be done. (A paid data recovery service might be able to help, but that’s a long-shot.)

    But none of these answers has anything to do with Notepad++. Unfortunately, Notepad++ itself cannot help you with recovering the file from another machine, and this Notepad++ Community forum is focused on Notepad++ itself, so if you need more help with recovering a file from your old laptop, you’ll have to go to some “file recovery” forum or something similar, because recovering files from one crashed computer to put onto another computer is not our area of expertise, and is off-topic for Notepad++ discussions.

    Sorry.

  • Advanced replace including right trim

    Locked
    8
    0 Votes
    8 Posts
    117 Views
    PeterJonesP

    @Mike-Albers deleted the first post, and started a new conversation Topic here.

    In the future, please do not delete posts that have replies. And if you want to clarify, provide more details, etc, you can just do that in a reply, so that the conversation keeps the original context.

    To preserve the history of this discussion, the first post has been un-deleted. But since the conversation has moved forward in the new Topic, this old version has been locked.

  • Unable to use Replace in files

    22
    0 Votes
    22 Posts
    390 Views
    guy038G

    @dr-ramaanand,

    Take the time to read my last e-mail to you, where I explained the differences between two simple regexes containing, each, the (*SKIP)(*F) syntax !

    BR

    guy038

  • User defined language not colour keywods and numbers

    3
    1 Votes
    3 Posts
    56 Views
    waroftitans remoteW

    @PeterJones
    Thanks for your reply.
    Adding the comma to the operators solved the problem.

    Thank you.

  • Is there a jump to next inner block, or jump out of block command?

    3
    0 Votes
    3 Posts
    90 Views
    notdodgeballN

    If your “blocks” are separated by a line break, you can use the commands:

    SCI_PARADOWN Ctrl+] SCI_PARAUP Ctrl+[

    as they navigate between paragraphs.

  • Removing  from multiple files

    2
    0 Votes
    2 Posts
    57 Views
    PeterJonesP

    @Nicholas-Crabtree ,

    I can only see them in HEX mode

    Since you can only see them in HEX mode, that means Notepad++ is doing the right thing, and you don’t fully comprehend the meaning of what you are seeing in the HEX. Let me explain:

    You don’t have the character Â, that’s just the first byte in a two-byte representation for certain characters. You have a properly-formed UTF-8 document, which when Notepad++ is reading it natively as text, it will interpret those two adjacent bytes as a single character – hence, in the text mode, Notepad++ is just showing the single character that it correctly interpreted those two bytes as.

    For the UTF-8 encoding, the Unicode codepoints U+0080 - U+00BF are represented by the byte pairs 0xC2 0x80 through 0xC2 0xBF. You’ll notice that the second byte in the two-byte sequence is the same byte as the Unicode codepoint of the actual character. Thus, if you look at any character U+0080 - U+00BF in a HEX editor, where it’s showing you the hex of the bytes, and then interpreting those bytes as ANSI characters in the panel on the right, you will see  followed by the character you hoped would be there.

    For example, the center character ¢ is U+00A2, which is represented in UTF-8 bytes as 0xC2 0xA2; when a HEX editor puts the ANSI representations to the right, it will show those two bytes as ¢, thus tricking you into thinking there is an extra character there. There isn’t. There is one character represented by two bytes.

    (You actually have the oppsoite problem of a lot of people: a lot of people have malformed UTF-8 documents which Notepad++ mis-interprets as using an ANSI codepage, and so normal Notepad++ shows the two bytes of that single UTF-8 character as ¢. Yours is actually properly formed, so Notepad++ correctly interprets those two bytes together as representing ¢, so properly only shows the ¢ character. So congratulations on having a good file.)

    If you were to somehow trick Notepad++ into deleting those  bytes, then you could maybe delete those bytes, but then Notepad++, and any other application that believes it is trying to read a UTF-8 file, would see the lone 0x80 - 0xBF bytes as malformed, broken UTF-8, and they would complain to you about bad file encoding or improper UTF-8 or similar. If I helped you do this, I would be helping you to break your UTF-8 encoding.

    That said, if you are trying to convert a UTF-8 encoded file into a 256-codepoint ANSI character-set encoding, then you can do that on each fiile inside Notpead++: after loading the UTF-8 file (and seeing it say UTF-8 in the lower-right of the Notepad++ status bar), you could go to Encoding > Convert to ANSI to get Notepad++ to convert from UTF-8 to ANSI… and as long as all the non-ASCII Unicode characters in your UTF-8 file were also found in your default ANSI codepage (Windows 1252 is usually the default in US installations of Windows), the file would look the same, and once you save it, and look at it in any HEX editor, the HEX editor will only show one-byte-per-character, because that’s all that ANSI character sets use; however, any Unicode characters in your original file that aren’t in the active codepage will be converted irreversably into ?, so be forwarned that it’s an incredibly bad idea to do that conversion without a good understand of what characters are in your file and what characters are in your default codepage.

    But the best advice: just leave the UTF-8 file as it is, because that’s a good, international, modern standard for text interchange, whereas the 256 character sets of the various ANSI codepages were a tolerable workaround in the 80s, but completely insufficient in the 2020s, and no modern tool should be forcing you into codepages instead of allowing UTF-8 encodings.

  • The program forgets settings. Inconvenient view defaults

    11
    0 Votes
    11 Posts
    482 Views
    Lycan ThropeL

    @Taras-Tkachenko ,
    @PeterJones has been trying to help you, but you don’t seem to be able to be helped.

    I downloaded version 8.5 32 bit:

    Notepad++ v8.5 (32-bit) Build time : Mar 6 2023 - 02:15:26 Path : C:\Users\<username>\Documents\Development Tools Downloads\Notepad++ Versions\npp.8.5.portable\notepad++.exe Command Line : Admin mode : OFF Local Conf mode : ON Cloud Config : OFF OS Name : Windows 10 Home (64-bit) OS Version : 22H2 OS Build : 19045.5608 Current ANSI codepage : 1252 Plugins : mimeTools (2.9) NppConverter (4.5) NppExport (0.4)

    And made my default file choice to be the D language, made a file, saved it. Created new, saved it, and in that directory was the other D file that I had just created. I shut down the application, came back, started a new document, saved it, and it too, defaulted to the same directory that my previous opened file was pointing to, and when I saved the newly created document, it too had the default extension of .d and the other .d files and only the other .d files were present in the dialog box.

    I think you’re trolling, or lying. There is no forgetting. the file extension set from the Settings->Preferences...->New Document->Default language: dialog box selection area.

    NPP85PrefDialog.PNG

    From what I can see, you are not using the application properly, or not as you described. So unless you can take the time to properly describe EXACTLY what you are doing I don’t think @PeterJones or anyone else on here should bother giving you anymore suggestions until you stop with the vague decscriptions of your problem or the snide comments about a contributing forum member regardless of how you percieve their influence.

    I tried doing the things you say, and unless you are Using the Open Files Dialog box like below, then yes, you will have the *.* file listing:

    NPP85OpenDialogFilesList.PNG

    And any file in there will be shown. If your directory only has the files you described in your use case, then those files will be there, only.

    If you instead use the Save As Dialog, then the only thing you will see with the default file extension .d will be shown as this shows below:

    NPP85SaveAsDialog.PNG

    As you can see, only the files that you have saved with the same file extension will be in there. From my view, I’ve just done everything you said you couldn’t do. So which is it? Trolling, lying or is it just being purposely dense?

    If someone offers you a way to do what you want, regardless of the way it is done, and seems like it’s too much trouble, then just say thank you for the effort, but it seems to difficult to do, or you’re too lazy to do it (I say that all the time about myself), but you’ll make a suggestion the proper way to the developers…and then move on. No need for the entitled attitude.