Permalink
Browse files

- Fix for new PHP indenting behavior (contributed by Jakob Westhoff).

git-svn-id: file:///home/dotxp/data/backup/phpugdo.de/svn/PDV-58@57 a4ba116a-ca00-0410-9de5-a086570e40aa
  • Loading branch information...
1 parent 4890be3 commit b95f9e14e32940c61ca182e018879633ab1fa8d5 toby committed Aug 28, 2009
Showing with 11 additions and 5 deletions.
  1. +6 −4 .vim/ftplugin/php.vim
  2. +5 −1 .vimrc
View
@@ -15,8 +15,10 @@ setlocal expandtab
setlocal autoindent
setlocal smartindent
-" Linewidth to endless
-setlocal textwidth=0
+" Linewidth to 79, because of the formatoptions this is only valid for
+" comments
+setlocal textwidth=79
+set formatoptions=qrocb
" Do not wrap lines automatically
setlocal nowrap
@@ -68,9 +70,9 @@ vnoremap <buffer> <C-c> :call PhpUnComment()<CR>
" {{{ Automatic close char mapping
" More common in PEAR coding standard
-inoremap <buffer> { {<CR>}<C-O>O
+" inoremap <buffer> { {<CR>}<C-O>O
" Maybe this way in other coding standards
-" inoremap { <CR>{<CR>}<C-O>O
+inoremap { <CR>{<CR>}<C-O>O
inoremap <buffer> [ []<LEFT>
View
6 .vimrc
@@ -68,11 +68,15 @@ autocmd InsertEnter * se cul
" Reads the skeleton php file
" Note: The normal command afterwards deletes an ugly pending line and moves
" the cursor to the middle of the file.
-autocmd BufNewFile *.php 0r ~/.vim/skeleton.php | normal GddOAOA
+autocmd BufNewFile *.php 0r ~/.vim/skeleton.php | normal GddAA
" Reads the skeleton txt file
autocmd BufNewFile *.txt 0r ~/.vim/skeleton.txt | normal GddOAOAOAOAOAOAOAOAOA
+" Disable phpsyntax based indenting for .php files {{{
+au BufRead,BufNewFile *.php set indentexpr= | set smartindent
+" }}}
+
" {{{ .phps files handled like .php
au BufRead,BufNewFile *.phps set filetype=php

0 comments on commit b95f9e1

Please sign in to comment.