I know that it's very easy to do sort operations in vim through build in command sort
.
But how to sort just one line and text within that line horizontally?
e.g. from this point (aaa ccc bbb)
to this (aaa bbb ccc)
I tried vi(:sort
but it doesn't helped me. Any suggestions?
:s/\s\+/\r/g " break the line into multiple ones
:'[,sort " sort them
:,']j " join them
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With