> I'm trying to get a few code straightening commands to fire, one after
> another:
> 
> " Cleanup Formating
> command! CleanupWhitespace %s/\s\+$//g
> command! CleanupFrontParens %s/\(if\|elseif\|foreach\|for\)(\([^ ]\)/\1
> ( \2/g
> command! CleanupRearParens %s/\([^ ]\)) {/\1 ) {/g
> command! CleanupFrontBools %s/\([^ ]\)\(&&\|||\)/\1 \2/g
> command! CleanupRearBools %s/\(&&\|||\)\([^ ]\)/\1 \2/g
> noremap <silent>
> <F5> 
> :CleanupWhitespace<Bar>CleanupFrontParens<Bar>CleanupRearParens<Bar>CleanupFrontBools<bar>CleanupRearBools<bar>:nohl<CR>
> 
> Unfortunately, execution stops after the first substitution
> (CleanWhitespace), if nothing is found.  I dug through the help docs,
> couldn't find a way to do this.

Looks like you want the "e" flag to suppress errors when no 
substitution was done:

   %s/.../.../ge

which you can read about at

   :help :s_flags

-tim





--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply via email to