Permalink
Browse files

Added an after ftplugin for late php file config

  • Loading branch information...
1 parent ad47fec commit 5dcf8f8f9987c54c70d13259a38a82d86cdbebb7 @spf13 committed Apr 28, 2010
Showing with 28 additions and 1 deletion.
  1. +4 −1 README.md
  2. +24 −0 after/ftplugin/php.vim
View
@@ -21,6 +21,10 @@ This plugin can fold PHP functions and/or classes, properties with their PhpDoc,
without manually adding marker style folds ({{{ and }}})
[[http://www.vim.org/scripts/script.php?script_id=1623]]
+Can be turned off by setting
+ let g:DisableAutoPHPFolding = 1
+in your .vimrc file.
+
### PHP Doc Gen
Generate phpDocumentor conforming documentation blocks for your PHP code.
@@ -57,4 +61,3 @@ The following plugins are recommended and can be found in my [vim config reposit
* [CheckSyntax](http://www.vim.org/scripts/script.php?script_id=1431)
* [Surrounding](http://github.com/msanders/vim-files/blob/master/plugin/surrounding.vim)
* [AutoCloseTag](http://www.vim.org/scripts/script.php?script_id=2591)
-
@@ -0,0 +1,24 @@
+
+if !exists("g:DisableAutoPHPFolding")
+ let g:DisableAutoPHPFolding = 0
+endif
+
+if !g:DisableAutoPHPFolding
+ " Don't use the PHP syntax folding
+ setlocal foldmethod=manual
+ " Turn on PHP fast folds
+ EnableFastPHPFolds
+endif
+
+" Fix matchpairs for PHP (for matchit.vim plugin)
+if exists("loaded_matchit")
+ let b:match_skip = 's:comment\|string'
+ let b:match_words = '<?\(php\)\?:?>,\<switch\>:\<endswitch\>,' .
+ \ '\<if\>:\<elseif\>:\<else\>:\<endif\>,' .
+ \ '\<while\>:\<endwhile\>,\<do\>:\<while\>,' .
+ \ '\<for\>:\<endfor\>,\<foreach\>:\<endforeach\>' .
+ \ '<\@<=[ou]l\>[^>]*\%(>\|$\):<\@<=li\>:<\@<=/[ou]l>,' .
+ \ '<\@<=dl\>[^>]*\%(>\|$\):<\@<=d[td]\>:<\@<=/dl>,' .
+ \ '<\@<=\([^/?][^ \t>]*\)[^>]*\%(>\|$\):<\@<=/\1>,' .
+ \ '<:>'
+endif

0 comments on commit 5dcf8f8

Please sign in to comment.