1

I see that Vim has an n option for sorting based on the first decimal number on the line, but I'm looking for something like the -V, --version-sort option in the Linux sort command:

 -V, --version-sort
          natural sort of (version) numbers within text
4
  • I don't want to assume: are you aware that you can use external commands to manipulate vim's buffers?
    – MDeBusk
    Nov 22, 2022 at 1:19
  • @MDeBusk, thanks for the tip. I wasn't aware of that.
    – Matt
    Nov 23, 2022 at 2:20
  • I suspect you are referring to read, write, and filter. Now I need to learn how to combine them with text objects.
    – Matt
    Nov 23, 2022 at 2:39
  • 2
    I'd visually select the lines I wanted to sort and type :!sort -V
    – MDeBusk
    Nov 23, 2022 at 15:28

1 Answer 1

2

Echoing @MDeBusk's answer in the comments for better visibility:

I'd visually select the lines I wanted to sort and type :!sort -V

1
  • In particular, ! is also an operator, so, e.g., !ipsort -V<enter> does what you might hope
    – D. Ben Knoble
    Apr 30, 2023 at 18:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.