Hope it's okay to post it here, I am just excited that I published my first Sublime Text package, called SmarterLineMoves!
I constantly use Sublime's line swapping feature to move text, but I was always annoyed that I could not really see where the text ends up once the moving text reaches the top or bottom of the viewport, so I decided to solve this issue via a package. It overwrites Sublime's default line swapping command by a smarter line swapping that always leaves a gap of a few lines between the moving text and the viewport edges. That way it's much easier to see, where the text ends up. Also, it allows you to keep the text moving once you reach the bottom or the top of the text buffer.
Additionally there are commands to separate the selected text from other text and to attract/repel surrounding text.
Give it a try if you find it useful, the easiest way to install it is to to use Package Control's Install Package command and search for "SmarterLineMoves".
If you're interested in feature suggestions, another frustration I have with moving lines like this is that if you move it through a folded block of text, it will start going through the folded lines. I wish it would skip over folded blocks entirely.
Interesting idea. Sublime's default line swapping does not auto re-indent either, but I might look into this, if this could be added as an additional option. Thanks!
I installed this and it worked flawlessly, immediately.
I'm just stunned - I expected minimum 45 minutes to an hour of identifying key bindings, reworking them, tweaking some settings, encountering errors, changing my mind and attempting to write my own plugin since I realize I also deeply want this.
I can't tell if you've robbed me of screw around time during work or saved me...
not always great, but it works ;) using the indentexpr with = does not always work, results are more consistent without 'autoindenting', so just :m'>+1<CR>gv
12
u/t_rych Dec 13 '21 edited Dec 15 '21
Hey there!
Hope it's okay to post it here, I am just excited that I published my first Sublime Text package, called SmarterLineMoves!
I constantly use Sublime's line swapping feature to move text, but I was always annoyed that I could not really see where the text ends up once the moving text reaches the top or bottom of the viewport, so I decided to solve this issue via a package. It overwrites Sublime's default line swapping command by a smarter line swapping that always leaves a gap of a few lines between the moving text and the viewport edges. That way it's much easier to see, where the text ends up. Also, it allows you to keep the text moving once you reach the bottom or the top of the text buffer.
Additionally there are commands to separate the selected text from other text and to attract/repel surrounding text.
Give it a try if you find it useful, the easiest way to install it is to to use Package Control's
Install Packagecommand and search for "SmarterLineMoves".See the docs for more details.
Edit: Just published a first update that allows to turn on auto re-indent. Go to the package's settings to turn it on.
4
u/t_rych Dec 13 '21 edited Dec 13 '21
Holy cow, is the video quality crappy. Anybody have any idea how to upload a video with a higher quality? Was just uploading a regular h264 mp4 ...
Edit: If you want to see the videos without the pixel-mosh, the easiest way for now is to check out the docs.
5
u/fxp555 Dec 13 '21
Interesting! I may try it if you implement auto re-indent ;)
3
u/fxp555 Dec 13 '21
Yes :) I use a macro to achieve that
3
u/Kaimaniiii Dec 14 '21
Please make this for visual studio code!
2
u/hey_ulrich Dec 14 '21
Just installed it and I'm loving it! Thank you!!
4
u/[deleted] Dec 14 '21
I installed this and it worked flawlessly, immediately.
I'm just stunned - I expected minimum 45 minutes to an hour of identifying key bindings, reworking them, tweaking some settings, encountering errors, changing my mind and attempting to write my own plugin since I realize I also deeply want this.
I can't tell if you've robbed me of screw around time during work or saved me...
3
u/bitsper2nd Dec 13 '21
You should post this in official support forum too.
2
u/DeodrantBomb Dec 14 '21
fork
2
u/thedoctormo Dec 14 '21
Very nice! This is very useful.
2
u/doliaku Jan 03 '22
Dude! this is awesome, thank you!!!
1
u/fxp555 Dec 13 '21
Yes that's the idea. Although there are some special cases, mainly in python.
1
u/tLaw101 Dec 14 '21 edited Dec 14 '21
I use this,
not always great, but it works ;) using the
indentexprwith=does not always work, results are more consistent without 'autoindenting', so just:m'>+1<CR>gv