• Syntax highlight % and %% lines differently

    5
    0 Votes
    5 Posts
    355 Views
    PeterJonesP

    @jnbearon said in Syntax highlight % and %% lines differently:

    @Ekopalypse
    I have a problem in that I am already short of Delimiter defs as the language definition form only allows 8 to be set. That then prompts 2 further questions:

    Can I define more than 8 delimiters - by editing the XML file?

    No. The number of colors is compiled into the program, and cannot be changed by a config file.

    Can I assign more than 1 delimiter to a particular colour? (I would be quite happy to bundle a few of the less often used ones into a single colour, but have the more popular ones having their own specified coloured line.

    Yes. You can see an example of this in the “Markdown (preinstalled)” UDL that ships with Notepad++:

    080344fd-fb48-40e5-9ed4-c2a91c9deb6e-image.png

    Just put the space-separated list of open and the space-separated list of close in the same order

  • 0 Votes
    2 Posts
    379 Views
    xomxX

    Known issue, Notepad++ is not a per-monitor DPI aware (V2) app yet. It is a GDI-app, so it needs additional coding to fix such issues.

    Here user reported a successful workaround:
    https://github.com/notepad-plus-plus/notepad-plus-plus/issues/14337#issuecomment-1835791674

  • Replace between two line

    7
    1 Votes
    7 Posts
    430 Views
    guy038G

    Hi, @zoltán-toldi, @coises, @alan-kilborn, @mark-olson and All,

    My previous regex may even be shortened as :

    SEARCH (?-i)^(\t+)(.+?)(\{(?:[^{}]++|(?3))*\})

    REPLACE $1$2{\r\n$1}

    To better understand this second search regex, we can use the free-spacing modifier (?x). Then, the search regex becomes :

    (?x-i) ^ ( \t+ ) ( .+? ) ( \{ (?: [^{}]++ | (?3) )* \} ) 1-----1 2-----2 3-----------------------------3

    So, after finding some leading tabs \t+ and the shorter text .+?, till an opening brace \{, the regex tries to match, either :

    An atomic group of characters, different from an opening and closing braces, followed with a closing brace

    An other group of characters ( the group 3 ), starting with an opening brace \{, which, in turn, can be followed with :

    An atomic group of characters, different from an opening and closing braces, followed with a closing brace

    An other group of characters ( the group 3 ), starting with an opening brace \{, which, in turn can be followed with, either :

    and so on …

    Note that the third group 3 is called, from within the group itself, with the recursive back-reference (?3).

    When a group x is called from inside its own group x, thanks to the (?x) syntax, this always defines a recursive regex !

    Note also that the use of the recursive (?0) syntax would refer to the whole regex $0

    You can control the depth of the recursion by using the {0,x} syntax, instead of the *, after the ending parenthese !

    Just try, against my INPUT example, the following values :

    {0,1} {0,2} {0,3} {0,4}

    You can verify that, with my example, the {0,4} is enough to cover all the cases. Of course, the * quantifier covers an infinite depth of recursion !

    BR,

    guy038

  • Change this gray color bit

    2
    0 Votes
    2 Posts
    202 Views
    Alan KilbornA

    @Jake-Dorr said in Change this gray color bit:

    Where can I change the coloring of that so it matches the orange/gray colors?

    Adjusting settings here (especially Top) will be the best you can do:

    4c2d746d-be24-4870-a6f4-c53d9e840d80-image.png

  • How to remove all data?

    8
    0 Votes
    8 Posts
    2k Views
    Alan KilbornA

    @jasoncom said in How to remove all data?:

    If the real portable version of Notepad++ is unzipped on an external USB flash drive (USB thumb drive) or an external hard drive, does it mean that the real portable version of Notepad++ will not leave any data in the computer (e.g. C:)?

    I believe that is a true statement.

  • Macro - copy and paste part of line

    9
    0 Votes
    9 Posts
    694 Views
    Martin SteinerM

    @Terry-R
    I’m sorry, I probably didn’t express myself very accurately the first time, it could also be the language barrier. However, your help brought me to my goal and now I have two macros that fulfill exactly what I needed and it’s to your credit. Thank you again for your time. :-)

    <Macro name="CopyMIX" Ctrl="no" Alt="no" Shift="no" Key="0"> <Action type="0" message="2345" wParam="0" lParam="0" sParam="" /> <Action type="3" message="1700" wParam="0" lParam="0" sParam="" /> <Action type="3" message="1601" wParam="0" lParam="0" sParam="(?&lt;=\t)([^\t\r\n]+)$" /> <Action type="3" message="1625" wParam="0" lParam="2" sParam="" /> <Action type="3" message="1702" wParam="0" lParam="512" sParam="" /> <Action type="3" message="1701" wParam="0" lParam="1" sParam="" /> <Action type="0" message="2178" wParam="0" lParam="0" sParam="" /> <Action type="2" message="0" wParam="42002" lParam="0" sParam="" /> </Macro> <Macro name="CopyUnity" Ctrl="no" Alt="no" Shift="no" Key="0"> <Action type="0" message="2345" wParam="0" lParam="0" sParam="" /> <Action type="3" message="1700" wParam="0" lParam="0" sParam="" /> <Action type="3" message="1601" wParam="0" lParam="0" sParam="(?&lt;=\t)([^\t\r\n]+)(?=\t)" /> <Action type="3" message="1625" wParam="0" lParam="2" sParam="" /> <Action type="3" message="1702" wParam="0" lParam="512" sParam="" /> <Action type="3" message="1701" wParam="0" lParam="1" sParam="" /> <Action type="0" message="2178" wParam="0" lParam="0" sParam="" /> <Action type="2" message="0" wParam="42002" lParam="0" sParam="" /> </Macro>
  • folder as workspace

    2
    0 Votes
    2 Posts
    166 Views
    Terry RT

    @zeta-orionis
    It’s referenced in the online manual here.

    Terry

  • subscripts

    29
    1 Votes
    29 Posts
    10k Views
    Mark OlsonM

    @Coises said in subscripts:

    The problems you are having are likely to plague those who read your files, too. As I mentioned earlier, it seems likely to me that there is a better way to approach your task. Using Unicode superscript and subscript numbers is usually not a good way to present material in which the superscripts and subscripts are important.

    @Эндрю-Ципихович
    Coises is correct. I would use LaTeX or MathJax to make a document with superscripts and subscripts.

    For example, if I wanted to make

    144689bd-4a9b-4e74-afe1-209c219f6fdf-image.png

    I would write this and use MathJax to render it.

    \log_{10}(x^2) = \sin(y)

    That’s only a tiny fraction of what is possible with LaTeX and MathJax. You can make some very impressive-looking documents from a simple plain-text document once you’re familiar with it.

    But I’m not going to talk any more about LaTeX or MathJax here, because that would be off-topic for this forum.

  • 1 Votes
    4 Posts
    467 Views
    CoisesC

    @mkupper said in Notepad++ Regex to find files having more than 2 words but should exclude certain word:

    It turns out that the not scanner, (?!word3a|word3b) only works on lines, not files, even if you try ``(?-s)(?!word3a|word3b).

    You’re misunderstanding what is going wrong. The expression you gave says, “Match null here if the following characters aren’t either word3a or word3b.” That matches at every position in a file except immediately before word3a or word3b. (Each line is listed once in the search results, but look at the number of hits.) What is needed is (?s)\A(?!.*(word3a|word3b)), which says, “Match null at the beginning of the document if the following characters don’t match any number of arbitrary characters followed by either word3a or word3b.”

    When I tested the whole expression I got some erratic results when I had it match null, which is why I set it to match the string from the beginning up to the word word1.

  • Macro works normally, but fails when shortcut is Ctrl+Shift+C

    8
    1 Votes
    8 Posts
    2k Views
    Mike NewmanM

    @mkupper Just following up here, as I finally got this working correctly. It was indeed another app (Webex in my case) capturing the shortcut first. I typically don’t like to download third-party apps (fourth-party?), but I gave Hotkey Detective a try, and it led me to the culprit.

  • 0 Votes
    10 Posts
    16k Views
    Rayran BritoR

    @Munter-Göök said in How can I find strings between "(" and ")" with any number of characters in between?:

    Thanks Alan! Now it works perfectly.
    The reason I couldn’t find out whyit’s working or not is that is my learning curve. I simply don’t have the time nor the experience needed to understand the syntax. So then I was crying out for help. Anyways this solved my problem and I am greateful.

    It would be nice if succesful solutions like this were to be found in some archive or why not implemented in N++.

    Thanks again!

    I appreciate @Alan-Kilborn for answering and @Munter-Göök for inquiring.
    I’m grateful that you guys were able to solve my problem! This demonstrates the forum’s significance to those who are facing similar issues. 🤜🤛

  • Multiline edititng

    2
    0 Votes
    2 Posts
    248 Views
    RARgamesR

    The solution is to create empty noColumnToMultiSelect.xml file in the config dir of Notpad++

    Very weird way of changing config instead of adding a checkbox in settings

  • GIFT syntax

    4
    0 Votes
    4 Posts
    390 Views
    J

    @fatalvector
    I was just looking for the same thing. There is a very nice user defined language style. I can’t post links here (created an account just for this post).
    You can find the UDL file if you Google for

    "GIFT-Format_byMatthewKuznia.xml"

    The documentation describes how to install it, google for:

    import a udl npp
  • Will Np++ support cursorcolumn like Vim?

    2
    0 Votes
    2 Posts
    224 Views
    PeterJonesP

    @John-Slegers ,

    I recommend two things to help with this:

    View > Show Symbols > Show Space and Tab – this will use special glyphs for the space and tab symbols, to make indentation obvious
    01612359-6a01-4f48-b9bb-55ec1970c056-image.png

    Install the ColumnTools plugin and enable Plugins > ColumnTools > Column Highlight
    cc3569eb-fca8-4f6a-980b-508c7be2581a-image.png
    This puts the “edge column marker” at the current column (the cyan vertical line in the screenshot below)

    The results of these two together:
    c7114b0d-1920-43eb-ace2-bb728212c968-image.png

    You can assign keyboard shortcut to either, to be able to easily toggle them on and off.

    -----
    update: three things, actually. View > Show Symbol > Show Indent Guide
    3bbb3b8d-09c9-4820-8d0e-4d7a4068d697-image.png

    This puts a separate vertical line at every tabstop level; Settings > Preferences > Language > yaml > Tab Size: ____ determines how far apart the Indent Guide lines are.
    2f7ec0ff-4f47-4a16-9ae3-694f9e1ef697-image.png

    And Settings > Style Configurator > Language: Global Styles > Style: Indent guideline style and … > Style: Edge colour will allow you to change the colors for the Indent Guide and the Edge Column Marker, if you don’t like the default gray and cyan for those two.

  • How do I increase numbers by one

    4
    0 Votes
    4 Posts
    729 Views
    dr ramaanandD

    @PeterJones I was finally able to increase the numbers by one, using the methods you elucidated at, “How to install and run a script in Python Script”. Thanks a lot!

  • Notepad++ being ,,Invisible''

    6
    0 Votes
    6 Posts
    1k Views
    Daniel FerreiraD

    @mkupper i made an account just to be able to login and upvote your answer. thank you so much mkupper

  • How to install and run a script in Python Script?

    24
    0 Votes
    24 Posts
    9k Views
    dr ramaanandD

    @PeterJones OK, thanks a lot! “<sup>.*?\[” finds what I want it to find, that is “<sup>\[” with the Regular expression mode turned on. I then put “<sup>[” in the Replace with field and hit “Replace all”

  • Adjusting column spacing and line tracking

    3
    1 Votes
    3 Posts
    663 Views
    Torge WeißT

    Hello Peter,
    thank you so much. It worked out exactly as I wanted.

  • Project files: mark them

    6
  • How to highlight lines with color one by one?

    22
    0 Votes
    22 Posts
    4k Views
    Alan KilbornA

    @Coises said in How to highlight lines with color one by one?:

    …loop through character by character checking SCI_POINTYFROMPOSITION to determine where the wrapping happens

    The original script fires its logic every time the UI is updated (maybe that could be changed to every time the data is modified instead).
    When I wrote the original script, I had “performance” concerns for the script, with moderately-sized files and larger.
    I have even more concerns about that if the script is changed for the newly requested feature for it (which would incorporate the “looping” @Coises mentioned).