Asis Hallab
unread,Dec 5, 2010, 4:28:57 AM12/5/10Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to vim...@googlegroups.com
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