• how to make tab bar appear vertically in notepad ++

    2
    0 Votes
    2 Posts
    1k Views
    mkupperM

    @kahalahmawad

    Try View / Document List plus in preferences you remove the tab bar.

    Or, you can go with the sideways named vertical tab bar and hover the mouse on a tab and it will show the name horizontally.

  • 0 Votes
    2 Posts
    207 Views
    mkupperM

    @wonkawilly said in css formatting not working on embed style sheet at the begging of the style section in specific cases:

    Someone else can replicate the issue?

    Please post an example for people to experiment with using the </> code thing that’s available in the forums.

  • latest version download url broken

    7
    0 Votes
    7 Posts
    525 Views
    PeterJonesP

    @mkupper said in latest version download url broken:

    At one point within the last year or two donho said that Notepad++'s getDownloadUrl.php was an internal thing. He had not planned on it being used by others. Unfortunately, I can’t find that commen

    here (in the <NeedToBeUpdated> topic already linked), he said,

    https://notepad-plus-plus.org/update/getDownloadUrl.php is internal URL for Notepad++ packages doing self auto-updating, but it not supposed for outside usage (from any individual or IT people of enterprise doing it manually). Therefore no support for the internal URL normally.

    However, I have no way so far to hide the URL from outside.

    Note that getDownloadUrl.php could change its way to manage the auto-update in the future. Since it’s an internal used URL, there’s no warranty to keep its retro-compatibility.

    So the conclusion that I draw: @mforrest and others may use it as-is if they want to take the risk (because he cannot stop them), but they need to understand that the rules used behind-the-scenes are allowed to change at any time, without notice.


    update: further, this post confirms that the behavior of missing version= changed at the same time as Don’s 2023-Sep-21 update to allow either version=X.Y.Z or version=X.YZ – since we know there was a change there, but the versions in the npp-specific wingup repo and in the gup4win repo haven’t changed in 8 years, we also can conclude that the one actually used by Notepad++ is custom, even compared to the notepad-plus-plus/wingup repo version.

  • HunSpell, remove words from .dic

    33
    -1 Votes
    33 Posts
    3k Views
    mkupperM

    Some topics are troll magnets. Are they seeking, HunSpell, .dic, or something deeper?

  • Looking for a quick way to add lines of text after | if possible

    7
    0 Votes
    7 Posts
    373 Views
    CheapSweetLifeC

    @Coises
    Okay freaking genius way of doing things I don’t even need to add the | at the end anymore since I don’t need to use the Bulk Renamer Utility. This makes things so much simpler. I want to tell you thing worked great for the last 10 movies I have bee working with but now the only big issue is renaming the trailers. Since there names are always all over the place.

    From things like:
    Criminal (2016 Movie) Official Trailer – “Remember”.mp4|
    Crimson Peak Official Trailer #1 (2015) - Tom Hiddleston, Jessica Chastain Movie HD.mp4|
    Darkman Official Trailer #1 - Liam Neeson Movie (1990) HD.mp4|
    Dreamer Inspired by a True Story Trailer (2005).mp4|
    From Time To Time - Trailer.mp4|
    GHOSTBUSTERS: FROZEN EMPIRE - Official Trailer (HD).mp4|

    so using that same code would be a bit harder since there is nothing that matches from file name to file name. but at least the movie files will be done in a freaking snap now. I really want to thank you for the help with that.

  • File sorting

    20
    0 Votes
    20 Posts
    5k Views
    Mark OlsonM

    @Mahmoud-Madkour
    To open a tree view for a file in REGEX mode, just use the Regex search to JSON command from the JsonTools plugin menu.
    Once the tree view is open, you can paste the query into the text box at the top right corner of the tree view, and click the Submit query button next to the text box.

  • Replacing single columns with hash (sha256) values

    3
    0 Votes
    3 Posts
    909 Views
    CoisesC

    @Chrissiju said in Replacing single columns with hash (sha256) values:

    Is it possible to jointly generate an SHA256 hash for each and every value in a single column, using Lint ? (i.e. not for the whole file one hash, but one hash per ‘excel box’). Purpose: For privacy reasons the original values are not to be presented , but a unique pseudonym is needed.

    It is possible that I don’t understand your problem. Please forgive me if I’ve missed the point. Can you do this?:

    First, make a rectangular selection enclosing the column. (Click at the top left of the column, then Alt+Shift+click at the bottom right of the column. If you have to scroll to get to the bottom, use the scrollbar, not keyboard navigation.)

    Now, copy to the clipboard.

    Next, select Tools | SHA-256 | Generate… from the main menu.

    Check Treat each line as a separate string and paste what you copied into the top box in the dialog.

    Click the Copy to Clipboard button.

    Now, open a new (empty) tab and paste the contents of the clipboard.

    Make a rectangular selection around that and copy. Switch back to the original document and paste.

    (Despite my advice elsewhere, in this case you can paste directly into the rectangular selection if you made it top to bottom. If you made it bottom to top, the lines will be reversed… so don’t do that…)

  • Old WhatsApp conversations with legacy encoded emojis - find and replace?

    9
    1 Votes
    9 Posts
    1k Views
    guy038G

    Hello, @peterjones, @alan-kilborn and All,

    From, your two last posts, Alan and Peter, I asked myself : which is the distribution of all my text files, regarding their encoding ?

    I considered, as a text file, all the files with the main following extensions, by importance level :

    txt, .py, html, htm, xml, ini, msg, csv, log as well as few other files with rare extension

    Now, using the iconv.exe utility to get all the NON-UTF8 files and, then, the xxd.exe software to omit the UFT-16 encoded files, I was able, little by little, to restrict my list to 360 files, about, for which I possibly could change the encoding from ANSI to UTF-8 !

    Of course, opening all the files, one at a time, in N++, changing their encoding and saving them seemed rather tedious. Thus, I used a simple python script to achieve this task easily :

    ''' NAME : Move_to_UTF8_encoding.py REMARK : The fonction 'npp_get_statusbar' is an idea of @alan-kilborn This script : - Opens a file which contains a list of ABSOLUTE file-paths - Read, successively, the file-paths from that list - Open EACH file in N++ - Perform the 'Convert to UTD-8' action on the CURRENT opened ANSI file - Save and close EACH file, one at a time NOTES : - The file, containing the list of ABSOLUTE file-paths to OPEN, is an UTF-8 encoded file, with 'Windows' EOL - This list must NOT contain EMPTY or BLANK lines - But, any line beginning with the '#' character is simply IGNORED ( So begin any EMPTY line or COMMENT line with a '#' char ! ) - The PATHS are designated by a SIMPLE character ANTI-SLASH ( Ex : D:\Dir_1\Dir_2\Name.txt ). NO need to DOUBLE the ANTISLASH ( \\ ) - On the same way, NO need to SURROUND the file-paths, containing SPACE characters, with DOUBLE-QUOTES - This list may contain some ACCENTUATED characters ''' from Npp import * import time import ctypes from ctypes.wintypes import BOOL, HWND, WPARAM, LPARAM, UINT console.show() console.clear() with open('D:\\Verif.txt') as file: for file_path in file: file_path = file_path.strip('\n') if file_path[0] == "#": continue notepad.open(file_path) # ---------------------------------------------------------------------------------------------------------------------------------------------------- # From @alan-kilborn, in post https://community.notepad-plus-plus.org/topic/21733/pythonscript-different-behavior-in-script-vs-in-immediate-mode/4 # ---------------------------------------------------------------------------------------------------------------------------------------------------- def npp_get_statusbar(statusbar_item_number): WNDENUMPROC = ctypes.WINFUNCTYPE(BOOL, HWND, LPARAM) FindWindowW = ctypes.windll.user32.FindWindowW FindWindowExW = ctypes.windll.user32.FindWindowExW SendMessageW = ctypes.windll.user32.SendMessageW LRESULT = LPARAM SendMessageW.restype = LRESULT SendMessageW.argtypes = [ HWND, UINT, WPARAM, LPARAM ] EnumChildWindows = ctypes.windll.user32.EnumChildWindows GetClassNameW = ctypes.windll.user32.GetClassNameW create_unicode_buffer = ctypes.create_unicode_buffer SBT_OWNERDRAW = 0x1000 WM_USER = 0x400; SB_GETTEXTLENGTHW = WM_USER + 12; SB_GETTEXTW = WM_USER + 13 npp_get_statusbar.STATUSBAR_HANDLE = None def get_result_from_statusbar(statusbar_item_number): assert statusbar_item_number <= 5 retcode = SendMessageW(npp_get_statusbar.STATUSBAR_HANDLE, SB_GETTEXTLENGTHW, statusbar_item_number, 0) length = retcode & 0xFFFF type = (retcode >> 16) & 0xFFFF assert (type != SBT_OWNERDRAW) text_buffer = create_unicode_buffer(length) retcode = SendMessageW(npp_get_statusbar.STATUSBAR_HANDLE, SB_GETTEXTW, statusbar_item_number, ctypes.addressof(text_buffer)) retval = '{}'.format(text_buffer[:length]) return retval def EnumCallback(hwnd, lparam): curr_class = create_unicode_buffer(256) GetClassNameW(hwnd, curr_class, 256) if curr_class.value.lower() == "msctls_statusbar32": npp_get_statusbar.STATUSBAR_HANDLE = hwnd return False # stop the enumeration return True # continue the enumeration npp_hwnd = FindWindowW(u"Notepad++", None) EnumChildWindows(npp_hwnd, WNDENUMPROC(EnumCallback), 0) if npp_get_statusbar.STATUSBAR_HANDLE: return get_result_from_statusbar(statusbar_item_number) assert False St_bar = npp_get_statusbar(4) # Zone 4 ( STATUSBARSECTION.UNICODETYPE ) if St_bar == 'ANSI': # => Conversion to 'UTF-8', without BOM, RECOMMENDED ! time.sleep(0.5) notepad.runMenuCommand("Encoding", "Convert to UTF-8") notepad.save() time.sleep(0.5) notepad.close()

    REMARK :

    As I was a bit anxious about the needed time to get the encoding change and the save action, for each file, I preferred to use timers to properly ensure the entire process but, may be, these timers are not necessary !

    So, after the various modifications, I got a list of 11,578 files whose distribution, according to their encoding, is as follows :

    UTF-8 BOM : 208 | UTF-16 LE BOM : 39 | UTF-16 BE BOM : 4 | UTF-8 : 540 ( 0 byte ) | => 10,737 with UNICODE encoding ( 92,7 % ) UTF-8 : 9,946 | ANSI : 841 ---------- TOTAL 11,578

    You certainly note that there still are a lot of ANSI files, but most of them are lang or configuration files for which the change of the encoding is rather forbidden or, at least, not welcome !

    Best Regards,

    guy038

  • ALT+mouse selection change

    6
    0 Votes
    6 Posts
    871 Views
    CoisesC

    @DotUniverse said in ALT+mouse selection change:

    Current:
    Current version

    Previous (expected):
    alt text

    There was a change in behavior when pasting into a rectangular selection (including a zero-width selection) beginning with Notepad++ version 8.6.1.

    I’m guessing that you made a rectangular selection of Item1-Item3 in the first column, copied, then made an empty selection three lines deep where you wanted to paste them, and pasted.

    Previously, Notepad++ (using default Scintilla behavior) would have filled in the virtual space between the end of existing lines and the place where you indicated to paste. Notepad++ now treats the rectangular selection the same way as it would a multiple selection, and “collapses” the virtual space.

    If the lines you paste are of different lengths (so that the rectangular selection before you copy includes virtual space), you’ll wind up with a zero-width “rectangular” selection in which the carets do not line up. Switching to another tab and back will leave you with a rectangular selection that seems barely related to anything.

    See these GitHub issues:

    https://github.com/notepad-plus-plus/notepad-plus-plus/issues/15139

    https://github.com/notepad-plus-plus/notepad-plus-plus/issues/15151

    for some of the oddities encountered.

    The solution for users, for now, is that if you want the familiar behavior when pasting rectangular selections, do not paste into a rectangular selection; instead, just click at the top of the column where you want to paste. This operation still works the same as it always did, which is to insert the copied selection line by line into the document at the same column as the cursor.

    Pre-8.6.1, all pasting a copied rectangular selection into a rectangular selection did was to delete the contents of the rectangular selection, then paste as if there were an empty selection (i.e., just a caret) at the top of the deleted section. It did not matter how deep the selection was; it just deleted it and then inserted the new text (which could be fewer, the same or more lines than the deleted selection). The new behavior has so many oddities — if you are used to rectangular selections — that it’s easiest just to do the delete and reposition the cursor if you need to, then paste.

  • How to define a custom language

    8
    0 Votes
    8 Posts
    2k Views
    PeterJonesP

    I would like to define a language (or script) once and then have it activated automatically when I select the matching language, to avoid highlighting files that are not needed but also avoiding having to paste the script each time.

    That’s the way it works.

    why does it change the text font?

    It doesn’t. EnhanceAnyLexer only changes foreground color.

    I once reopened the ini and, yes, it contained my additions, but it had also restored things I had deleted

    I’ve never seen that happen.

    on one occasion the file I was trying to highlight came up as modified.

    EnhanceAnyLexer just changes colors; it does nothing with the text / contents in the highlighted file, so it does not edit the file. The plugin would not cause a file to “come up as modified”.

    how and when you apply the script what do you mean by NameOfUDL? can I associate the highlighting I define with a language?

    EnhanceAnyLexer works by hooking in to the activated lexer language, whether it’s one of the built-in languages, or one of the UserDefinedLanguages (UDL).

    So to make it work:

    Define a UDL for your language. You will give it a name: my example was NameOfUDL. Set the Language of the current file to NameOfUDL under normal circumstances, you could make Notepad++ do it automatically, based on file’s extension, in the UDL definition but you’ve indicated you want to turn this on or off at will (or to change it between one of three languages), instead of having it automatic based on extension EnhanceAnyLexer > Enhance Current Language this will allow you to set up the color / regex mappings for NameOfUDL while you are initially setting them up, you might see some weird things, like sometimes highlighting and sometimes not; it behaves differently while you’re actively editing EnhanceAnyLexer.ini than it does when you’re just using it you have to save it once you are done, otherwise your changes to EnhanceAnyLexer.ini will be lost; it’s a file, just like any other you only have to do this step once per Language once it’s saved, you can close the EnhanceAnyLexer.ini . If not all the enhancements show up in the active file, and it’s got NameOfUDL as the active language, you may have to switch to a different tab and back, or close and re-open the file to get EnhanceAnyLexer to take control.

    So, if you have three separate languages that you’ll want to apply for your use-case, you will need to create three different UDLs (User Defined Languages) – I’ll call them NameOfUDL1, NameOfUDL2, and NameOfUDL3. Then you will have to Enhance Current Language once for each of those (or do it once, and copy/paste into three different sections in EnhanceAnyLexer.ini, making sure to have the correct name of each section. Then the next time you activate one of NameOfUDL1, NameOfUDL2, or NameOfUDL3 for a given file, it will apply the enhancements defined for the chosen UDL.

    Here’s an example:

    file:

    T1| otherstrings something but not T1| otherstrings here

    Excerpt from Languages menu:
    30bc249b-ffcb-431a-89b4-0a2ece7025b9-image.png

    Excerpt from EnhanceAnyLexer.ini:

    [nameofudl1] # 0x0000FF = ^T\d(?=\|) 0x00CC00 = ^T\d\K\| [nameofudl2] # 0xC0C000 = ^T\d(?=\|) 0x00CC00 = ^T\d\K\| [nameofudl3] # 0xFF00FF = ^T\d(?=\|) 0x00CC00 = ^T\d\K\|

    For this simple example, they are highlighting the same regex, but with different colors, just so you can see it is applied. All I had to do to change which EnhanceAnyLexer config was active was change the selection in the Language menu.

    Here are screenshots with four different Language menu entries selected:

    Selected Language Screenshot Normal Text 6eb6571f-6b89-4703-bb01-c07b38a5c7d1-image.png NameOfUDL1 44d2548f-3e8d-4e87-83b8-519feb8e8298-image.png NameOfUDL2 1cb8c5e2-9de5-4204-8962-20090a30c492-image.png NameOfUDL3 f3d9c7ef-f4ac-4fba-a67c-6f0b2ee3e404-image.png
  • CTRL drag copy stopped working 8.6.1

    9
    1 Votes
    9 Posts
    2k Views
    BELLJOHNB

    @Coises
    This is a real solution once for all.
    Thank you so much Coises!

  • What is Notepad++ initialization file?

    3
    0 Votes
    3 Posts
    253 Views
    XianglanAnX

    @Mark-Olson
    Thank you. The file is more complex than I repeat to set up a new setting.

  • Can't install pluggin on Linux Ubuntu

    1
    0 Votes
    1 Posts
    182 Views
    No one has replied
  • Select a bunch of lines and delete them.

    3
    0 Votes
    3 Posts
    206 Views
    LordP666L

    @Alan-Kilborn

    Thanks so much. I’m a new user to Notepad++ and I’m starting to see why people love it so much.

  • NppExport is there a shortcut to use the copy all formats to clipboard?

    3
    0 Votes
    3 Posts
    351 Views
    A

    @PeterJones absolutely perfect, thank you so much :)

  • Not displaying accented characters in INI files

    3
    0 Votes
    3 Posts
    264 Views
    S

    @PeterJones said in Not displaying accented characters in INI files:

    Use DirectWrite s

    Thanks, that solved the problem.

    (BTW, there was an error in my OP: Replace “comma” → “equal sign”.)

  • import from filezilla

    2
    0 Votes
    2 Posts
    209 Views
    PeterJonesP

    @Afik-Gilboa ,

    I assume you are talking about the NppFTP plugin for Notepad++, because Notepad++ itself knows nothing about FTP.

    The NppFTP plugin uses a different underlying library and a different set of settings than does FileZilla, so it would be doubtful that there’s much configuration that it could copy over; but currently, as far as I know, there’s no way for any such import to occur.

    If you’d like that feature, you’d have to request it from the author of that plugin in that plugin’s issue list

  • delete an empty line after a specific text

    4
    0 Votes
    4 Posts
    321 Views
    CoisesC

    @tonymattina said in delete an empty line after a specific text:

    So there is something I still do not understand.

    It is possible that you are victim of a quirk.

    Regular expressions that use \K do not work properly if you try to replace them in Notepad++ one at a time; they only work when you use Replace All.

  • 0 Votes
    2 Posts
    272 Views
    mkupperM

    @mostlyhuman Try Settings / Preferences / MISC. and turn off Enable MRU Behaviour

    MRU Behaviour causes Notepad++ to remember the order that you visited the tabs. When you close the active tab it switched to the previous tab that you had visited. When MRU Behaviour is turned off then closing the active tab switches you to the next tab to the right or of you are ion the last tab it switches you to the tab that was to the left and is now the last tab.

    See https://npp-user-manual.org/docs/preferences/#misc
    and on https://npp-user-manual.org/docs/user-interface/ search the page for MRU to see more about this.

  • 0 Votes
    6 Posts
    442 Views
    guy038G

    Hello, @fabiospark, @coises, @Peterjones, @alan-kilborn and All,

    @coises, I suppose that the second and third regex S/R can be combined in a single one. So, first, we run :

    SEARCH (?-s).+

    REPLACE $0@\r\n$0

    Then, we execute :

    SEARCH (?-s).(?=.*@)|(@)

    REPLACE ?1:\x20

    An other possibility is to use the two successive regex S/R, below, which do not need any char to identify the lines to be filled with space characters :

    SEARCH (?-s).+\R

    REPLACE $0$0

    Then :

    SEARCH (?-s)(.)|\R.+\R

    REPLACE ?1\x20:$0

    If we suppose that we, first, select the blocks of lines needing modifications, here are the corresponding macros :

    <Macro name="Duplicate lines with Spaces" Ctrl="no" Alt="no" Shift="no" Key="0"> <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="$0@\r\n$0" /> <Action type="3" message="1702" wParam="0" lParam="640" 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="?1:\x20" /> <Action type="3" message="1702" wParam="0" lParam="640" sParam="" /> <Action type="3" message="1701" wParam="0" lParam="1609" sParam="" /> </Macro>

    Or :

    <Macro name="Duplicate lines with Spaces Version 2" Ctrl="no" Alt="no" Shift="no" Key="0"> <Action type="3" message="1700" wParam="0" lParam="0" sParam="" /> <Action type="3" message="1601" wParam="0" lParam="0" sParam="(?-s).+\R" /> <Action type="3" message="1625" wParam="0" lParam="2" sParam="" /> <Action type="3" message="1602" wParam="0" lParam="0" sParam="$0$0" /> <Action type="3" message="1702" wParam="0" lParam="640" 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)(.)|\R.+\R" /> <Action type="3" message="1625" wParam="0" lParam="2" sParam="" /> <Action type="3" message="1602" wParam="0" lParam="0" sParam="?1\x20:$0" /> <Action type="3" message="1702" wParam="0" lParam="640" sParam="" /> <Action type="3" message="1701" wParam="0" lParam="1609" sParam="" /> </Macro>

    Best Regards,

    guy038