How can I tell Vim to fold GEDCOM files?

65 views Asked by At

GEDCOM files start with a level number 0,1,2, etc., e.g. 2 DATE 10 SEP 1843. The GEDCOM syntax file does not support folding. It should take only a couple of colon commands to tell Vim that it should automatically assign the level number to the line's foldlevel so that zM displays only the level 0 lines, etc. Unfortunately my Vimscript skills are not up to it.

1

There are 1 answers

0
user19235 On

Put these lines inside gedcom.vim:

set foldmethod=expr
foldexpr=getline(v:lnum)