I use two mappings for my Fortran (.f90) files

map <F5> <Home>v%zf
map <F6> <Home>zDv%zf

The idea is to create folds for code blocks which are of the form

subroutine some_name_here
   statements_here
end subroutine some_name_here

Here F5 folds the subroutine block irrespective of whether there are any folds 
within it. F6 folds the subroutine block after deleting the existing folds.

However, if there are no folds and if I press F6, I get an error saying that

E490: No fold found

Is it possible to combine these two maps into a single map such that
1) If there are no existing folds, create a fold  (i.e. perform <F5>)
2) If there are already some folds defined, then delete them and define a new 
fold (i.e. perform <F6>)

Any ideas?

thanks
raju

-- 
http://groups.google.com/group/ask-anything/about

Reply via email to