• How to add keywords for the HTML syntax highlighter?

    3
    0 Votes
    3 Posts
    304 Views
    PeterJonesP

    @PeterJones said in How to add keywords for the HTML syntax highlighter?:

    The Lexilla lexer for HTML does not have a provision for user keywords.

    This was wrong, assuming “add keywords” meant adding new tags. You could obviously add new tags using the Style Configurator’s HTML > Tag > user-defined keywords. I think a year ago I was under the misunderstanding that you couldn’t add your own tags, because every time I had tried, I had done a mixedCase tag so I could easily identify it; I later learned that the lexer requires the keyword list to be all lowercase (which I thought was an odd limitation, because HTML itself is case-insensitive for tag names – but it has to do with the way that the lexer lowercases the tag text before comparing it to the list). So sorry for the misinformation last year.

    Further, as I recently learned, the HTML lexer has the ability to enable “substyles” for the HTML TAG style, which you can assign your own color and your own list of keywords – so you could style your custom tags differently than the builtin tags if you want. Unfortunately, Notepad++ doesn’t (yet) enable those substyles, so you cannot do it natively in Notepad++. In this post, I share a script for the PythonScript which enables substyles – that specific post gives the example for PHP, but if you want to do the same for HTML, you would follow the same instruction, except edit the lists in class HTML_SubstyleLexer and append your colors/list definitions to the SCE_H_TAG in that class’s colorize.

  • How to use Windows default icons with Notepad++

    2
    0 Votes
    2 Posts
    198 Views
    PeterJonesP

    @educatedllama ,

    Search the internet for "windows 11" how do I change the icon for a specific filetype (or "windows 10" or whatever version of Windows you have). The answer is the same whether or not you use Notepad++.

  • SHIFT+left-click needs to select top-down not bottom-up

    13
    0 Votes
    13 Posts
    690 Views
    Alan KilbornA

    @mkupper said in SHIFT+left-click needs to select top-down not bottom-up:

    While the PythonScript is just two lines long implementing it may be technically challenging. In summary

    Good summary for this specific case.
    For the general case with a bit more hand-holding, see the FAQ entry.

    If you do Edit / Select All from Notepad++'s drop down menus then you will still get the old “broken” version of select-all

    Note that it is only “broken” in terms of how the OP thinks about it. There is no bug with Select All, just because Notepad++ happens to do it differently from some other editors.

  • HexEditor Plugin Compare Hex Dimmed

    4
    0 Votes
    4 Posts
    819 Views
    Lycan ThropeL

    @PeterJones ,
    Doh…I guess I should have tried that, too. :sigh: Oh well, that’s why there’s many eyes here just for that reason.
    Just a note, I still don’t like the way it resets my UI menu items to white, and also missing files options, even when the two compared files are closed. So I’ve uninstalled it again. Luckily, I don’t often compare binary files.

  • Preview HTML 32-bit Plugin package hash mismatched

    6
    0 Votes
    6 Posts
    741 Views
    rdipardoR

    Installation via Plugins Admin will be possible in the next release of Notepad++ https://github.com/notepad-plus-plus/nppPluginList/pull/795

    Any other issues with the plugin should be sent here: https://github.com/rdipardo/npp_preview/issues

  • Disable opening image files

    11
    0 Votes
    11 Posts
    389 Views
    mkupperM

    @wicked-clown said in Disable opening image files:

    I need to only open htm files but it loads images to when i drag and drop.

    Most things that show a list of files offer a way to filter the list by file type or extension.

    For example, with Windows Explorer type Ctrl-F to get to the search box in the upper-right corner and type ext:htm to only see the HTML files. You can then drag/drop what is shown into Notepad++ and there should be no image files.

  • g code into document.

    2
    0 Votes
    2 Posts
    319 Views
    Alan KilbornA

    @MrDee

    See HERE.

  • 0 Votes
    2 Posts
    140 Views
    PeterJonesP

    @Arsalan-M ,

    Notepad++ doesn’t currently have that option. When it installs, it adds an “Edit With Notepad++” for all files, not just known filetypes; you can either keep that for current behavior, or disable it (following the instructions in my final paragraph).

    That feature is useful to people who suddenly get a file with a non-normal extension, and want to be able to use the right-click to open it. Or people who do use Notepad++ for looking at binary files (maybe with the HexEdit plugin), so would not find it out of the ordinary to look at a .png file in that setup.

    The issue with this is that there are a lot of apps with useless or nonsensical submenu entries

    Notepad++ is adding one entry – because many users over decades of use want it and/or have at least grown accustomed to it being there. In fact, when Windows 11 changed the way that applications must interact to get their “Edit with Notepad++” entry, there were many, MANY complaints to this forum and directly to the Developer, begging (no, insisting) that Notepad++ put itself back in the main right-click menu.

    causes loading times at some point

    Loading times of what? Notepad++'s loading time shouldn’t be influenced by whether or not is has an entry in the OS Right Click menu. And I would find it hard to believe, without hard data, that Notepad++'s single entry in the right click menu measurably increases the time to load the right click menu, or to load another application, or to load/boot the OS. Do you have real data that proves otherwise – for Notepad++ (not just “some other apps entries slow it down, so I feel like I can claim that Notepad++'s does”)?

    However, if you don’t like that entry: If you get rid of Notepad++'s C:\Program Files\Notepad++\contextMenu\NppShell.dll (you might have to follow the uninstall/unregister instructions in the user manual’s Right Click > Manual Installation/Registration section before it will allow you to remove it), then reboot, then the all-filetypes Right Click entry won’t be there. You would then have to use the OS’s “Open With” feature from the Right Click menu, instead of Notepad++'s specific entry, to allow right-click and/or double-click access for a given filetype (depending on whether you say “always open with Notepad++” or not).

  • How to change Tab key behavior

    6
    0 Votes
    6 Posts
    2k Views
    PeterJonesP

    @Hellena-Crainicu ,

    Those are the keystrokes for indenting or unindenting while editing. The original post (from three years ago, which was already sufficiently and correctly answered) was asking how to change whether the Tab key would insert spaces or ASCII tab characters, not asking how to indent or unindent.

  • Keyboard shortcut for going to Tab #1

    4
    0 Votes
    4 Posts
    4k Views
    PeterJonesP

    @Hellena-Crainicu ,

    Those are the keystrokes for indenting or unindenting while editing. It has nothing to do with this 4-year-old question about how to change tabs (that is, change which file is active when you have multiple files open in Notepad++), which was already correctly and completely answered four years ago.

  • Assigning a Shortcut Key to Python script.

    2
    0 Votes
    2 Posts
    152 Views
    Terry RT

    @Luis-Piña-III said in Assigning a Shortcut Key to Python script.:

    I installed Python script and successfully created a new script but have no idea how to assign a shortcut to it.

    Well an obvious place to look might have been the FAQ posts, specifically:
    this post.

    Terry

  • Insert new lines

    5
    0 Votes
    5 Posts
    251 Views
    Les forges de CalianeL

    hello @gerdb42

    It works very well. your kungfu is powerful. thank you very much for the help. and thank you for the link, I will look into it.

  • Pop-under during install

    2
    1 Votes
    2 Posts
    149 Views
    Alan KilbornA

    @Graham-Norris

    The place to report bugs is found by reading HERE.

  • Remove duplicates if only part of the string matches

    13
    0 Votes
    13 Posts
    752 Views
    Jim DaileyJ

    I made some silly mistakes (several syntax errors) in the AWK script above. Also, the additional code in the END block won’t print the total number of times each prefix appeared as I intended. This script does, however:

    { split($0, Parts, /:/) # Parts[1] <- text before the ":". if (!(Parts[1] in Prefixes)) { # If we've NOT seen this prefix ... print Parts[1] # ... print it. } Prefixes[Parts[1]]++ # Count this prefix. } END { for (p in Prefixes) { # Print # of times we saw each one. printf("Prefix '%s' appeared %d times.\n", p, Prefixes[p]) } }
  • search something and replace it with the file name of the file at hand

    10
    0 Votes
    10 Posts
    649 Views
    Christos Glavopoulos - adjuster GRC

    @Terry-R said in search something and replace it with the file name of the file at hand:

    @Christos-Glavopoulos-adjuster-GR

    With a test file open in Notepad++ complete the following:

    Menu option Macro, then Start Recording. Ctrl + Home key. This places the cursor at the very start of the file. Use the Find function with the string/regex (see Note-1 below) to find the string. Click on Find Next, then click Close. So at this point the string you are searching for should be highlighted. Menu option Edit, then select Copy to Clipboard. At this point you need to identify which sub-option you want. It will most likely be “Copy Current Filename”, but you may want the first option “Copy Current Full File Path” which includes the path with the filename. Ctrl + V. Paste the clipboard content to the current cursor position. Ctrl + S then Ctrl + W. Save current file and then close current file. Menu option Macro, then Stop Recording.

    I have tried your solution @Terry-R and it worked like a charm.

    Many many Thanks

    Christos

  • Data corrupt after upgrade to 8.6.9

    2
    0 Votes
    2 Posts
    170 Views
    mkupperM

    @TwiceCake said in Data corrupt after upgrade to 8.6.9:

    I have important notes.

    The content is all disappear.

    Does anyone encounter same problem too?

    Yes, a key common element is people who fail to back up or make copies of their important notes.

    Take a look at FAQ: Periodic Backup vs AutoSave as it’s possible you had already enabled one of the backup mechanism that are available for Notepad++.

  • Searching a file for numbers with a specific number of digits.

    6
    0 Votes
    6 Posts
    1k Views
    Mark OlsonM

    logi-tech said:

    What If I wanted to search for a specific number for example : 3XXXXX5849

    This user has asked the same question three times in three different threads. At this point, I’m pretty sure they’re a bot fishing for upvotes.

    We should stop dignifying them with replies until they prove they’re human.

  • I'm trying to find specific numbers.

    2
    -1 Votes
    2 Posts
    116 Views
    Mark OlsonM

    @logi-tech
    Use the Find/replace form (Search->Find... from the main menu).
    Find what: 3[0-9]{5}5849
    Search Mode: Regular Expression

    Here’s a useful reference on the regular expression I wrote. You could also use 3\d{5}5849 for the same effect.

  • Notepad++ for. Android

    3
    0 Votes
    3 Posts
    329 Views
    Arthur VerburgA

    @Ekopalypse said in Notepad++ for. Android:

    @Arthur-Verburg

    Is there any way to have notepad++ working in android?

    No, because Npp relies on the Windows API.

    If not so is there something like it?

    I don’t know.

    Thank you

  • Notepad 8.6.9 bug using Windows 7

    2