Alt-Up/Down Arrow Line Movement
-
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.
-
welcome to the notepad++ community, @Edward-Ries
to move a line up or down using the cursor keys, please press
ctrl+shift+up
orctrl+shift+down
in notepad++.
(this shortcut triggersedit > 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.
-
Hello, @edward-ries and All,
I just want to add an important point to @meta-chuh post : the
Ctrl + Shift + Up
andCtrl + 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
-
-
That’s awesome, I was able to easily remap to alt-up and alt-down. I’m very pleased.
-
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?
-
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
andCtrl + 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
-
@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.
-
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.
-
@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.