I think function below should do the trick (you need to execute in the
quickfix window):
function! FoldFiles()
normal zE
let lnum = 1
let currFname = ''
let foldStart = 1
let foldEnd = 0
while lnum <= line('$')
let line = getline(lnum)
let fnamePos = stridx(line, '|')
if fnamePos > -1
let fname = strpart(line, 0, fnamePos)
if fname == currFname
let foldEnd = lnum
else " new file name
if foldEnd > 0
exec foldStart.','.foldEnd.'fold'
endif
let currFname = fname
let foldStart = lnum
let foldEnd = lnum
endif
endif
let lnum += 1
endwhile
if foldStart > 0 && foldEnd > 0
exec foldStart.','.foldEnd.'fold'
endif
endfunction
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
No comments:
Post a Comment