Platon Technologies
neprihlásený Prihlásiť Registrácia
SlovakEnglish
open source software development oslavujeme 10 rokov vývoja otvoreného softvéru! Štvrtok, 19. september 2024

Súbor: [Platon] / vimconfig / vim / indent / php.vim (stiahnutie)

Revízia 1.3, Thu Jan 13 11:34:27 2005 UTC (19 years, 8 months ago) by rajo


Zmeny od 1.2: +2 -2 [lines]

Removed ' vb t_vb=' from modeline due new restrictions in vim.

" Vim indent file
" Language:        PHP
" Maintainer:    Lubomir Host 'rajo' <rajo AT platon.sk>
" License:        GNU GPL
" Version:        $Platon: vimconfig/vim/indent/php.vim,v 1.2 2003/11/03 08:20:22 rajo Exp $
"


" Only load this indent file when no other was loaded.
if exists("b:did_indent")
    finish
endif
let b:did_indent = 1

" Is syntax highlighting active ?
let b:indent_use_syntax = has("syntax") && &syntax == "php"

let s:cpo_save = &cpo
set cpo-=C

setlocal cindent
"setlocal indentexpr=GetPhpIndent()
"setlocal indentkeys+=0=,0),0=or,0=and
if !b:indent_use_syntax
    setlocal indentkeys+=0=EO
endif

" Only define the function once.
if exists("*GetPhpIndent")
    finish
endif

function GetPhpIndent()

    " Get the line to be indented
    let cline = getline(v:lnum)

    " Don't reindent coments on first column
    if cline =~ '^//.'
        return 0
    endif

    " Get current syntax item at the line's first char
    let csynid = ''
    if b:indent_use_syntax
        let csynid = synIDattr(synID(v:lnum,1,0),"name")
    endif


    return ind

endfunction

let &cpo = s:cpo_save
unlet s:cpo_save

" Modeline {{{
" vim:set ts=4:
" vim600:fdm=marker fdl=0 fdc=3
" }}}

Platon Group <platon@platon.sk> http://platon.sk/
Copyright © 2002-2006 Platon Group
Stránka používa redakčný systém Metafox
Na začiatok