• Regex replacement of text within regex find

    3
    0 Votes
    3 Posts
    273 Views
    guy038G

    Hello @nick-minchin, @alan-kilborn and All,

    Here is the road map for this S/R :

    Open your file in Notepad++

    Go to the very beginning of this file ( Ctrl + Home )

    Open the Replace dialog ( Ctrl + H )

    SEARCH (?x-si) ( ^ \h* "formatter":\x20+"function | (?!\A) \G ) .*? \K " (?!$)

    REPLACE '

    Un-tick all options

    Select the Regular expression search mode

    Click on the Replace All button ( Do not use the Replace button !)

    Voila !

    This S/R will replace any non-trailing double quote ", only after the string "formatter": "function, with a simple quote ', in all the lines of your file

    Best Regards

    guy038

  • NppEventExec to github

    2
    0 Votes
    2 Posts
    236 Views
    PeterJonesP

    @millu-jorge ,

    That plugin is new to me. But it seems to hook NPPN_* events and run NppExec scripts.

    So, you would need to make an NppExec Script that will commit your project to GitHub – probably something that did a commit to your local repo, and a push to the GitHub repo. And then you could then hook the NPPN_FILESAVED event to call that NppExec script.

    To do anything beyond that would require you to write the scripts that do the git/github actions you desire, and then figuring out which NPPN_* event best matches when you’d want that to.

    You can look my NppExec + SVN examples below, and base your git scripts on those. However, I highly suggest investigating the Better Idea first:

    Better Idea

    I would recommend looking at the GitSCM plugin instead: that probably has all the functions you would want/need, without having to figure out a script for each of them, or hassle with hooking them to the right events.

    NppExec + SVN examples

    Personally, for my subversion-based version control, I have four NppExec scripts, which commit the current dir, commit the current file, add the current dir, and update the current dir. And I just entries in my contextMenu.xml (Settings > Edit Popup ContextMenu) that call those scripts, so I do it manually rather than on triggers. But even knowing that they can be done on triggers, I doubt I would do them, since not all my files are in subversion control, so I don’t want it trying to run the “commit” script every time I save a file that isn’t in subversion.

    if you want to use my svn scripts as templates for the same concepts that you would use for git, I will include them below. However, you will not want to do the NPP_SAVE command in each if you are going to be triggering off of the NPPN_FILESAVED event, because that will cause an infinite loop

    ::Svn-Commit-Dir NPP_SAVE cd "$(CURRENT_DIRECTORY)" INPUTBOX "SVN commit $(CURRENT_DIRECTORY)" : "Message: " : cmd /c svn commit -m "$(INPUT)" cmd /c svn update ::Svn-Commit-File NPP_SAVE cd "$(CURRENT_DIRECTORY)" INPUTBOX "SVN commit $(FILE_NAME)" : "Message: " : cmd /c svn commit "$(FILE_NAME)" -m "$(INPUT)" cmd /c svn update "$(FILE_NAME)" ::Svn-Add-File NPP_SAVE cd "$(CURRENT_DIRECTORY)" cmd /c svn add "$(FILE_NAME)" ::Svn-Update cd "$(CURRENT_DIRECTORY)" cmd /c svn update .

    (and no, I will not rewrite those to work for git/github for you. the concepts you need are all there, and translating those concepts to git will help you learn the tool.)

  • Can't find INI file

    4
    0 Votes
    4 Posts
    2k Views
    Larry SchwartzL

    @Larry-Schwartz
    My apologies for the confusion. I want to modify the configuration file that controls what file attributes are shown when EVERYTHING displays its file list. I use NPP as my text editor. I should be asking this question in the EVERYTHING forum. Again, my apologies for taking your time.

  • XML File - Create an element and get a value from existing attribute

    10
    0 Votes
    10 Posts
    2k Views
    Alan KilbornA

    @Software-Support said in XML File - Create an element and get a value from existing attribute:

    The value 2.92 will be appeared as 2

    Well, for exactly that situation, you’d want to change the \d+ appearing in the original Find expression to \d+\.\d+, I guess…

    But this gets into a bigger topic of how to match floating point numbers as well as integers.

    And that really isn’t a Notepad++ topic, so patience with such questions wears thin. Suggest you follow the link I provided before about regular expressions.

  • PIC did not displayed

    2
    0 Votes
    2 Posts
    370 Views
  • Notepad for tablets

    2
  • Python Script toolbar button moves after execution

    5
    0 Votes
    5 Posts
    545 Views
    deleeleeD

    @PeterJones said in Python Script toolbar button moves after execution:

    So I don’t know what it might be.

    Ok, thanks anyway Peter. Always appreciate your input. Hopefully someone will know what’s causing it.

  • File encoding detection issue

    3
    0 Votes
    3 Posts
    2k Views
    Alan KilbornA

    @Артём

    Keep an eye on this THREAD. Hopefully I am soon finishing up the script I’ve worked on to “solve” that very similar issue.

  • Set line width from pull down menu

    5
    0 Votes
    5 Posts
    1k Views
    Tom OsbeckT

    Think I’m finally getting there. Thank you Peter and, for now, over and out.

  • Run -> Send via Outlook not working

    3
    0 Votes
    3 Posts
    1k Views
    PeterJonesP

    @Marek-Šanoba ,

    How old is your shortcuts.xml ? The Send Via Outlook was commented out in v7.6.3 in 2019, and those comments were removed completely in v7.9.3 .

    That said, you are allowed to have whatever commands you want in your run menu, so you are allowed to keep the ancient outlook /a "$(FULL_CURRENT_PATH)" command if you want it. However, as with any program run from the command line, if it’s not in your PATH, you need to provide a full path to the outlook.exe executable. I have a working Outlook installation on my work laptop, but if I drop to cmd.exe or powershell and try to run Outlook from the command line by just typing outlook.exe, I get the error 'outlook.exe' is not recognized as an internal or external command, operable program or batch file. . This is the equivalent command-line message to the ShellExecute ERROR that you quoted.

    For my new work laptop, with a clean installation of Outlook, outlook.exe is not in the PATH, so neither the command line nor Notepad++'s Run command can find it. But if I set Notepad++ > Run > Run… to "C:\Program Files (x86)\Microsoft Office\root\Office16\OUTLOOK.EXE" /a "$(FULL_CURRENT_FILE)", it will attach the saved copy of the active file to an email using outlook – please note the quote marks.

    So you need to find your path to the outlook executable. (Probably something similar, though I’m guessing you have a sensible 64bit outlook at "C:\Program Files\Microsoft Office\root\Office16\OUTLOOK.EXE", but that is just a guess)

  • Cursor setting - deletes next letter

    3
    0 Votes
    3 Posts
    2k Views
    George MasterG

    hey thats so easy
    thanks, now I will know from now!

    12227056_10153786756412112_5055310843050834114_n.jpg

  • UDL and comments

    2
    0 Votes
    2 Posts
    284 Views
    EkopalypseE

    @Alan-Bourke

    You are right, that is one of the limitations.
    One way around this limitation would be to use the EnhanceAnyLexer plugin, of which I am the author, and define a regex that matches anything within a beginning ' and closing ' character.

  • UDL and hex prefix

    5
    0 Votes
    5 Posts
    634 Views
    Alan BourkeA

    @PeterJones said in UDL and hex prefix:
    That has cracked it thanks. The ‘e’ issue was because I had

    end sub

    in Folding style 1 Close, I should have had

    ‘end sub’

  • Notepad++ Crashed

    2
    0 Votes
    2 Posts
    218 Views
    PeterJonesP

    @Hakar-Mahmoud ,

    See the “Scenario: My (unsaved) files are missing!” section in the Backup FAQ. Unfortunately, it’s not a miracle cure, but it offers the best advice we have on this subject. I suggest familiarizing yourself with that whole FAQ to not run into this problem again.

  • Non-Alphabetic symbols

    1
    0 Votes
    1 Posts
    155 Views
    No one has replied
  • File link problem with space character

    4
    0 Votes
    4 Posts
    1k Views
    Alan KilbornA

    There’s the possibility to script a solution to such a problem; for ideas on that, see this related CONCEPT.

  • Is it possible to record macro to enter current date?

    7
    0 Votes
    7 Posts
    1k Views
    Rufus SmithR

    @guy038 You reminded me why I didn’t need my python plugin recently! I have been using that edit/insert/date and forgot about it! A lot of cool plugins are now incorporated in notepad, like sort/compare/etc…

  • 1 Votes
    8 Posts
    2k Views
    Alan KilbornA

    @Seth-Bettwizilch said in TypeScript not highlighting syntax outside of default style:

    recreate Vibrant Ink to be more faithful and up-to-date

    Maybe give it a new fancy name as well, and submit it to the user-defined themes collection, where it will be maintained in the future (by you) and really shine! :-)

    My thinking is that the existing Vibrant Ink theme is just going to live on the way it currently is, under Notepad++, so something you improve/augment would benefit from a new name to avoid confusion.

  • XML Tools v8.4.4

    2
    0 Votes
    2 Posts
    2k Views
    PeterJonesP

    @user1026

    XML Tools v3.1.1.13 is avaiable for download through Notepad++ v8.4.4 Plugins Admin:
    1758a1a4-7798-416e-80bf-a4b654a51d34-image.png

    If you already have XML Tools installed, it may be listed on the Updates or Installed tab, instead.

  • Need Help For Remove a href Tag With out remove anchor Text

    2
    0 Votes
    2 Posts
    537 Views
    guy038G

    Hello, @smart-warriors and All,

    If we assume that the strings <a href= and </a> are, both, on one line, only, I suppose that the following regex does the job :

    Open the Mark dialog ( Ctrl + M )

    SEARCH (?s)<a href=.+?>\K.+?(?=</a>)

    Possibly, check the Wrap around option

    Select the Regular expression search mode

    Click on the Mark All button

    Then, click on the Copy Marked Text button

    Open a new tab ( Ctrl + N )

    Paste the clipboard’s contents ( Ctrl + V )

    If all your <a href=.....>........</a> definitions are contained in a single line, you may use the more restrictive regex :

    MARK (?-s)<a href=.+?>\K.+?(?=</a>)

    Best Regards,

    guy038