You are not logged in.
Hello, I am doing some programming in Fortran(90) by vim now. One thing I cound not figure out is how to make the folding work. It works great for Latex(latexSuite). Anyone had the same problem?
By the way, it does not work for Python neither
Last edited by horsecool (2009-03-28 05:59:02)
Offline
One thing I cound not figure out is how to make the folding work. It works great for Latex(latexSuite). Anyone had the same problem?
Vim supports different styles of folding, check which one your Latex setup is using with ":set foldmethod?". For more info see ":h folding".
Offline
For latex it is :
foldmethod = manual
But it still does not work for Fortran or python even I already set foldmethod as syntax in .vimrc
Offline
Manual folding will work with any type of file. You must create your own folds with zf<movement>
archlinux - please read this and this — twice — then ask questions.
--
http://rsontech.net | http://github.com/rson
Offline
well, what I want is: when I open the code, it's already folded, just like what vim does in latexSuite.
Isn't that what vim should do when I set foldmethod to be syntax?
Offline
It depends on the foldlevel setting, too. See :help fold-foldlevel
To know or not to know ...
... the questions remain forever.
Offline
I know nothing about fortran, but try different foldmethods. There may not be a syntax fold method for it. Try foldmethod=indent for instance.
Edit: Have you seen this? http://www.unb.ca/fredericton/science/chem/ajit/vim.htm
Last edited by rson451 (2009-03-26 12:27:30)
archlinux - please read this and this — twice — then ask questions.
--
http://rsontech.net | http://github.com/rson
Offline
There is fortran folding implemented in the /usr/share/vim/syntax/fortran.vim syntax module.
Just look at :help fortran -> Sntax folding of fortran files
It requires that you explicitely enable fortran folding by
:let fortran_fold=1
Additionally you can force folding on conditionals and multiline comments trhough
:let fortran_fold_conditionals=1
:let fortran_fold_multilinecomments=1
Folding will then work with the usual foldmethod=syntax setting.
Last edited by bernarcher (2009-03-26 13:21:57)
To know or not to know ...
... the questions remain forever.
Offline
:let fortran_fold=1 works!!!
Haha, thanks a lot!!!
I am so happy~
Offline