summaryrefslogtreecommitdiff
path: root/vim/after/ftplugin/freefem
diff options
context:
space:
mode:
authorUrbain Vaes <urbain@vaes.uk>2016-03-23 23:25:33 +0000
committerUrbain Vaes <urbain@vaes.uk>2016-03-23 23:25:33 +0000
commitc96931ff008e7be08fbfc6287d3af8fcb2205006 (patch)
tree76d6c512816163ff025d664a667e2587958face3 /vim/after/ftplugin/freefem
parente1145d4fa9cad91e2e1e5d63151b802b9039adcd (diff)
Update hook website
Diffstat (limited to 'vim/after/ftplugin/freefem')
-rw-r--r--vim/after/ftplugin/freefem/folding.vim20
1 files changed, 20 insertions, 0 deletions
diff --git a/vim/after/ftplugin/freefem/folding.vim b/vim/after/ftplugin/freefem/folding.vim
new file mode 100644
index 0000000..7d2f6fd
--- /dev/null
+++ b/vim/after/ftplugin/freefem/folding.vim
@@ -0,0 +1,20 @@
+function! FreeFemFolds()
+ let thisline = getline(v:lnum)
+ if match(thisline,'^/// ') >= 0
+ return ">1"
+ else
+ return "="
+ endif
+endfunction
+
+function! FreeFemFoldText()
+ let startline = getline(v:foldstart)
+ if match(startline,'^/// ') >= 0
+ let title = substitute(startline,'^/// \(.*\)$','\1',"")
+ return '# ' . title
+ endif
+endfunction
+
+setlocal foldmethod=expr
+setlocal foldexpr=FreeFemFolds()
+setlocal foldtext=FreeFemFoldText()