Hi, [EMAIL PROTECTED] schrieb: > > I am trying to automate this: > > There is a file, which contains one path/filename at each line. > Lines with equal files (contents wise) are grouped together. Groups > are separated by "# ---' (or whatever you want). > > To sort the lines of one group only I want to put the group into a > visual block (correcht naming?) as part of a macro.
you don't need a visual block here. Say you have the following file # --- 3.txt 2.txt 1.txt # --- 6.txt 5.txt 4.txt # --- 9.txt 7.txt 8.txt # --- Then :g/^# ---/+1,/^# ---/-1!sort will sort it by file names inside your "groups". This command will emit an error message "E16: Invalid range" for the last marker, which you can safely ignore. Regards, Jürgen -- Sometimes I think the surest sign that intelligent life exists elsewhere in the universe is that none of it has tried to contact us. (Calvin)