Hi Petsc users!

The error handling in PETSc is really good! I have been using it to track  
down errors. I found an extremely useful Vim mapping, that I would like to  
share. It adds the PETSc error checking by pressing F2 on a line, (put it  
into your ~/.vimrc file if you would like to use/try it):

map <F2> :s_^\([ \t]*\)\([^/]*\\|.*$\)_\1ierr = \2 CHKERRQ(ierr);_<cr>

So when pressing F2 one can change

         MatSetValues(...);
to
         ierr = MatSetValues(...); CHKERRQ(ierr);

-- 
Mads Hoel


Reply via email to