For reasons undisclosed, suppose I have many identical README.txt files in a few dozen sub-directories. In my fantasy world, I could run this:
vim --magic-mindreading-flag */README.txt
and rather than editing the files for me in sequence, vim will somehow recognize that they're identical and save my changes to all files simultaneously and magically know what I want.
Please spare me the following:
This is about vim, and how awesome.
Bonus: get vim will to warn if the files aren't identical.
I would use vimdiff
to edit all the README files simultaneously (showing you any differences; you can maximize the current window using CTRL-W |).
Then to save all the files, use a command like :SaveAll
(only saves your arguments, not any other buffers you may have opened).
function SaveAll()
let i = 0
"can't save other files while their buffers are open
exe 'on'
while i < argc()
exe 'w! ' . argv(i)
let i = i + 1
endwhile
endfunction
command SaveAll call SaveAll()