Hi WL!
On Do, 04 Jun 2009, WL wrote:
> 1. say I want to perform an action on all modified buffers. Like
> performing compress or just echo their name. how is it done?
> I read about bufdo and assume the answer lies in that direction.
This echoes the name of all modified buffers:
set hidden
:bufdo if &modified | echo bufname("%") 'modified!' |sleep 1 | endif
> 2. More complex. Say I want to execute a shell (bash) command on all
> buffers. For the buffers that the shell command succeeds (i.e. returns
> 0) perform some action. This can be useful for example to compress all
> files larger than a given size, checking in all checked-out source
> files at the end of editing session etc.
> what I had in mind is something along the lines of:
> :silent bufdo !if test_cmd % > /dev/null ; then execute_desired_cmd
> % ; fi
Not sure. Probably depends on what exactly you are trying to achieve.
regards,
Christian
--
:wq!
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---