How to do search & replace with ack in vim?

I don't believe there's a built in way of doing this, but it should be easy to make one.

I don't believe there's a built in way of doing this, but it should be easy to make one. What you need to do is create a command that calls a custom function. The function should then use the getqflist() function to get all of the entries in the quickfix list and exe to do the dirty work.Be careful what you pass as an argument!

" Define a command to make it easier to use command! -nargs=+ QFDo call QFDo() " Function that does the work function! QFDo(command) " Create a dictionary so that we can " get the list of buffers rather than the " list of lines in buffers (easy way " to get unique entries) let buffer_numbers = {} " For each entry, use the buffer number as " a dictionary key (won't get repeats) for fixlist_entry in getqflist() let buffer_numbersfixlist_entry'bufnr' = 1 endfor " Make it into a list as it seems cleaner let buffer_number_list = keys(buffer_numbers) " For each buffer for num in buffer_number_list " Select the buffer exe 'buffer' num " Run the command that's passed as an argument exe a:command " Save if necessary update endfor endfunction.

Great! Very handy function! – mMontu Sep 16 at 17:11 Suppose you do something like :QFDo v/skipPat/s/Pat/Rep/gce and there is a large list of buffers on quickfix window.

Then on the first file you notice you mistyped the replacement string Rep. Typing Ctrl-c won't stop the command, but only the replace command on current line - it will require a Ctrl-c for every line matched on each buffer. Is there any trick to catch the Ctrl-c or ESC key and break the for statement on function above?

– mMontu Sep 16 at 20:27.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions