Hello everyone, Hello Christian!

I tried something new with the script Christian Brabandt provided in order
to do something like
argdo with the entries of the quickfix, repective the location-list.

I tried
:vimgrep foo app/**/*rb
:Qfdo %s/foo/bar/gc | update

Unfortunately vim tells me
Not an editor-command: update.

Does anyone have an idea why that error occurs?
And why does it work with argdo and not with Qfdo?

The function and the command are defined as follows,
- thanks to Christian Brabandt:
fun! QFDo(bang, command)
     let qflist={}
     if a:bang
         let tlist=map(getloclist(0), 'get(v:val, ''bufnr'')')
     else
         let tlist=map(getqflist(), 'get(v:val, ''bufnr'')')
     endif
     if empty(tlist)
        echomsg "Empty Quickfixlist. Aborting"
        return
     endif
     for nr in tlist
     let item=fnameescape(bufname(nr))
     if !get(qflist, item,0)
         let qflist[item]=1
     endif
     endfor
     :exe 'argl ' .join(keys(qflist))
     :exe 'argdo ' . a:command
endfunc

com! -nargs=1 -bang Qfdo :call QFDo(<bang>0,<q-args>)


-- 
Asis Hallab

-- 
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

Reply via email to