• Login
Community
  • Login

Is there any subword navigation support?

Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
17 Posts 6 Posters 736 Views
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • E
    Earth Invader
    last edited by Mar 20, 2022, 2:09 PM

    It seems not to be found from shortcut or main menu. I tried search “subword” in the forum and returned no result. Is there no subword navigation support in notepad++ yet?

    P 1 Reply Last reply Mar 20, 2022, 2:35 PM Reply Quote 0
    • P
      PeterJones @Earth Invader
      last edited by Mar 20, 2022, 2:35 PM

      @earth-invader ,

      What is a “subword”, and what kind of support should Notepad++ give you while navigating it?

      E 1 Reply Last reply Mar 20, 2022, 3:01 PM Reply Quote 0
      • E
        Earth Invader @PeterJones
        last edited by Earth Invader Mar 20, 2022, 3:02 PM Mar 20, 2022, 3:01 PM

        @peterjones Subword navigation is a shortcut that help move the cursor between CamelCase words.

        For example, when holding down Alt key and press L/R, the text cursor will jump like these:

        MetaCard<|>SpecialBonus // <|> is the cursor position
        MetaCardSpecial<|>Bonus // Alt + Right
        Meta<|>CardSpecialBonus // Alt + Left + Left
        MetaCardSpecialBonus<|> // Alt + End
        MetaCardSpecial<|> // Alt + Del

        • there is no space in “MetaCardSpecialBonus”, its usually a function or variable name.

        Many text editors that support code editing has some degree of subword navigation support already. e.g. Atom, sublime.

        A 1 Reply Last reply Mar 20, 2022, 3:03 PM Reply Quote 1
        • A
          Alan Kilborn @Earth Invader
          last edited by Mar 20, 2022, 3:03 PM

          @earth-invader

          IMO that behavior isn’t all that useful.
          But…there is no native support for it in N++, AFAIK.
          However, it would be easy to script such a thing.

          E D 2 Replies Last reply Mar 20, 2022, 3:11 PM Reply Quote 0
          • E
            Earth Invader @Alan Kilborn
            last edited by Mar 20, 2022, 3:11 PM

            @alan-kilborn
            It really depends on the behaviour of the user. I too think the same as you before I get used to it. Now I feel weird when its not there. It increase productivity even if its just a little bit. Everything adds up.

            N 1 Reply Last reply Mar 20, 2022, 3:18 PM Reply Quote 0
            • N
              Neil Schipper @Earth Invader
              last edited by Mar 20, 2022, 3:18 PM

              @earth-invader A macro (with a shortcut assigned) that does a regex find for any of these [ { ( < gets you 87% - 94% of the way there, no?

              If you want to try it, expression is \\[|{|\(|<

              E 1 Reply Last reply Mar 20, 2022, 3:32 PM Reply Quote 0
              • E
                Earth Invader @Neil Schipper
                last edited by Earth Invader Mar 20, 2022, 3:32 PM Mar 20, 2022, 3:32 PM

                @neil-schipper

                It is not about searching certain symbol.

                Here is a gif to show how it works:

                GIF link

                N 1 Reply Last reply Mar 20, 2022, 3:52 PM Reply Quote 0
                • N
                  Neil Schipper @Earth Invader
                  last edited by Mar 20, 2022, 3:52 PM

                  @earth-invader Ah, I see. A format like

                  <one upper case char><a run of lower case chars>

                  is needed. Expression: (?-i)\u\l+

                  This has some limitations which can be overcome, but first want to know if you’re interested.

                  E 1 Reply Last reply Mar 20, 2022, 3:58 PM Reply Quote 1
                  • E
                    Earth Invader @Neil Schipper
                    last edited by Mar 20, 2022, 3:58 PM

                    @neil-schipper
                    Thanks for the workaround but it could probably be more troublesome for me to remember another shortcut so I will just press my keyboard harder for now. Hope Notepad++ could support it in the future.

                    A 1 Reply Last reply Mar 20, 2022, 4:07 PM Reply Quote 0
                    • A
                      Alan Kilborn @Earth Invader
                      last edited by Mar 20, 2022, 4:07 PM

                      @earth-invader said in Is there any subword navigation support?:

                      Thanks for the workaround but it could probably be more troublesome for me to remember another shortcut

                      Make a macro of what @Neil-Schipper said, then assign the running of the macro to whatever keycombo you want using the ShortcutMapper. If you map it to what you’re used to with other editors, then what’s to remember??

                      E 1 Reply Last reply Mar 20, 2022, 4:28 PM Reply Quote 0
                      • E
                        Earth Invader @Alan Kilborn
                        last edited by Mar 20, 2022, 4:28 PM

                        @alan-kilborn

                        It is not that simple.

                        I just tried recorded a macro Atl+L that simulate pressing Ctrl+L a few times. (jump to left across a few words)

                        When I hold Shift + Alt + L, it doesn’t not select the characters that it jump over.
                        The behaviour is just different from what a native subword navigation would do.
                        If I need to record all the combinations, that would also be a lot of work .
                        e.g. Shift to select, Backspace, Delete, Home, End, …

                        N A 2 Replies Last reply Mar 20, 2022, 4:49 PM Reply Quote 0
                        • N
                          Neil Schipper @Earth Invader
                          last edited by Neil Schipper Mar 20, 2022, 4:50 PM Mar 20, 2022, 4:49 PM

                          @earth-invader:

                          1. Ignore what @alan-kilborn said!
                          2. Pay attention to what @alan-kilborn said!

                          Expanding:

                          Make a macro of what @Neil-Schipper said…

                          I can see that inability to search left/up as being something of a dealbreaker in this context (which reminds that a regex that searched backwards, even if dumbed down somewhat {when used in that direction, and with limitations well documented}, would find good use).

                          … script such a thing.

                          This is the way to go.

                          1 Reply Last reply Reply Quote 3
                          • A
                            Alan Kilborn @Earth Invader
                            last edited by Mar 20, 2022, 4:54 PM

                            @earth-invader said in Is there any subword navigation support?:

                            It is not that simple.

                            Well, it is…on a demo basis…to try some basic functionality out…

                            But yes, really what is needed here is a “script” that can build in all the “smarts” that are needed.

                            1 Reply Last reply Reply Quote 1
                            • D
                              dail @Alan Kilborn
                              last edited by Mar 20, 2022, 9:11 PM

                              @alan-kilborn said in Is there any subword navigation support?:

                              @earth-invader

                              IMO that behavior isn’t all that useful.
                              But…there is no native support for it in N++, AFAIK.
                              However, it would be easy to script such a thing.

                              Scintilla has commands associated with word part navigation. However I’m not sure if Notepad++ exposes these to be mapped to shortcuts or not.

                              Michael VincentM 1 Reply Last reply Mar 20, 2022, 9:22 PM Reply Quote 3
                              • Michael VincentM
                                Michael Vincent @dail
                                last edited by Mar 20, 2022, 9:22 PM

                                @dail said in Is there any subword navigation support?:

                                Scintilla has commands associated with word part navigation. However I’m not sure if Notepad++ exposes these to be mapped to shortcuts or not.

                                @Earth-Invader

                                They are:

                                fdd69a28-8698-43cb-814d-2f8c8c32b65c-image.png

                                Cheers.

                                N E 2 Replies Last reply Mar 20, 2022, 9:35 PM Reply Quote 7
                                • N
                                  Neil Schipper @Michael Vincent
                                  last edited by Mar 20, 2022, 9:35 PM

                                  @michael-vincent Funny, I just started playing around with those like in the last 24 hrs (and gave them a mention in a post in a different thread). I’d been wondering, “why do these even exist? they’re just annoying or crippled versions of Ctl-<arrow>”, which they are… in the absence of CamelCase.

                                  Your post clued me in.

                                  1 Reply Last reply Reply Quote 2
                                  • E
                                    Earth Invader @Michael Vincent
                                    last edited by Mar 22, 2022, 11:00 PM

                                    @michael-vincent
                                    Thanks

                                    1 Reply Last reply Reply Quote 0
                                    1 out of 17
                                    • First post
                                      1/17
                                      Last post
                                    The Community of users of the Notepad++ text editor.
                                    Powered by NodeBB | Contributors