I'd like to use the vim sort command to start sorting at a certain position. Without installing any plugins.
2011-09-17 00:37 |Free|ALL RIGHT NOW
2011-09-17 00:41 |Kim Wilde|CAMBODIA
2011-09-17 00:45 |Take That|NEVER FORGET
2011-09-17 00:53 |Visage|FADE TO GREY
2011-09-17 00:56 |SUTHERLAND BROTHERS & QUIVER|ARMS OF MARY
The command :sort u
starts at position 1.
In the example the artist name starts at position 20, so I'd like to start sorting there.
This is the result I'd like to get
2011-09-17 00:37 |Free|ALL RIGHT NOW
2011-09-17 00:41 |Kim Wilde|CAMBODIA
2011-09-17 00:56 |SUTHERLAND BROTHERS & QUIVER|ARMS OF MARY
2011-09-17 00:45 |Take That|NEVER FORGET
2011-09-17 00:53 |Visage|FADE TO GREY
Is this something easily done without plugins or should not attempt that? Google spits out a lot of user defined scripts, but nothing working out of the box...
Out of the box, you can sort starting at a virtual column
:sort /\%20v/
from :help :sort
You can skip the first part of the line (until the "|" char) in your sort by the VIM command:
:sort /^[^|]*/
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