comparison runtime/ftplugin/php.vim @ 1622:149d8b46404c

updated for version 7.2a
author vimboss
date Tue, 24 Jun 2008 22:09:24 +0000
parents 96cd8222a819
children 7bc41231fbc7
comparison
equal deleted inserted replaced
1621:82b5078be2dd 1622:149d8b46404c
1 " Vim filetype plugin file 1 " Vim filetype plugin file
2 " Language: php 2 " Language: php
3 " Maintainer: Dan Sharp <dwsharp at hotmail dot com> 3 " Maintainer: Dan Sharp <dwsharp at hotmail dot com>
4 " Last Changed: 2006 Jul 15 4 " Last Changed: 2007 Nov 10
5 " URL: http://mywebpage.netscape.com/sharppeople/vim/ftplugin 5 " URL: http://mywebpage.netscape.com/sharppeople/vim/ftplugin
6 6
7 if exists("b:did_ftplugin") | finish | endif 7 if exists("b:did_ftplugin") | finish | endif
8 8
9 " Make sure the continuation lines below do not cause problems in 9 " Make sure the continuation lines below do not cause problems in
40 endif 40 endif
41 41
42 " ### 42 " ###
43 " Provided by Mikolaj Machowski <mikmach at wp dot pl> 43 " Provided by Mikolaj Machowski <mikmach at wp dot pl>
44 setlocal include=\\\(require\\\|include\\\)\\\(_once\\\)\\\? 44 setlocal include=\\\(require\\\|include\\\)\\\(_once\\\)\\\?
45 setlocal iskeyword+=$ 45 " Disabled changing 'iskeyword', it breaks a command such as "*"
46 " setlocal iskeyword+=$
47
46 if exists("loaded_matchit") 48 if exists("loaded_matchit")
47 let b:match_words = '<?php:?>,\<switch\>:\<endswitch\>,' . 49 let b:match_words = '<?php:?>,\<switch\>:\<endswitch\>,' .
48 \ '\<if\>:\<elseif\>:\<else\>:\<endif\>,' . 50 \ '\<if\>:\<elseif\>:\<else\>:\<endif\>,' .
49 \ '\<while\>:\<endwhile\>,' . 51 \ '\<while\>:\<endwhile\>,' .
50 \ '\<do\>:\<while\>,' . 52 \ '\<do\>:\<while\>,' .
53 \ '(:),[:],{:},' . 55 \ '(:),[:],{:},' .
54 \ s:match_words 56 \ s:match_words
55 endif 57 endif
56 " ### 58 " ###
57 59
58 if exists('&ofu') 60 if exists('&omnifunc')
59 setlocal ofu=phpcomplete#CompletePHP 61 setlocal omnifunc=phpcomplete#CompletePHP
60 endif 62 endif
61 63
64 " Section jumping: [[ and ]] provided by Antony Scriven <adscriven at gmail dot com>
65 let s:function = '\(abstract\s\+\|final\s\+\|private\s\+\|protected\s\+\|public\s\+\|static\s\+\)*function'
66 let s:class = '\(abstract\s\+\|final\s\+\)*class'
67 let s:interface = 'interface'
68 let s:section = '\(.*\%#\)\@!\_^\s*\zs\('.s:function.'\|'.s:class.'\|'.s:interface.'\)'
69 exe 'nno <buffer> <silent> [[ ?' . escape(s:section, '|') . '?<CR>:nohls<CR>'
70 exe 'nno <buffer> <silent> ]] /' . escape(s:section, '|') . '/<CR>:nohls<CR>'
71 exe 'ono <buffer> <silent> [[ ?' . escape(s:section, '|') . '?<CR>:nohls<CR>'
72 exe 'ono <buffer> <silent> ]] /' . escape(s:section, '|') . '/<CR>:nohls<CR>'
62 73
63 setlocal commentstring=/*%s*/ 74 setlocal commentstring=/*%s*/
64 75
65 " Undo the stuff we changed. 76 " Undo the stuff we changed.
66 let b:undo_ftplugin = "setlocal cms< inc< isk<" . 77 let b:undo_ftplugin = "setlocal commentstring< include< omnifunc<" .
67 \ " | unlet! b:browsefilter b:match_words | " . 78 \ " | unlet! b:browsefilter b:match_words | " .
68 \ s:undo_ftplugin 79 \ s:undo_ftplugin
69 80
70 " Restore the saved compatibility options. 81 " Restore the saved compatibility options.
71 let &cpo = s:save_cpo 82 let &cpo = s:save_cpo