• Automatically selecting files with searched word in it

    4
    0 Votes
    4 Posts
    566 Views
    Alan KilbornA

    @Lorenzo-Carrisi

    Good that you got something you could use from that!

    Actually, this is probably a good opportunity to show off macros in Notepad++.

    First, do some (one-time) setup:

    Press the toolbar button for starting macro recording In an editing tab view, press an arrow key to move the caret (this is just a dummy action) Press the toolbar button for stopping macro recording Press the toolbar button for saving a recorded macro; give it the name Bat file from Find results and save it Exit Notepad++ Restart Notepad++ Locate your shortcuts.xml file and open it in Notepad++ Do a find on Bat file from Find results and you should be left looking at something like this: <Macro name="Bat file from Find results" Ctrl="no" Alt="no" Shift="no" Key="0"> <Action type="0" message="2306" wParam="0" lParam="0" sParam="" /> </Macro> Replace the Action line with the following block, making the indent level of the block match that of the old Action line: <Action type="3" message="1700" wParam="0" lParam="0" sParam="" /> <Action type="3" message="1601" wParam="0" lParam="0" sParam="(?-s)^Search.+\R" /> <Action type="3" message="1625" wParam="0" lParam="2" sParam="" /> <Action type="3" message="1602" wParam="0" lParam="0" sParam="" /> <Action type="3" message="1702" wParam="0" lParam="770" sParam="" /> <Action type="3" message="1701" wParam="0" lParam="1609" sParam="" /> <Action type="3" message="1700" wParam="0" lParam="0" sParam="" /> <Action type="3" message="1601" wParam="0" lParam="0" sParam="(?-s)^\tLine.+\R" /> <Action type="3" message="1625" wParam="0" lParam="2" sParam="" /> <Action type="3" message="1602" wParam="0" lParam="0" sParam="" /> <Action type="3" message="1702" wParam="0" lParam="770" sParam="" /> <Action type="3" message="1701" wParam="0" lParam="1609" sParam="" /> <Action type="3" message="1700" wParam="0" lParam="0" sParam="" /> <Action type="3" message="1601" wParam="0" lParam="0" sParam="\s\(\d+\shits?\)$" /> <Action type="3" message="1625" wParam="0" lParam="2" sParam="" /> <Action type="3" message="1602" wParam="0" lParam="0" sParam='&quot; .' /> <Action type="3" message="1702" wParam="0" lParam="770" sParam="" /> <Action type="3" message="1701" wParam="0" lParam="1609" sParam="" /> <Action type="3" message="1700" wParam="0" lParam="0" sParam="" /> <Action type="3" message="1601" wParam="0" lParam="0" sParam="^\s+" /> <Action type="3" message="1625" wParam="0" lParam="2" sParam="" /> <Action type="3" message="1602" wParam="0" lParam="0" sParam='copy &quot;' /> <Action type="3" message="1702" wParam="0" lParam="770" sParam="" /> <Action type="3" message="1701" wParam="0" lParam="1609" sParam="" /> Save the shortcuts.xml file Exit Notepad++ Restart Notepad++

    That’s the end of the one-time setup. That will remain until you delete the macro created.

    To use it, each time you need to:

    Run a Find-in-Files search that results in several hit files Copy and paste the Find-result panel results (per the earlier instructions on how to do that) into an empty Notepad++ tab (an empty file called test.bat might be appropriate!) Go to the Macro menu and choose Bat file from Find results from near the bottom; you should observe your file of search results has changed into a bunch of copy batch file commands (this step “runs” the macro consisting of several replacement operations!) Save the file Continue from the earlier instructions at step get a cmd prompt in the directory containing...
  • How to enable this function? thanks!

    10
    0 Votes
    10 Posts
    1k Views
    Alan KilbornA

    For the record, I use Imgur through the account I’ve set up there. Perhaps the differences are now explained. Good to know, if these type of inconsistencies come up again here.

  • execute firefox

    9
    0 Votes
    9 Posts
    2k Views
    Kailin RainyK

    @Ekopalypse
    Thank you for answering, I found a better way. But really thank you!!

  • Is there something preview the result from HTML IN the program?

    3
    1 Votes
    3 Posts
    349 Views
    Kailin RainyK

    Thank you!

  • Creating a new coloring matching character

    15
    1 Votes
    15 Posts
    2k Views
    EkopalypseE

    @BigMat-Lecircuit

    there was a decision made long time ago that the angled bracket matching isn’t part of the builtin matching function
    as too much languages do use angled brackets as operators, which then would falsely color those operators.

    At the moment I do see two options for you.

    Open a feature request at github and define exactly how you want it to behave and for which languages (which itself shouldn’t use angled brackets as operators in their syntax) or Use one of the plugin scripting languages and make it as a feature for you.
  • 0 Votes
    8 Posts
    1k Views
    Vasile CarausV

    I have an alternativ answer, but must be improved:

    FIND: (^.*)(.+?\.)(.+?\.)(.+?\.)

    REPLACE BY: $3 $1 $4 $2

  • 1 Votes
    4 Posts
    519 Views
    Vasile CarausV

    Great answer, @PeterJones thanks a lot !

  • как убрать reload - how to disable reload popup

    2
    0 Votes
    2 Posts
    450 Views
    Alan KilbornA

    @Tair-Tairoff

    Adjust the setup to your liking at Settings (menu) > Preferences > MISC. > File Status Auto-Detection

  • Custom static function with parameter hints.

    3
    0 Votes
    3 Posts
    553 Views
    Martijn WieringaM

    @PeterJones

    I thought it had something to do with ::
    Based on your info, i now use this workaround:

    <KeyWord name=“myStaticFunction” func=“yes”>
    <Overload retVal=“myClass | string”>
    <Param name=“string sValue”/>
    <Param name=“bool bSort”/>
    </Overload>
    <Overload retVal=“myClass2 | string”>
    <Param name=“string sValue”/>
    <Param name=“bool bSort”/>
    </Overload>
    <Overload retVal=“myClass3 | array”>
    <Param name=“string sValue”/>
    <Param name=“bool bSort”/>
    </Overload>
    </KeyWord>

    I’ve added "myClassName | " before each return value so i can easily find the parameter list i need for given class…
    it’s not as perfect as it could/should be, but it will work for now. Hopefully they’ll make a fix in the future ;)

    Thanks for your help!

  • Пропало отображение тегов.

    2
    0 Votes
    2 Posts
    509 Views
    EkopalypseE

    @Aleksey-Sherbakov

    sorry, but I do not really understand your problem.
    Is it about highlighting your code? Or is it about the end result, your webpage?
    In both cases, can you explain in more detail what you see and what you expect to see?

  • OneDrive files getting "New version available" message

    2
    0 Votes
    2 Posts
    455 Views
    EkopalypseE

    @Darrel-Zeltner

    I assume you want to have automatic file changes disabled, correct?
    If so, goto settings->preferences->misc and disable file status auto-detection

  • Tab key enters spaces instead of tab

    11
    0 Votes
    11 Posts
    2k Views
    PeterJonesP

    @andrecool-68 said:

    And why stopped the release of Npp Help.chm?

    I don’t know. That stopped being supported before I was involved with the documentation team. Probably it boils down to “maintaining one set of documentation is hard enough; maintaining multiple sets is a nightmare” – though that’s just my guess.

    Personally, I’m just glad that we’ve been given permission to help maintain the one set, so that way there will be something. It will take a while to get the full documentation set, and it might not be perfect – but it’s much better than the one that was hopelessly out-of-date and not able to be edited.

  • Splitting file by search creteria

    3
    1 Votes
    3 Posts
    464 Views
    Albert SchneiderA

    @Ekopalypse:

    Thank you very much, it works pretty fine!

  • Find in Files does not find nor display Umlauts

    7
    0 Votes
    7 Posts
    1k Views
    EkopalypseE

    @ungesundes-halbwissen

    from my short test it looks like it is working for utf8 encoded but not for “ansi”
    encoded files if those files haven’t been loaded into the current session.

  • Search and Replace with Regex

    8
    0 Votes
    8 Posts
    21k Views
    guy038G

    Hello, @jens-ubert, @ekopalypse, @alan-kilborn, @peterjones, and All,

    Jens, welcome to the N++ community !

    Seemingly, I understand that your goal is to obtain the B) syntax, leaving the C) and D syntaxes untouched. In other words, you just would like that any A) syntax be replaced with the B syntax, wouldn’t you ?

    Thus, we have to grab any A syntax, specifically, and change it into the B one

    Comparing all syntaxes, it comes that only the A syntax does not contain any single quote character, ' nor the $ symbol, between square brackets. We can add the rule that the variable name, before the square brackets does not contain any single quote, too !

    On the other hand, the part before square brackets does not change, when moving from the A to the B syntax. So, we just need to store the text, between square brackets, and surround it with single quotes, during replacement !

    So, a possible regex would be :

    SEARCH \s\$[^'\r\n]+\[\K([^'$\r\n]+)(?=\])

    REPLACE '\1'

    Notes :

    The beginning of the regex \s searches for the general kind of space character ( the Space or Tabulation chars, the \n or \r line break chars and some others… )

    Then the part \$ looks for the literal regex symbol $

    Now, the syntax [^'\r\n]+\[ searches the greatest non-null range of consecutive characters, different from a single quote and line-breaks chars, followed by a literal opening square bracket

    The special syntax \K cancels any match and resets the regex engine working position

    Thus, the part ([^'$\r\n]+) tries, now, to match the greatest non-null range of consecutive characters, either different from a single quote, a dollar and line-breaks chars, stored as group 1, due to the outer parentheses

    But ONLY IF  the look-ahead (?=\]) is true, i.e. if this range is followed with an ending literal square bracket !

    Finally, in replacement, the \1 syntax represents all group 1 contents, surrounded with single quotes

    Best Regards,

    guy038

  • 0 Votes
    8 Posts
    1k Views
    mvancleave99M

    @Ekopalypse

    No worries! People (especially newbies) never post their actual question. Instead they post what they think their question is, so your original answer was quite reasonable. :-)

    Yeah. I think I’ll live with what is a minor anomaly for me. The scripting solution will be above my head … ;-)

  • NPP+ keyboard & Mouse shortcuts line no longer works

    9
  • Notepad++/Visual Studio 2019/Python

    6
    0 Votes
    6 Posts
    927 Views
    Michael VincentM

    @Alan-Kilborn said:

    Michael left wrapping double quotes out of that, even though the OP had them there in 2 places

    purely an oversight - thanks. Corrected below:

    <Command name="Run Python" Ctrl="no" Alt="no" Shift="no" Key="0">"C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python37_64\python" "$(FULL_CURRENT_PATH)"</Command>
  • How to start?

    14
    0 Votes
    14 Posts
    2k Views
    guy038G

    Hi, @alan-kilborn,

    Just congratulate your great aunt to be such a modern person !! To be honest, I’m pretty sure I’ll be uncomfortable with most of new objects of that time, that is…, in 23 years ;-))

    BR

    guy038

  • How do I see the full line in Find results window?

    4
    1 Votes
    4 Posts
    3k Views
    Alan KilbornA

    Oh, and BTW before anyone asks, since the Find-result panel is just another Scintilla window, I turned on visible whitespace and line wrapping for it, to aid in showing the above analysis.