-
I have that:
I want to put cursor on "line b" (resp. "line c") and have a shortcut to move it up (resp. down). To obtain
Some editor map it to |
Beta Was this translation helpful? Give feedback.
Replies: 8 comments 15 replies
-
I'm not aware of a way to move the current line in the way you've described. Another way to approach this is deleting the whole line and inserting it somewhere else. In your example you can do this by moving your cursor somewhere on Edit: Moving the line up would be |
Beta Was this translation helpful? Give feedback.
-
I have this in my config:
works like in other editors 👍 |
Beta Was this translation helpful? Give feedback.
-
One more way to do this - though, a very different one can be to
Tips:
This last tip above makes it extremely efficient method Source of confusions:
Screen record:movig.line.up.by.rotating.selection.in.helix.in.wezterm-gui_LbE68bA06F.mp4OldResolved/thanks @ CptPotato for sharing A-s
|
Beta Was this translation helpful? Give feedback.
-
Much more indepth discussion: |
Beta Was this translation helpful? Give feedback.
-
After all the great advice, I choose the following:
This really helped my migration to helix |
Beta Was this translation helpful? Give feedback.
-
The answer insert mode doesn't preserve the cursor position, is there a way to fix that and fully replicate line swap up/down functionality? |
Beta Was this translation helpful? Give feedback.
-
None of the suggestions work in Insert Mode. I have it working in Normal Mode (and Select Mode), but Insert Mode executes the same commands differently?? I like to use Shift with the arrow keys to move text up, down, right and left (swap up, swap down, indent, dedent). Being able to easily adjust the indentation as I move a block into a function or out of a loop is really convenient. |
Beta Was this translation helpful? Give feedback.
-
I feel like having a native command would be really great. Especially since natively you could use something like tree sitter to identify the indentation level like they do on JetBrains ides and I feel like its also a feature that would be great in the core version of helix. |
Beta Was this translation helpful? Give feedback.
I have this in my config:
works like in other editors 👍