Community
    • Login

    Alt-Up/Down Arrow Line Movement

    Scheduled Pinned Locked Moved General Discussion
    alt-down arrowalt+up arrow
    9 Posts 5 Posters 15.1k 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.
    • Edward RiesE
      Edward Ries
      last edited by

      I wanted to propose a minor feature. I didn’t see a feature request section other than plug-ins which this doesn’t sound like a plug-in as much as a core feature. Visual Studio allows moving a line of text up or down by pressing ALT-UP ARROW or ALT-DOWN ARROW.

      Thanks for the consideration.

      Meta ChuhM 1 Reply Last reply Reply Quote 0
      • Meta ChuhM
        Meta Chuh moderator @Edward Ries
        last edited by Meta Chuh

        welcome to the notepad++ community, @Edward-Ries

        to move a line up or down using the cursor keys, please press ctrl+shift+up or ctrl+shift+down in notepad++.
        (this shortcut triggers edit > line operations > move up/down current line)

        you can customise and change this default keyboard shortcut to your desire at the notepad++ menu settings > shortcut mapper.

        best regards.

        1 Reply Last reply Reply Quote 5
        • guy038G
          guy038
          last edited by guy038

          Hello, @edward-ries and All,

          I just want to add an important point to @meta-chuh post : the Ctrl + Shift + Up and Ctrl + Shift + Down actions also act on selections, too, whatever its size !

          Note that, in case of multi-selections ( using the Ctrl key ) :

          • All the additional selections are appended to the main selection, in their order of creation, first

          • Secondly, all the resulting block of lines is moved up or down, accordingly :

          Cheers,

          guy038

          Alan KilbornA 1 Reply Last reply Reply Quote 3
          • Edward RiesE
            Edward Ries
            last edited by

            That’s awesome, I was able to easily remap to alt-up and alt-down. I’m very pleased.

            1 Reply Last reply Reply Quote 1
            • Alan KilbornA
              Alan Kilborn @guy038
              last edited by

              @guy038

              Multi-selections with this yield results that are not expected. Can you explain why you seem to think the behavior you get when doing this is desirable?

              1 Reply Last reply Reply Quote 1
              • guy038G
                guy038
                last edited by guy038

                Hello @alan-kilborn and All,

                To be honest, Alan, I’ve never used yet, these shortcuts with multi-selections ! but, while preparing my reply to @edward-ries, I asked myself : what about multi-selections, while using the Ctrl + Shift + Down and Ctrl + Shift + Up shortcuts ? And I just described the way N++ gathers all the selections before moving, which seemed logic to me ;-)) Of course, I understand that, most of time, this result is not desirable at all !

                However, note that I very frequently use these two shortcuts when acting on the main selection of a block of consecutive lines !!

                Best Regards,

                guy038

                Alan KilbornA 1 Reply Last reply Reply Quote 2
                • Alan KilbornA
                  Alan Kilborn @guy038
                  last edited by

                  @guy038 said:

                  I very frequently use these two shortcuts when acting on the main selection of a block of consecutive lines !!

                  Oh, yes; absolutely for the single-selection case. It is very nice that you don’t even have to have complete lines at the start or end of block selected first; the void Editor::MoveSelectedLines() function takes care of moving your selection to the proper place for you, before moving the lines up/down.

                  But truly, the multiselection case boggles the mind. Of course, this is different from a lot of editing actions, where multiselections are ignored and only the “main” selection (the most recent one made) is manipulated.

                  1 Reply Last reply Reply Quote 3
                  • Jay ImermanJ
                    Jay Imerman
                    last edited by

                    While Ctrl+Shift+arrow is equivalent, let me please second this request. I am willing to bet that Notepad++ is not the only text editor that anyone who uses it uses (and I am not a betting man). Personally, I use many, and several of them use Alt+arrow.

                    In today’s software ecosystem, it is much more user-friendly to align on common features. Also, having different access to the same feature leads to confusion, mistakes, and so on. This one is so useful, and currently Alt+arrow is not used in Notepad++. How about having both Alt+ and Ctrl+Shift+ doing the same thing, that way it is maximum compatibility, and for those used to it they can keep using it? But for compatibility across environments (like Visual Studio, VS Code, Windows Text Editor, etc.) the Alt+ combos are ubiquitous.

                    Alan KilbornA 1 Reply Last reply Reply Quote 0
                    • Alan KilbornA
                      Alan Kilborn @Jay Imerman
                      last edited by

                      @Jay-Imerman said in Alt-Up/Down Arrow Line Movement:

                      let me please second this request

                      If this is truly a request, it’s in the wrong place.
                      See HERE.

                      But, I’d say…don’t bother making it an official request, as it is very likely to be denied. The author long ago created the ability to remap commands to different keycombos, so users should avail themselves of that.

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