Tuesday, August 21, 2012

Folding of Vim for Beamer

http://sourceforge.net/projects/latex-beamer/forums/forum/319189/topic/1163579
- Create a file ~/.vim/after/syntax/tex.vim with the following content:
-----------------------------
syn region Frame start="\\begin{frame}" end="\\end{frame}" keepend transparent fold
function FoldText()
let line = getline(v:foldstart+1)
let sub = substitute(line, '\\frametitle', '', 'g')
let num = v:foldend - v:foldstart + 1
return " - [" . num . "]" . sub
endfunction
set foldtext=FoldText()
-----------------------------
- Then add to ~/.vimrc :
-----------------------------
set foldmethod=syntax
-----------------------------

No comments:

Post a Comment