Normal command :sort can sort lines based on column or virtual column (\%c
or \%v
), could the higher level logical column be used as sorting key? Using regular expression looks a little complex for this scenario (the column is around the end of the line?) and it looks similar as what the sort utility does (sork -k
), but sort with this functionality is unavailable on Windows. Vim plug-in will also help.
For example, I'd like to sort the 2 lines below according to the last column separated by comma. My real scenario has much more columns and string pattern. Specify column delimiter will simplify it a lot.
xxx,yyy,zzz,0x123
zzxz,xxxx,yyyy,0x121