• 0 Votes
    5 Posts
    413 Views
    mark LossM

    @Alan-Kilborn said in Can I create a macro that gives the desired file name when creating a new file?:

    @andrecool-68 said in Can I create a macro that gives the desired file name when creating a new file?:

    but the file name will always be “new 1”.

    I don’t think that’s going to always be true. It would depend upon if you already had an existing new 1 file when this macro is run, then I don’t think what the macro will saw will be saved in new 1.
    For this kind of automation it is probably best to go with the scripting plugins (e.g. PythonScript) or presumably NppExec can also achieve it.

    thanks my issue has been fixed.

  • Launching Lua

    6
    0 Votes
    6 Posts
    1k Views
    Alan KilbornA

    @PeterJones said in Launching Lua:

    $(FULL_CURRENT_PATH)

    I never remember this kind of stuff, so…

    I have a Run menu command – saved as NPP $(XXX) vars echo (file info) – that gives me an example when I need it:

    cmd /c echo FULL_CURRENT_PATH=$(FULL_CURRENT_PATH) CURRENT_DIRECTORY=$(CURRENT_DIRECTORY) FILE_NAME=$(FILE_NAME) NAME_PART=$(NAME_PART) EXT_PART=$(EXT_PART) && pause

    Sample output:

    18606e33-597c-498d-bf1c-e0f62d2c08e9-image.png

    After running, I can copy the FULL_CURRENT_PATH – or whatever text – from the cmd window, so not only do I NOT have to remember the names, I never have to type them either.

    Later edit:

    However, I can’t actually echo the verbatim text $(FULL_CURRENT_PATH) to the cmd window, because Notepad++ will hijack that and replace it. This could be “fixed” (see https://github.com/notepad-plus-plus/notepad-plus-plus/issues/9567) but perhaps doubtful that it ever will be.

  • SQL Code Folding

    2
    0 Votes
    2 Posts
    409 Views
    rdipardoR

    Notepad++ does not have built-in support for Microsoft Transact-SQL: https://github.com/notepad-plus-plus/notepad-plus-plus/issues/12610#issuecomment-1340297100

    That may change in a future release, but I would not hold my breath.

  • SurroundSelection sometimes hijacks shortcut Ctrl+Shift+2

    5
    1 Votes
    5 Posts
    308 Views
    rdipardoR

    Norton prevents extracting dll from downloaded zip).

    If anyone visiting this thread is in similar circumstances, AppVeyor artifacts will be online until about MAR-28-2023:

    SurroundSelection (patched) x64 SurroundSelection (patched) Win32
  • Why [A-Z] = [a-z]?

    6
    0 Votes
    6 Posts
    306 Views
    Lycan ThropeL

    @Bahaa-Eddin-ツ ,
    Nah. You’ll hardly even remember it once it sinks to the bottom of the new posting queue. :)

  • How to replace multiple words?

    8
    0 Votes
    8 Posts
    3k Views
    Alan KilbornA

    Find: (Lorem)|(amet)|(elit)
    Replace: (?1human)(?2friend)(?3fruit)

    Really, if you’re going to go “long” with that syntax, you could have a script do it – create the syntax for you. But…if you’re making the scripting leap, maybe it is best to go “all the way”.

  • Replace based on input CSV file

    2
    0 Votes
    2 Posts
    534 Views
    Alan KilbornA

    @Willem-Swanepoel

    You would likely need to use a scripting plugin for such replacement. Maybe search this forum for “replace from list” or something similar.

    For example, THIS appears to be a script that solves a problem similar to your need, although not exactly.

    Sometimes a regular expression replacement operation can do it, by combining your data and your list together in a single file tab, but this method may not be reliable on larger data sets.

  • one corner case where npp doesn't warn about "{file} doesn't exist anymore"

    13
    0 Votes
    13 Posts
    1k Views
    Neil SchipperN

    @Pierre-McGrail I was able to replicate OP’s issue with npp.8.4.9.portable.x64, so the option you mention, while very helpful in many situations, does not eliminate the problem.

  • How to remove duplicates words?

    12
    1 Votes
    12 Posts
    4k Views
    guy038G

    Hello, @alan-kilborn and All,

    I’ve found out an interesting thing about posts which contains a literal [ character in search regexes :

    \\[

    If you must edit one of these posts in order to change any other part, you’ll need to repeat the special modifications, regarding the regexes, by using, again, the syntax :

    \\\[

    BR

    guy038

  • Remove right side white bar in npp 8.4.9

    4
    0 Votes
    4 Posts
    297 Views
    Alan KilbornA

    @Debajyoti-Datta said in Remove right side white bar in npp 8.4.9:

    npp highlighter plugin, which I don’t remember if that came default with npp 8.4.9 first time.

    It did NOT. The only plugins that ship with Notepad++ currently are:

    mimeTools NppConverter NppExport
  • Is there a way to make notepad++ faster ?

    4
    0 Votes
    4 Posts
    1k Views
    Mark OlsonM

    @Mark-Olson
    The find/replace feature has been implemented in HugeFiles. No formal benchmarking, but was able to perform a find/replace operation with over 50,000 changes on a 200MB file in about 3 seconds. Your mileage may vary, and I haven’t yet tested it on anything bigger than that.

  • Line combination

    13
    0 Votes
    13 Posts
    1k Views
    PeterJonesP

    @Mark-Olson ,

    Why not just … ?

    In this specific instance? Because it shares the same problem as \R in this instance: if your real text is "\r\n, then (?<!")(?:\r?\n|\r) will match between the \r and the \n in the file.

    In general? Because in the vast majority of plaintext files, everything it matches is also matched by \R, which is so much easier to type.

  • target links

    2
    0 Votes
    2 Posts
    364 Views
    PeterJonesP

    @Lhuillier-Sébastien ,

    You say you can do the replacement – which means you aren’t asking about the replacement. (unless there’s a language barrier which has caused a mis-translation between you and me)

    And other than having a target attribute in the link example you showed, you haven’t actually asked anything about “target links”, despite that being the title of your question.

    So I’m not sure then what your question is about.

    ----

    Useful References Please Read Before Posting Template for Search/Replace Questions Formatting Forum Posts Notepad++ Online User Manual: Searching/Regex FAQ: Where to find other regular expressions (regex) documentation.
  • Replacing 5-digit numbers in lines that start with specific characters

    2
    0 Votes
    2 Posts
    680 Views
    PeterJonesP

    @FurBlood-Abe ,

    Thank you for the example data, but it would have also been nice to explain what you wanted in words.

    I have interpreted your request as “How do I replace any line like <Y>#####</Y> with <Y>27245</Y>, where ##### can be any 5-digit number?”.

    Answer:

    FIND = <Y>\d{5}</Y> REPLACE = <Y>27245</Y> SEARCH MODE = Regular Expression

    ----

    Useful References Notepad++ Online User Manual: Searching/Regex FAQ: Where to find other regular expressions (regex) documentation
  • Maximum number of windows can be opened in one notepad++

    4
    1 Votes
    4 Posts
    6k Views
    PeterJonesP

    @Dziekan-TEK ,

    You are replying to a thread that’s 7 years old. Claudia hasn’t been here in years (unfortunately so: she was one of the most-helpful users that I’ve ever seen on this site, and her input has been missed since she left).

    If you want to search 3000 files, you don’t have to open them all and “Find All in All Opened Documents”. The “Find in Files” feature will work much better for that: it will search a directory (recursively, if you want), and list all the files that have matches, without having to have them all actually open in Notepad++ at the same time. That seems like the ideal solution. (I don’t remember whether Find in Files existed in 2016 or not.)

  • Help wanted for translate of part text

    4
    0 Votes
    4 Posts
    332 Views
    Alan KilbornA

    @daf-de-sade

    Although it goes “off-topic” for this forum, perhaps having a look at the postings in THIS THREAD would be of assistance to you, especially the ones that are February 2.

  • 0 Votes
    19 Posts
    1k Views
    Alan KilbornA

    @blueicehaller

    Notepad++ provides the “Explorer Plugin” with “Favorites” or “Project” with 3 “Project panels”.

    To be correct:

    the “Explorer Plugin” provides “Favorites” Notepad++ itself provides “Project” with 3 “Project panels”

    When using “Favorites” how can I add a file from [Sessions] to [Files] with drag & drop?

    Explorer doesn’t seem to have “drop target” functionality, so you aren’t going to be able to do this.

    You could make a feature request of the Explorer plugin author for this.

    When using “Project Panel 1” and trying to add open files with drag & drop to a Project the file has not been added.

    Notepad++ itself doesn’t seem to have drop functionality for a project’s / workspace’s files.

    You could make a feature request for this.

    When I have “Favorites” and “Project Panel 1” open and restart Notepad++ “Project Panel 1” is always in focus instead of “Favorites”.

    How can I change that behavior?

    If they are in the same docking panel, which it sounds like they are, then probably the one that is the right-most tab will be the one that N++ actives on its startup?

    Hmm, no I tested that theory and a project panel (Project 1) moved to the far right and became active after the next N++ restart.

    Another theory would be that the Explorer plugin panel tabs (I have 2 active, the “explorer” one and the “favorites” one) would always be adjacent as one would think they would be created as the plugin loads. But no, experimentation for me shows I get, left-to-right, “explorer”, another plugin’s panel tab, and then “favorites” (and then “project 1” as I mentioned).

    Bottom line is I’m not sure how the ordering of tabs in a panel is “restored” from a previous run of N++ when it restarts, except to say that restoration order doesn’t appear to be ideal…

  • 3 Votes
    3 Posts
    4k Views
    Casper AbrahamC

    Tried all kinds of things and eventually it was THIS problem. Great insight into why this happens all of a sudden. Old maybe but still relevant.

  • Delete lines with PythonScript

    3
    0 Votes
    3 Posts
    664 Views
    Brian HigdonB

    @Alan-Kilborn Thank you for getting back to me so quickly.

    Yes, you are correct on my regex string. Adding \R did what I needed it to do.

    editor.rereplace(r’^.: “”.$\R’, ‘’)

    You are not confused; I confusingly wrote my question.

    The issue is solved.
    Thank you.

  • Pinpoint what I did and want to see on a taskbar

    3
    0 Votes
    3 Posts
    295 Views
    Su KimS

    @PeterJones
    Many thanks to your quick answer and I appreciate your comment.