• Login
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.
  • E
    Edward Ries
    last edited by Jun 18, 2019, 2:03 PM

    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.

    M 1 Reply Last reply Jun 18, 2019, 2:11 PM Reply Quote 0
    • M
      Meta Chuh moderator @Edward Ries
      last edited by Meta Chuh Jun 18, 2019, 2:12 PM Jun 18, 2019, 2:11 PM

      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
      • G
        guy038
        last edited by guy038 Jun 18, 2019, 11:22 PM Jun 18, 2019, 11:22 PM

        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

        A 1 Reply Last reply Jun 20, 2019, 3:27 PM Reply Quote 3
        • E
          Edward Ries
          last edited by Jun 20, 2019, 1:39 PM

          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
          • A
            Alan Kilborn @guy038
            last edited by Jun 20, 2019, 3:27 PM

            @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
            • G
              guy038
              last edited by guy038 Jun 20, 2019, 7:47 PM Jun 20, 2019, 6:43 PM

              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

              A 1 Reply Last reply Jun 20, 2019, 7:13 PM Reply Quote 2
              • A
                Alan Kilborn @guy038
                last edited by Jun 20, 2019, 7:13 PM

                @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
                • J
                  Jay Imerman
                  last edited by Aug 3, 2024, 1:43 PM

                  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.

                  A 1 Reply Last reply Aug 3, 2024, 3:31 PM Reply Quote 0
                  • A
                    Alan Kilborn @Jay Imerman
                    last edited by Aug 3, 2024, 3:31 PM

                    @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