How do you sort a range of lines by length?

Filter Visual Selection with Awk

One way to do this in vim is by filtering the visual selection with awk’s length() function before sorting. For example:

:'<,'> ! awk '{ print length(), $0 | "sort -n | cut -d\\  -f2-" }'

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)