let php_htmlInStrings = 1 let php_baselib = 1 let php_folding = 0 " Custom plugin for that let php_noShortTags = 1 let php_parent_error_close = 1 let php_sync_method = 0 let b:surround_{char2nr('-')} = "" let b:surround_{char2nr('=')} = "" " surround area with (...) { } let b:surround_{char2nr('i')} = "if (\1if: \1) {\r}" let b:surround_{char2nr('w')} = "while (\1while: \1) {\r}" let b:surround_{char2nr('f')} = "for (\1for: \1) {\r}" let b:surround_{char2nr('e')} = "foreach (\1foreach: \1) {\r}" " surround area with (...): ?> let b:surround_{char2nr('I')} = "\r" let b:surround_{char2nr('W')} = "\r" let b:surround_{char2nr('F')} = "\r" let b:surround_{char2nr('E')} = "\r" " Look up the word under the cursor on php.net: nmap gm :call OpenURL('http://php.net/manual-lookup.php?pattern=' . expand("")) command! -buffer Outline call lib#Outline('\') if &includeexpr == '' " only if not already set setlocal includeexpr=PhpIncludeExpr(v:fname) endif function! PhpIncludeExpr(fname) let line = getline('.') " Attempt to detect relative include: let fname = lib#ExtractRx(line, '\(require\|include\)\(_once\)\?(\?\s*dirname(__FILE__)\s*\.\s*[''"]\(.\{-}\)[''"]', '\3') if fname != line " Then there really is a relative include return expand('%:p:.:h').fname endif " Catchall case: return a:fname endfunction RunCommand !php %