• Configure style for certain file types

    5
    0 Votes
    5 Posts
    518 Views
    jan benheimJ

    @PeterJones said in Configure style for certain file types:

    Historical note: conf was added to the Properties filetype in v8.4.8 (December 2022).

    Then everything is clear. As far as possible, I use portable program versions, as was the case with Notepad++ until six months ago. When I then installed it permanently, nothing was overwritten, but there was simply a program behavior that I was not used to.

  • 8.7 How to set tab width -- NOT indent?

    7
    0 Votes
    7 Posts
    2k Views
    guy038G

    Hello, @frank-peelo, @alan-kilborn, @mkupper, @coises and All,

    Of course, as @alan-kilborn said :

    The notions of “indentation” and “tab” are bound up together. It has always been this way in Notepad++

    However, @frank-peelo, I’d like to show you a way to simulate what you’re trying to achieve !

    Firstly, in Settings > Preferences... > Indentation, set [Default] of the Indent Settings to value 8, select below the Space character(s) option and check the Backspace key unindents instead of removing single space option

    Secondly, create a new macro to type in a tabulation char, anywhere, each time you’ll press the Alt + T shortcut

    <Macro name="Insertion 1 TABULATION" Ctrl="no" Alt="yes" Shift="no" Key="84"> <Action type="1" message="2170" wParam="0" lParam="0" sParam="&#x0009;" /> </Macro> Thirdly, create an other macro to reduce the leading indentation by two, each time you’ll press the Alt + I shortcut <Macro name="Indentation divided by 2" Ctrl="no" Alt="yes" Shift="no" Key="73"> <Action type="3" message="1700" wParam="0" lParam="0" sParam="" /> <Action type="3" message="1601" wParam="0" lParam="0" sParam="^(\x20+)\1" /> <Action type="3" message="1625" wParam="0" lParam="2" sParam="" /> <Action type="3" message="1602" wParam="0" lParam="0" sParam="$1" /> <Action type="3" message="1702" wParam="0" lParam="640" sParam="" /> <Action type="3" message="1701" wParam="0" lParam="1609" sParam="" /> </Macro>

    Now, let’s imagine you’re working on a Python script. Of course, each time you hit the TAB key, eight space characters are inserted

    But, after some non-blank characters, you’ll be able, at any location, to insert a true TAB of eight chars, in current line, using the ALT + T shortcut of the macro.

    #00000000111111111222222222233333333334444444444555555555566666666667777777777 #23456789012345678901234567890123456789012345678901234567890123456789012345678 # This is an example to see how it works # This is an example to see how it works # This is an example to see how it works ... Click on the View > Show Symbol > Show All Characters option to easily see the tabulations

    As you can verify, each Tab character always ends, as expected, at position 8 × k, whatever the value of the integer k

    At any moment, if you want to get the true indentation of your Python script :

    Select ALL the part of text, not already modified

    Press the Alt + I shortcut, once only

    Thus, the above example becomes :

    #00000000111111111222222222233333333334444444444555555555566666666667777777777 #23456789012345678901234567890123456789012345678901234567890123456789012345678 # This is an example to see how it works # This is an example to see how it works # This is an example to see how it works ...

    And, indeed, the leading indentation is, now, always equal to 4 × n, whatever the value of the integer n

    However, the inserted tabulations remain tabs every 8 chars !

    If we suppose that, instead, you’re working on a C-like program. Again, each time you’ll hit the TAB key, eight space characters will be inserted

    But, after some non-blank characters, you’ll be able, at any location, to insert a true TAB of eight chars, in current line, using the ALT + T shortcut of the macro.

    //0000000111111111222222222233333333334444444444555555555566666666667777777777 //3456789012345678901234567890123456789012345678901234567890123456789012345678 // This is an example to see how it works // This is an example to see how it works // This is an example to see how it works ...

    Again, each Tab character always ends, as expected, at position 8 × k, whatever the value of the integer k

    At any moment, if you want to get the true indentation of your C-like program :

    Select ALL the part of text, not already modified

    Press the Alt + I shortcut twice ( So Alt + I, Alt + I )

    Then , the above example becomes :

    //0000000111111111222222222233333333334444444444555555555566666666667777777777 //3456789012345678901234567890123456789012345678901234567890123456789012345678 // This is an example to see how it works // This is an example to see how it works // This is an example to see how it works ...

    And, indeed, the leading indentation is, now, always equal to 2 × n, whatever the value of the integer n

    However, the inserted tabulations remain tabs every 8 chars !

    To summarize, it’s rather a tricky work-around. However, it’s a semi-automatic way to get, at the same time :

    The correct leading indentation for your C-like programs and Python scripts

    The correct insertion of a true TAB character of eight characters size, at any position, after the leading indentation

    That you expect to ! Just experiment ;-))

    Best Regards,

    guy038

  • Duplicate behavior - duplicate whole lines

    18
    0 Votes
    18 Posts
    868 Views
    Alan KilbornA

    @Nicholas

    Yes, but that’s probably not relevant to the OP’s situation.

  • delete all words/lines containing "__" keybind?

    3
    0 Votes
    3 Posts
    185 Views
    Samuel ConnaultS

    @Alan-Kilborn
    tysm it worked!

  • keep color on token style?

    5
    0 Votes
    5 Posts
    174 Views
    Пф БияяєаП

    @Alan-Kilborn got it! this the fastest i always edit my notes also html unlike vsc the color is intact.

  • Go to matching brace, but in new view?

    2
    0 Votes
    2 Posts
    137 Views
    Alan KilbornA

    @Thomas-Zito

    Nope.

  • How to use the "User Defined Language" tool?

    5
    1 Votes
    5 Posts
    717 Views
    Lycan ThropeL

    @James-Burke-0 ,
    Unfortunately, every one of those variants has NON-Standard extensions, so it would be virtually impossible to do a one UDL to rule them all type of thing. The current xBASE, doesn’t work with plain dBASE, although much of it will, but it doesn’t come close to what was needed for dBASE Plus, an OOP version of dBASE, which is why I created that one with a lot of help from the folks around here.

    The language syntax differences would drive you mad, and unless you’re willing to create a lexer to handle them all, based on some criteria like file extensions, stock boilerplate code at the start of files, etc…you’ll be working your tail off to track down all the reference material needed plus writing, editing and fixing the variances that can occur between variants.

    It took me a year to complete the dBASE Plus UDL that, thanks to @PeterJones , is now in the UDL languages repository as he mentions above. You can try and use that or the xBASE version as a start.

    This won’t be a project for the faint of heart, so unless you’re ready to take on that task, I’d stick to only worrying about the variant that you need to work with.

  • Help please: /backup folder is empty

    4
    0 Votes
    4 Posts
    670 Views
    PeterJonesP

    @Drew-S ,

    “almost all the checkboxes are checked” – in the Notepad++ settings, some are mutally exclusive (radioboxes, not checkboxes), so we still cannot know what settings you have. Can you do Alt+PrintScreen in the Preferences > Backup dialog, and in your AutoSave plugin preferences, and paste those two screenshots in your reply

    Now I see that subfolder “backup” is created, but it’s still empty…

    Which means that either you don’t have any unsaved edits yet, or you don’t have session snapshot enabled. Like I said before, if you don’t have any unsaved edits, the backup folder will be empty.

    And you really need to read the FAQ I linked you to.

  • 8.7 unable to save files

    2
    0 Votes
    2 Posts
    146 Views
    PeterJonesP

    @Mikko-Torniainen ,

    I’ve been using v8.7 since it was released, and I’ve never seen that error.

    This sounds somewhat like this issue from August – wherein it turned out the user had AntiVirus SW that turned on a buried Windows setting to “protect” the user. You might want to check the setting that @xomx mentioned in that discussion.

    If that setting was already off for you, and if you know that you don’t have AntiVirus/AntiMalware getting in the way, then try using MS notepad.exe to save a file to a given directory, and then try using Notepad++ to save in the exact same directory.

  • Dozens of open tabs disappeared

    5
    0 Votes
    5 Posts
    669 Views
    Terry RT

    @Stefan-Knecht said in Dozens of open tabs disappeared:

    Perhaps the process is at fault then?

    No, it stems from the fact those backup files will refer to open tabs. No open tabs means no backup files.

    As that FAQ post states, you should do your own backups so that you have “real” files, not rely solely on “temp tab” files for critical data.

    You might wish to provide your Notepad++ setup. Read this FAQ post. That will give us some of that info. Any other information would also be welcome as it helps us get a better idea of the environment you are working in. Info such as, do you run multiple instances, was the backup location a local or network drive, or maybe cloud.

    The more you can provide the better chance the members here might notice the reason for you problem. Whilst this may help you prevent a repeat, the original link I provided contains probably the best chance of you recovering some (or hopefully all) of your missing data.

    Good luck.
    Terry

  • Find dialogbox

    3
    0 Votes
    3 Posts
    135 Views
    PeterJonesP

    @Eli-Khoury said in Find dialogbox:

    How to have the “Find” in the “Status bar”?

    Are you talking about Incremental Search, like in the following screenshot?

    bfea5405-6c6f-4304-a243-2cb55921399d-image.png

    Search > Incremental Search (default key binding = Ctrl+Alt+I) will show that extra search tool near the Status Bar. It’s not the full-featured Find dialog (because that obviously wouldn’t fit), but it provides normal (non-regex) searching

  • Regex Generation Program

    3
    0 Votes
    3 Posts
    190 Views
    RonR

    @PeterJones Thank you! That one did work (I thought I had tried it before I posted and it didn’t work.). But it worked when I tried it again!

  • Delete a numbered line..

    8
    0 Votes
    8 Posts
    267 Views
    Alan KilbornA

    @PeterJones said in Delete a numbered line..:

    I was going from memory, on my phone, just before bed.

    Bad plan. :-)

  • Save All and Save event support

    3
    0 Votes
    3 Posts
    196 Views
    Alan KilbornA

    The OP described his use case for the need he expressed here, on the github site. Although I wasn’t able to give him resolution on the question he asked here, I did come up with a sample script that might meet his need for solving his use case. Interested readers are directed to the github site, via the link in my previous posting.

  • 0 Votes
    11 Posts
    2k Views
    Alan KilbornA

    The problem has been solved and the fix will be in the upcoming 8.7.1 release. Details are HERE.

  • Same problem with Npp 8.7, no colors copied with Nppexport anymore

    5
    0 Votes
    5 Posts
    679 Views
    Ben SacheriB

    @PeterJones

    Thank you for making this post. I’ve been disappointed that I can’t paste with formatting into Outlook as I used to. After reading your description, I see that Outlook supports the same feature as Word does, so Paste “Keep Source Formatting” works perfectly.

    Note that in Outlook, you can press ALT, H, V, K to paste with formatting without using the mouse.

    -Ben

  • Replace bookmarked lines from one file to bookmarked lines in another file.

    18
    0 Votes
    18 Posts
    2k Views
    guy038G

    Hi, @larlei, @terry-R and All,

    However, @larlei, given the same INPUT text :

    01 01 <name>NAME-1</name> 02 <name>NAME 1</name> 03 10 <name>NAME-2</name> 04 <name>NAME 2</name> 05 19 <name>NAME-3</name> 06 <name>NAME 3</name>

    Then, the modified search regex of @terry-r, below, with an question mark, after the group 2 ([^<]+) :

    SEARCH (?-s)^\d+\h(\d+\h)([^<]+)?.+\R[^<]+(.+\R)

    REPLACE \1\2\3

    Does match and, after replacement, you get the expected OUTPUT text :

    01 <name>NAME 1</name> 10 <name>NAME 2</name> 19 <name>NAME 3</name>

    Let’s go back to the wrong syntax of the regex S/R, without the question mark. Why this regex does not find any match ? Well …

    From beginning of line, it searches for some digits, followed with one horizontal space character, and this twice ( the part ^\d+\h(\d+\h) )

    At this point, it tries to find some characters, all different from an opening tag delimiter <. But this case is impossible as an opening tag delimiter < follows, right before name>. So the overall search regex fails !

    Now, adding the exclamation mark, after the group 2, means that all the group contents are not mandatory. Thus, it can be ignored and the following part .+\R does match the remaining of the first line, including its like-break ( \R ) !

    And, indeed, I verified that, against our INPUT text, the optional group 2 ([^<]+)? is always EMPTY !

    In other words, you can simplify your regex S/R to this syntax :

    SEARCH (?-s)^\d+\h(\d+\h).+\R\d+\h(.+\R)

    REPLACE \1\2

    So, from the INPUT below :

    01 01 <name>NAME-1</name> 02 <name>NAME 1</name> 03 10 <name>NAME-2</name> 04 <name>NAME 2</name> 05 19 <name>NAME-3</name> 06 <name>NAME 3</name>

    With this new S/R , you would get the same OUTPUT as above, i.e :

    01 <name>NAME 1</name> 10 <name>NAME 2</name> 19 <name>NAME 3</name>

    BR

    guy038

  • Search with content exclusion

    19
    0 Votes
    19 Posts
    3k Views
    BeatBullzB

    @guy038 Haha, well this was really a bit unusual.
    Big big thanks for the help, it was exactly what i needed!
    Best wishes!

  • Pregunta de novato

    2
    0 Votes
    2 Posts
    129 Views
    Alan KilbornA

    @Diego-Vico

    Wouldn’t you just uncheckmark this checkbox?:

    5d2292a2-0b19-4aec-9444-b1a220e7f4f0-image.png

  • Notepad++Search and Replace Bat Operation ?

    3
    0 Votes
    3 Posts
    186 Views
    CoisesC

    @Daniel-Rafflenbeul said in Notepad++Search and Replace Bat Operation ?:

    is it possible to run Notepad++ in a batch to search and replace Strings ?!

    No. A good choice for that is sed from the GnuWin32 project (which is a Windows port of many of the command line GNU Linux tools).