From c2a13ef3f498d90fb9f46b830e14c31156635676 Mon Sep 17 00:00:00 2001 From: Max Christian Pohle Date: Mon, 9 May 2016 17:00:35 +0200 Subject: moved repository up again this repo shell be used for vim exclusively --- indent/php.vim | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 indent/php.vim (limited to 'indent/php.vim') diff --git a/indent/php.vim b/indent/php.vim new file mode 100644 index 0000000..ef723a6 --- /dev/null +++ b/indent/php.vim @@ -0,0 +1,37 @@ +" Better indent support for PHP by making it possible to indent HTML sections +" as well. +if exists("b:did_indent") + finish +endif +" This script pulls in the default indent/php.vim with the :runtime command +" which could re-run this script recursively unless we catch that: +if exists('s:doing_indent_inits') + finish +endif +let s:doing_indent_inits = 1 +runtime! indent/html.vim +unlet b:did_indent +runtime! indent/php.vim +unlet s:doing_indent_inits +function! GetPhpHtmlIndent(lnum) + if exists('*HtmlIndent') + let html_ind = HtmlIndent() + else + let html_ind = HtmlIndentGet(a:lnum) + endif + let php_ind = GetPhpIndent() + " priority one for php indent script + if php_ind > -1 + return php_ind + endif + if html_ind > -1 + if getline(a:num) =~ "^', 'nWb') + \ || 0 < searchpair('', 'nW')) + return -1 + endif + return html_ind + endif + return -1 +endfunction +setlocal indentexpr=GetPhpHtmlIndent(v:lnum) +setlocal indentkeys+=<>> -- cgit v1.2.3