Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added qfdo

  • Loading branch information...
commit 70b1dc41f272232852dcc11eca2b14fcf5dffe35 1 parent 3dcad4e
Ian Smith-Heisters, Justin Richard & Phan Le authored
Showing with 27 additions and 0 deletions.
  1. +27 −0 init/qfdo.vim
27 init/qfdo.vim
View
@@ -0,0 +1,27 @@
+command! -nargs=+ QFDo call QFDo(<q-args>)
+
+" 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_numbers[fixlist_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
Please sign in to comment.
Something went wrong with that request. Please try again.