From 5c688a4c2fe2604b680d47b305c31c09e9518e08 Mon Sep 17 00:00:00 2001 From: Steve Francia Date: Mon, 9 Jan 2012 15:16:53 -0500 Subject: [PATCH] General cleanup --- ftplugin/php.vim | 46 +++++++++++++++++++++------------------------- plugin/piv.vim | 6 +++--- 2 files changed, 24 insertions(+), 28 deletions(-) diff --git a/ftplugin/php.vim b/ftplugin/php.vim index a81b1ee..50faf4f 100644 --- a/ftplugin/php.vim +++ b/ftplugin/php.vim @@ -2,9 +2,9 @@ " Description: PHP Integration for VIM plugin " This file is a considerable fork of the original " PDV written by Tobias Schlitt . -" Maintainer: Steve Francia -" Version: 0.8 -" Last Change: 23rd April 2010 +" Maintainer: Steve Francia +" Version: 0.9 +" Last Change: 7th January 2012 " " " Section: script init stuff {{{1 @@ -48,10 +48,10 @@ call s:InitVariable("g:syntax_extra_php", 'doxygen') call s:InitVariable("g:syntax_extra_inc", 'doxygen') call s:InitVariable("g:PIVCreateDefaultMappings", 1) call s:InitVariable("g:PIVPearStyle", 0) +call s:InitVariable("g:PIVAutoClose", 0) " Auto expand tabs to spaces setlocal expandtab - setlocal autoindent " Auto indent after a { setlocal smartindent @@ -85,9 +85,6 @@ vnoremap PIVphpDocRange :call PhpDocRange() vnoremap PIVphpAlign :call PhpAlign() "inoremap d :call PhpDocSingle()i -" Map ; to run PHP parser check -" noremap ; :!php5 -l % - " Map ; to "add ; to the end of the line, when missing" "noremap ; :s/\([^;]\)$/\1;/ @@ -103,37 +100,36 @@ inoremap :!phpm =expand("") " }}} " {{{ Automatic close char mapping +if g:PIVAutoClose + if g:PIVPearStyle + inoremap { {}O + inoremap ( ( ) + else + inoremap { {}O + inoremap ( () + endif -if g:PIVPearStyle - inoremap { {}O - inoremap ( ( ) -else - inoremap { {}O - inoremap ( () + inoremap [ [] + inoremap " "" + inoremap ' '' endif - -inoremap [ [] -inoremap " "" -inoremap ' '' - " }}} Automatic close char mapping + " {{{ Wrap visual selections with chars -:vnoremap ( "zdi(z) -:vnoremap { "zdi{z} -:vnoremap [ "zdi[z] -:vnoremap ' "zdi'z' +vnoremap ( "zdi(z) +vnoremap { "zdi{z} +vnoremap [ "zdi[z] +vnoremap ' "zdi'z' " Removed in favor of register addressing " :vnoremap " "zdi"z" " }}} Wrap visual selections with chars " {{{ Dictionary completion +setlocal dictionary-=$VIMRUNTIME/bundle/PIV/misc/funclist.txt dictionary+=$VIMRUNTIME/bundle/PIV/misc/funclist.txt -" The completion dictionary is provided by Rasmus: -" http://lerdorf.com/funclist.txt -setlocal dictionary-=/home/dotxp/funclist.txt dictionary+=/home/dotxp/funclist.txt " Use the dictionary completion setlocal complete-=k complete+=k diff --git a/plugin/piv.vim b/plugin/piv.vim index 3d3989c..7ff9225 100644 --- a/plugin/piv.vim +++ b/plugin/piv.vim @@ -1,8 +1,8 @@ " File: php.vim " Description: PHP Integration for VIM plugin -" Maintainer: Steve Francia -" Version: 0.8 -" Last Change: 23rd April 2010 +" Maintainer: Steve Francia +" Version: 0.9 +" Last Change: 7th January 2012 " Most of the functions and settings are php specific and located in ftplugin/php.vim " This file will be for general settings.