• notepad++ python 'find all in current document'

    2
    1 Votes
    2 Posts
    393 Views
    Alan KilbornA

    @June-Wang

    I presume you mean you want to use the PythonScript plugin to write some code to do what you’ve asked.

    I also presume that you want the output to appear in the Search results panel, just like it would if you were doing an interactive Find All in Current Document.

    It’s a bit of a task because there is no “connection” between PythonScript and writing to the Search results panel, meaning that PS provides no API function call such as notepad.writeToSearchResults(...).

    Maybe the ideas in THIS THREAD give a possible approach…

  • How to multi-select similar worlds ?

    3
    1 Votes
    3 Posts
    340 Views
    N

    This is awesome. Really awesome. So neat feature, I think I will use it very often. Thank you for your help! And thank you to the people who decided to implement this!

  • erase exacly lines

    17
    1 Votes
    17 Posts
    1k Views
    NippurDeLagashN

    @Altevir-Gomes If you feel your English in not good enough, you can still learn Expressões Regulares (Em Portuguese do Brasil)" studying the following book:

    https://www.piazinho.com.br/#download

    The book dedicates a few pages to Notepad++ in chapter 6.

  • 1 Votes
    4 Posts
    410 Views
    CoisesC

    @David-Kerber

    Columns++ (which Alan mentioned) is not yet available through the Plugins Admin in Notepad++, but you can find the latest release here. If you have Notepad++ installed in the default location, you can use the “Quick Installer” link in that release description — just download it and run it.

    The function you want is described here in the help. You can check that out first to see if seems like it will work for you.

  • Setting a file tab's Language to "Internal Search"

    4
    2 Votes
    4 Posts
    426 Views
    Alan KilbornA

    There is further discussion about this topic in this thread: https://community.notepad-plus-plus.org/topic/25145/find-and-display-all-duplicate-lines/

  • Redefine Shortcuts

    3
    1 Votes
    3 Posts
    212 Views
    Kannan GK

    @Terry-R
    Was not knowing that, worked like a Charm! GREAT! Thanks a LOT!!

  • Making font size a shortcut

    3
    1 Votes
    3 Posts
    443 Views
    Alan KilbornA

    @Owlyvia-Tirsek said in Making font size a shortcut:

    can I make a shortcut for changing text size?

    Maybe you want to consider zoom-in and zoom-out, for (temporary) text size change needs?

    Hold the Ctrl key down and scroll the mouse wheel in both directions while pointing at your editor text, to see the effect.

  • nppFTP is ignoring cachemap

    3
    1 Votes
    3 Posts
    193 Views
    Paul SmartP

    NP++ version 8.5.8
    NppFTP version 0.29.12 (unicode)

    Just set this up on a new machine, so this should all be pretty up to date.

  • Setting to close Find window after initiating search?

    10
    0 Votes
    10 Posts
    693 Views
    Alan KilbornA

    The desired behavior can be scripted if one wants to use a plugin (PythonScript) to achieve the goal.

    I call the script FindNextClosesFindWindow.py and here is its listing:

    # -*- coding: utf-8 -*- from __future__ import print_function # see https://community.notepad-plus-plus.org/topic/19844/setting-to-close-find-window-after-initiating-search from Npp import * import platform from ctypes import (WinDLL, WINFUNCTYPE) from ctypes.wintypes import (HWND, UINT, INT, WPARAM, LPARAM) #------------------------------------------------------------------------------- user32 = WinDLL('user32') GWL_WNDPROC = -4 # used to set a new address for the window procedure LRESULT = LPARAM WndProcType = WINFUNCTYPE( LRESULT, # return type HWND, UINT, WPARAM, LPARAM # function arguments ) running_32bit = platform.architecture()[0] == '32bit' SetWindowLong = user32.SetWindowLongW if running_32bit else user32.SetWindowLongPtrW SetWindowLong.restype = WndProcType SetWindowLong.argtypes = [ HWND, INT, WndProcType ] SendMessageW = user32.SendMessageW SendMessageW.restype = LRESULT SendMessageW.argtypes = [ HWND, UINT, WPARAM, LPARAM ] WM_COMMAND = 0x111 WM_CLOSE = 0x10 IDOK = 1 # 'Find Next' button in Find dialog # for the following see https://github.com/notepad-plus-plus/notepad-plus-plus/blob/3c9d58176b0fd890d26e96d0208d2d981f1544e4/PowerEditor/src/ScitillaComponent/FindReplaceDlg_rc.h#L1 IDC_FINDNEXT = 1723 # 'Find down-arrow' button in Find dialog IDC_FINDPREV = 1721 # 'Find up-arrow' button in Find dialog #------------------------------------------------------------------------------- class FNCFW(object): def __init__(self): for try_count in (1, 2): if try_count == 2: notepad.menuCommand(MENUCOMMAND.SEARCH_FIND) for find_window_tab_caption in [ u'Find', u'Replace', u'Find in Files', u'Find in Projects', u'Mark' ]: self.find_window_hwnd = user32.FindWindowExW(None, None, u'#32770', find_window_tab_caption) if self.find_window_hwnd: self.new_find_wnd_proc_hook_for_SetWindowLong = WndProcType(self.new_find_wnd_proc_hook) self.orig_find_wnd_proc = SetWindowLong(self.find_window_hwnd, GWL_WNDPROC, self.new_find_wnd_proc_hook_for_SetWindowLong) if try_count == 2: self.close_find_window() return def new_find_wnd_proc_hook(self, hwnd, msg, wParam, lParam): orig_wnd_proc_ret_val = self.orig_find_wnd_proc(hwnd, msg, wParam, lParam) if msg == WM_COMMAND and wParam in [ IDC_FINDNEXT, IDC_FINDPREV, IDOK ]: self.close_find_window() return orig_wnd_proc_ret_val def close_find_window(self): SendMessageW(self.find_window_hwnd, WM_CLOSE, 0, 0) #------------------------------------------------------------------------------- if __name__ == '__main__': try: fncfw except NameError: fncfw = FNCFW()

    It can be set up in startup.py to run automatically when Notepad++ starts via these two lines:

    import FindNextClosesFindWindow fncfw = FindNextClosesFindWindow.FNCFW()
  • Replacing new line sign ("\n") when the line after starts with ";"

    7
    1 Votes
    7 Posts
    27k Views
    P

    @PeterJones it is absolutely it, it works perfectly! Thank you so much!

    I’m a little bit embarrassed that I haven’t connected the dots…

    Thanks once again!

  • Hide specific section in menu bar like macro, run

    3
    1 Votes
    3 Posts
    276 Views
    Alan KilbornA

    @Alex01921

    Why do you want to hide those menus?
    Do you have users and you don’t want them creating macros or Run menu entries?
    Maybe this is a feature request for Notepad++? If so, see HERE.

    You could probably achieve this via a script, but as I have little interest myself I can’t provide further help on it.

  • Create HTML table every second line

    2
    1 Votes
    2 Posts
    215 Views
    Alan KilbornA

    @Gaurang-Amin said in Create HTML table every second line:

    <tr><td>Anti-Allergy</td><td>Yes</td></tr>

    Try:

    Find: (?-s)^(.+)\R(.+)
    Replace: <tr><td>${1}</td><td>${2}</td></tr>
    Search mode: Regular expression

    Learn more about regular expressions HERE so that you don’t have to ask next time.

  • Problems when switching back into Notepad++ to make it the Active window

    7
    2 Votes
    7 Posts
    623 Views
    Alan KilbornA

    @mkupper said in Problems when switching back into Notepad++ to make it the Active window:

    If you already have one or more active selections then you can hold the Ctrl key down when you click to activate Notepad++. It’ll keep your selection(s) active

    In my experimentation after reading this, Ctrl+click to activate gives me an additional caret at the click point, along with keeping the other selection I made.

    I suppose that isn’t harmful if I’m intending to just copy the selection I previously had.

    But I’d have to remember to Ctrl+click to activate Notepad++, and I probably won’t remember that.

  • copying LTR text in RTL mode

    7
    3 Votes
    7 Posts
    472 Views
  • Find and replace 3rd occurrence of symbol (changing CSV)

    3
    1 Votes
    3 Posts
    279 Views
    Robert BarbaR

    thank you, and I didn’t realize it was the 4th… lol!
    here are 5 examples all of various lengths.

    D:America:US:CA:Springfield:92584
    D:America:US:OR:Salem:97301
    D:America:US:NH:Portsmouth:03801
    D:America:US:NJ:Little Egg Harbor:08087
    D:America:US:IL:Oak Brook:60523

  • Better Function List for Java ?

    23
    1 Votes
    23 Posts
    2k Views
    PeterJonesP

    @rdipardo said in Better Function List for Java ?:

    let me try to explain why this grossly overstates Lexilla’s capabilities.

    Somewhat optimistic, possibly. But I don’t think it’s grossly overstated.

    A lexer is in fact surprisingly like a regex engine.

    And as such, it should be able to do at least as well as the regex-based approach, with the added benefit that it’s much easier to track state inside the non-extensible C++ code, so being able to track whether or not a function definition is still within a given class or not would be possible to add – though it may be a lot of effort.

    But I don’t think that anyone should bother with such a feature request to Lexilla, because I am quite confident that, no matter whether my feasibility estimation is just optimistic or “grossly overstated”, they would reject it out of hand.

  • XML Tools - Validation against a Schema

    2
    1 Votes
    2 Posts
    235 Views
    Mark OlsonM

    @PatG1958
    I can’t help you with this error, but if nobody here can help, you might want to go to the GitHub repo and raise an issue, so that maybe the maintainer or somebody else can help.

  • Scroll through document list with mouse hover

    6
    1 Votes
    6 Posts
    609 Views
    Alan KilbornA

    @mkupper

    asking for is the ability to hover over a file name to activate it

    Hovering to pop up information is fine, but hovering actually changing things IMO is a bad idea (as I tried to discuss in a previous posting). The mouse will always come to rest somewhere when the user is done using it (and goes back to typing text, say). Oftentimes you just want to get the mouse cursor out of the way so you don’t care where it lands. If this happened to activate some tab I don’t care about right now, I’d be an annoyed user.

    Note: I do know that a recent enhancement to Scintilla hides the mouse cursor when typing starts (I was fundamental in getting Scintilla to do that).

  • use notepad-plus-plus to search and replace from a text file

    4
    1 Votes
    4 Posts
    326 Views
    mkupperM

    @notepaddpp1023, it is possible to do what you want in Notepad++ but as others have said, it’s best for you to use the tools/skills you are already comfortable with. Your project description is vague but it sounds complicated. This means you will be figuring out and debugging issues with whatever solution you use. If you take on learning something new, regardless of what it is, then you are also faced with debugging your understanding of whatever new tools or methods you are using.

    Something else to keep in mind is on if this is your own personal project or is it part of a work or school environment? There are solutions that may end up working perfectly well for you personally but may not be portable or usable by others that may not be as familiar with the data as you. Others may have different needs for that data. If you are part of a team and you have bosses and supervisors then those people need to direct the overall process.

  • Same NPP executable run on multiple PC : need their own sessions

    3
    1 Votes
    3 Posts
    209 Views
    mkupperM

    @Gian-Matteo - Try experimenting with Notepad++'s -settingsDir command line option. If you point it at a folder that is not shared with the other computers then it will be in it’s own session.

    Keep in mind that Notepad++ reads its configuration and session files when it starts and writes then back out when you exit or close Notepad++. Thus, you will need to move and think carefully when testing out and using more than one copy of Notepad++ at the same time either on the same or different machines.

    It is likely possible* to do what you want to do but you have not provided enough information about how you are currently set up for others to provide suggestions that may be a better fit for your situation or desires.

    * I had to add an asterisk as there is one issue you may run into which is Notepad++ does not have perfect support for running two or more instances of Notepad++ on the same machine at the same time.