I use vim to edit Informix 4GL source code which has this sort of syntax:
FUNCTION FOR ... ... END FOR END FUNCTION
I wish to fold the functions using za zM etc
:set foldmarker=FUNCTION,END\ FUNCTION :set foldmethod=marker
However the keywords can also be in lower case and I'd ideally also like to fold MAIN..END MAIN, so markers are not able to do this.
:syn region myFun start="FUNCTION" end="END FUNCTION" transparent fold :set foldmethod=syntax
but it had no effect. I already have a syntax file that does color highlighting and
myFun included in the syntax definitions.
How can I configure case-independent syntax folding of FUNCTION...END FUNCTION and MAIN..END MAIN ?
Update: I have tried http://www.vim.org/scripts/script.php?script_id=2287 but it has some problems:
- It folds at a level of detail I don't want (
- It assumes
ENDstatements start on a new line (so
IF a<b call c() END IFfolds to EOF)
- It thinks
SELECT * FROM table \n FOR UPDATEis the start of a
So I'd like to try creating something much simpler first.