• List of free keyboard shortcuts

    11
    1 Votes
    11 Posts
    12k Views
    PeterJonesP

    @Alan-Kilborn said in List of free keyboard shortcuts:

    Interesting; I’ve never noticed that “key” before.
    And I still don’t know what it is. :-P

    VK_OEM_102. It’s a key on some international keyboards, not on standard US keyboards.

    The third post of the shortcuts FAQ has the <> listed, and you’ll see it has a description in the French column but not US column. And @dinkumoil’s German description and @notdodgeball’s Portuguese description show what the key maps to on those keyboards

  • Show/Hide Tools Panel via Hot Key

    7
    0 Votes
    7 Posts
    1k Views
    kuzduk = kuzdukK

    @guy038 said in Show/Hide Tools Panel via Hot Key:

    notepad.hideToolBar(not(notepad.isToolBarHidden()))

    Thanks! It is working via 1 hour of learning PytonScript…
    Thanks for all who helped in current problem!

    Many little thigs in npp can use via monstrous system of plugin, like Firefox philosophy… It is not good! Old Opera and today Vivaldy phylosophia is best: all setting work correctly from installer.

  • Interpret an Unicode value as real character in Notepad++

    14
    0 Votes
    14 Posts
    2k Views
    rdipardoR

    FYI

    The HTML Tag wiki now includes a more accurate description of its decoding limitations. Not sure yet if this can be improved while the source code is targeting the Free Pascal runtime, which tends to favour UTF-8 as being more compatible with the many different platforms it supports. Perhaps for the sake of legacy Delphi code, the WideString type is an exception:

    WideStrings consist of COM compatible UTF16 encoded bytes on Windows machines (UCS2 on Windows 2000), and they are encoded as plain UTF16 on Linux, Mac OS X and iOS.

    The P.E. header of a recent plugin DLL shows “4.0” as the minimum required OS version, even older than Windows 2K, so it’s possible that Unicode text is actually encoded as UCS2 (!).

    The orignal developer seems to have assumed that a signed 16-bit SmallInt would be enough for all potential code points. They’ve been stored as 32-bit unsigned integers for a long time now, so there’s really no excuse for not extending the logic to decompose ordinals north of U+010000 into surrogate pairs and feeding them back into the decoder.

  • Remove duplicate lines removes end of line marks and sorting moves them

    5
    1 Votes
    5 Posts
    410 Views
    Alan KilbornA

    It’s a somewhat hotly contested thing: Is a line a line without a line-ending at its end? For me, it’s a No…and, because Notepad++ doesn’t enforce that, I, like Peter, use the editorconfig plugin, which forces the final line in a file to have a line-ending. An unfortunate side effect of that is that Notepad++ won’t sort “correctly”.

  • sort seems to get confused if you've done a find and replace

    6
    0 Votes
    6 Posts
    378 Views
    Alan KilbornA

    @ThosRTanner said in sort seems to get confused if you've done a find and replace:

    It’s a bit confusing of it to display the things the same though.

    It’s a Scintilla thing. Scintilla considers CR alone, LF alone, or CRLF (together) as the end of a line, regardless of the file’s line-ending type as shown in the status bar.

    BTW, I think I remember that the line-ending type (determined when a file is loaded) isn’t a complicated algorithm: it’s simply the first line-ending in the file.

  • 1 Votes
    2 Posts
    720 Views
    guy038G

    Hello, All,

    In my last post, I forgot some important points ! So, refer to this correct version, below and forget the previous one !

    When I began to “follow” Notepad++, in 2012, I was using N++ ANSI versions. At this time, N++'s forums were located on SourceForge.Net and, of course, my first replies to users were stored as ANSI files.

    Recently, I was wondering how many files, among my 1,800 posts about, stored on my laptop, have a true ANSI encoding, in order to re-encode them as UTF-8 with the two commands :

    Encoding > Convert to UTF-8

    File > Save

    I suceeded to find out a way to achieve it ! You just need two DOS tools : iconv.exe and xxd.exe

    Notes :

    Using the xxd.exe program alone, which is a hexdump utility, is not enough to determine the correct encoding. In fact, it can identify, without error :

    True UTF-8-BOM files with the first three bytes EFBBBF

    True UTF-16 BE BOM with the first two bytes FEFF

    True UTF-16 LE BOM with the first two bytes FFFE

    But it cannot display, at the first sight, any difference between an ANSI and a UTF-8 file without a BOM, unless scanning the files completely !

    Rememver also that, if all bytes of a file have a value below \x80, Notepad++ considers that it’s a pseudo UTF-8 file, by default !

    Thus,

    Download the binaries, dependencies and documentation archives, relative to the iconv.exe program, from :

    https://gnuwin32.sourceforge.net/packages/libiconv.htm

    Move to the directory where you extract the iconv.exe program and its 3 dependencies : libcharset1.dll, libiconv2.dll and libintl3.dll

    Now, in this same directory, download the xxd archive from :

    https://sourceforge.net/projects/xxd-for-windows/files/xxd-1.11_win32(static).zip/download

    Extract the xxd.exe file

    Open a DOS window

    Run, first, the command chcp 1252 ( in order to get an ANSI output for this DOS window ! )

    Move to the folder containing, both, iconv.exe and xxd.exe

    Then, run the command iconv -f UTF-8 -t UTF-8 <Full_Directory_Path>\*.* 1> NUL 2>> results.txt

    Of course, you must replace the <Full_Directory_Path> zone by the folder location containing all the files to scan for encoding !

    => With this command, you are certain that the OUTPUT file ( results.txt ) contains only files which are not presently encoded in UTF-8 ( so, in N++, they can be true ANSI files, with some bytes between \x80 and \xFF or true UTF-16 files with a BOM )

    Now, open the results.txt file in N++

    Open the Replace dialog ( Ctrl + H )

    SEARCH (?-si)^Permission denied\R|^.*iconv:\x20|: cannot convert$

    REPLACE Leave EMPTY

    Tick the Wrap around option

    Select the Regular expression search mode

    Click on the Replace All button

    => We keep the full pathnames, only

    Save the results.txt file

    Open, again, the Replace dialog ( Ctrl + H )

    SEARCH (?-s)^.+

    REPLACE \( echo | set /p="$0 " & xxd.exe -l2 -u "$0" \) >> results.txt

    Tick the Wrap around option

    Select the Regular expression search mode

    Click on the Replace All button

    Now, add the line @echo OFF at the very beginning of the file

    And rename this file as results.bat

    If the current encoding of this batch file is UTF-8, run the Encoding > Convert to ANSI option ( IMPORTANT, as the DOS window is ANSI too )

    Save this new results.bat file

    Run the results.bat file, in the DOS window

    Back to Notepad++, open the new results.txt file

    Open the Replace dialog ( Ctrl + H )

    SEARCH (?-s)^.+(FFFE|FEFF).+\R|\x2000000000:.+

    REPLACE Leave EMPTY

    Tick the Wrap around option

    Select the Regular expression search mode

    Click on the Replace All button

    => We get rid of the UTF-16 files which have a BOM equal to FEFF or FFFE

    Save the results.txt file

    => Thus, you should get, only, the true ANSI files, containing some bytes between \x80 and \xFF, that need a further UTF-8 or UTF-8-BOM encoding !

    Delete the results.bat file

    Finally, close the DOS window

    Best Regards,

    guy038

  • Column To Multi-Select FORCED ON

    5
    0 Votes
    5 Posts
    298 Views
    N

    @Alan-Kilborn thank you so much for replying. I must apologize for being rude and abrupt. I was only using the empty “%APPDATA%\Notepad++\noColumnToMultiSelect.xml” file to disable. I went into the settings, unchecked those boxes… and now it has disabled. Thank you again for your patience and consideration.

  • Wildcard in Replace Line?

    4
    1 Votes
    4 Posts
    326 Views
    Alan KilbornA

    @x-77-x said in Wildcard in Replace Line?:

    how do you guys even know this stuff!?

    Umm, it’s all documented in the User Manual, which is linked to from the ? menu option in Notepad++…

    Look under the Searching heading, for Regular Expressions.

  • Confirmation email - the link does not work

    3
    0 Votes
    3 Posts
    244 Views
    PeterJonesP

    For this specific instance, debug continued in chat (because of privacy issues).

    But if you are a reader in the future, who is encountering the same thing:

    The link you are provided in the confirmation email is a one-time link. So if you follow the link twice, or if you accidentally hit “reload” in your browser, or if your browser for whatever reason requests the page twice (view source, reload, network confusion, …) then the second time will give a “Not Found” error. It may be that you never saw the first successful load, even though it was successful behind-the-scenes.

  • Filtering the shortcut mapper

    15
    3 Votes
    15 Posts
    721 Views
    Mark OlsonM

    The proposed feature of filtering the shortcut mapper has been added to Notepad++ via this commit.

    See this issue in the user manual repo for some examples of how the new functionality will work.

  • help! regular express

    2
    0 Votes
    2 Posts
    204 Views
    guy038G

    Hello, @李唯任 and All,

    Not difficult with regular expressions !

    Do a normal selection of your first text part to modify

    Open the Replace dialog ( Ctrl + H )

    Untick all box options

    Tick the Wrap around box option

    Select the Regular expression search mode

    Enter (?-s)(?:.+(\R))+.+ in the Find what: zone

    Enter {\1$0\1}, in the Replace with: zone

    FIRST possibility :

    Tick the In selection box option

    Click on the Replace All button

    SECOND possibility :

    Do not tick the In selection box option

    Click on the Find Next button

    Click on the Replace button if the present selection must be replaced (A)

    Click again on the Find Next button, if the present selection must stay unchanged

    Return to line (A)

    And so on…

    => the FIRST possibility just produce one global replacement on your selection whereas the SECOND possibility allows you to choose the zones of text to modify or not !

    Notes :

    First, the in-line modifier ( (?-s) ) means that the regex character . represents a unique standard char only ( not EOL )

    Then the (?:.+(\R))+ part represents a bunch of, at least, 1 complete line(s), surrounded by a non-capturing group ( (?:.......) ), each with :

    1 or more standard characters

    Any kind of End of Line ( \R ), so \r\n or \n or \r, stored as the group 1 , which will be re-used in replacement

    Finally the .+ part match a LAST non-empty line ( Thus, the case if your last section is at the very end of file, without any EOL, will be matched, too )

    In replacement, we simply write the { character first, followed with an EOL character ( the group \1 ), followed with the whole regex ( $0 ) and, again, followed with a second EOL character and, finally, the } character

    Best Regards,

    guy038

  • Notepad++ Searching by columns for non alpha characters

    12
    1 Votes
    12 Posts
    1k Views
    Ray NaylorR

    @Coises
    Thank you soo much! Works perfectly now.

  • Change Color of Hyperlinks in Text File (Not Just on Hover)

    6
    0 Votes
    6 Posts
    966 Views
    DeeTNBlazerD

    The two solutions given here solved my issue. Thank you so much to the contributors!!

  • Word count in Status Bar on text selection

    4
    0 Votes
    4 Posts
    2k Views
    guy038G

    Hello, @michelle-pace,

    You may also be interested by this Python script, built up with the @alan-kilborn’s collaboration and some other Python gurus !

    On the last line of this Summary report, it will give you, at the same time, the number of characters, words and bytes of all your selected text, in one or several ranges, of the current file, whatever the view used !

    https://community.notepad-plus-plus.org/topic/20218/emulation-of-the-view-summary-feature-with-a-python-script/14

    Of course, if you select all the file contents, the results, reported in the last SELECTION(S) line, should be identical to the 3 lines just above :
    Total chars, Words count and Buffer length

    BTW, note, that I added the mention (Caution !) in the Words line, because the word notion is quite odd in many languages ! Refer to this post :

    https://community.notepad-plus-plus.org/topic/20218/emulation-of-the-view-summary-feature-with-a-python-script/3

    If needed, you may even change the default definition of a word character, as explained at the beginning of the post !

    Best Regards,

    guy038

  • "Clear Type" does not affect the font display in the editor

    3
    0 Votes
    3 Posts
    214 Views
    Storm CorpS

    Yes, that’s what I need! Thanks for the help!

  • Perl folding fails on comment with right curley brace "#}"

    4
    0 Votes
    4 Posts
    293 Views
    mpheathM

    @CodeBiene said in Perl folding fails on comment with right curley brace "#}":

    So it has nothing to do with the fact that there are several consecutive comment lines.

    I agree that It is something that has not been mentioned yet.

    The hexadecimal 3FF displayed in the margin is negative folding caused by unbalanced braces.

    perl_fold4.gif

    2 frames alternate every 4 seconds displaying the default lexer property value of

    fold.perl.comment.explicit=1

    and the changed value of

    fold.perl.comment.explicit=0

    Comment explicit enabled for the lexer is usually the leading comment character(s) followed with a brace. Perl comment explicit is #{ as a open fold and #} as a close fold.

    Notice the line with #} { shows fold flags of 402 401 which means it is closing a fold. The next frame with that same line shows fold flags as 402 402 which means that there is no change in the folding state.

    The Ctrl+Q key sequence changes } { to # } { which is not recognized as a fold by comment explicit as to the space after the # symbol.

    PythonScript can be used to disable the comment explicit option which is enabled with the value of 1 by default:

    editor.setProperty('fold.perl.comment.explicit', 0)

    This setting will not survive changing buffers so may need a callback to be setup.

  • Remote linux agent to trigger a local edit?

    1
    1 Votes
    1 Posts
    197 Views
    No one has replied
  • [feature request] cloned tab lighting

    12
    1 Votes
    12 Posts
    735 Views
    Lycan ThropeL

    @Alan-Kilborn ,
    Thanks to you, (grumble :) ) I’ve started checking out the YT videos by Chris Amit to check out some of the other things NPP and Plugins do that I’ve not been using and already have enabled 3 more plugins. ::sigh:: Ignorance was bliss, now that I’ve eaten the apple, like Adam, I’m screwed. :)

  • How to highlight text?

    10
    0 Votes
    10 Posts
    138k Views
  • Merge files in one - How does it work?

    1
    0 Votes
    1 Posts
    246 Views
    No one has replied