Editing php with vim

The PHP-correct-Indenting mode for vim has (for me) problems. That said I must add that I really respect and appreciate the huge effort that has been put in the mode. Thank you.

" Language:     PHP
" Author:       John Wellesz <John.wellesz (AT) teaser (DOT) fr>
" URL:          http://www.2072productions.com/vim/indent/php.vim
" Last Change:  2008 June 7th
" Newsletter:   http://www.2072productions.com/?to=php-indent-for-vim-newsletter.php
" Version:      1.28

(from php.vim)

switch/case

I think 'case' should be aligned one extra level

Example:

// same level
switch ($a) {
case 1:
    break;
}
// one extra
switch ($a) {
    case 1:
        break;
}

Sollution:

let PHP_vintage_case_default_indent = 1

single line comments

If I wanted the comment to be more than one line I would have used '/*'.

let PHP_autoformatcomment = 0

argumentlist vs code-block

Argument lists, and array constructs, is aligned the same way as code-blocks. This makes the code less readable.

 
vim/php.txt · Last modified: 2008/10/22 16:24 by daniel
 
Recent changes RSS feed Creative Commons License Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki