Community

    • Login
    • Search
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search

    Alt-Up/Down Arrow Line Movement

    General Discussion
    alt-down arrow alt+up arrow
    4
    7
    6112
    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 Ries
      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 Chuh 1 Reply Last reply Reply Quote 1
      • Meta Chuh
        Meta Chuh @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 7
        • guy038
          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 Kilborn 1 Reply Last reply Reply Quote 4
          • Edward Ries
            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 Kilborn
              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
              • guy038
                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 Kilborn 1 Reply Last reply Reply Quote 2
                • Alan Kilborn
                  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
                  • First post
                    Last post
                  Copyright © 2014 NodeBB Forums | Contributors