Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

General cleanup

  • Loading branch information...
commit 5c688a4c2fe2604b680d47b305c31c09e9518e08 1 parent ccfcd58
@spf13 authored
Showing with 24 additions and 28 deletions.
  1. +21 −25 ftplugin/php.vim
  2. +3 −3 plugin/piv.vim
View
46 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 <toby@php.net>.
-" Maintainer: Steve Francia <steve.francia@gmail.com> <http://spf13.com>
-" Version: 0.8
-" Last Change: 23rd April 2010
+" Maintainer: Steve Francia <piv@spf13.com> <http://spf13.com>
+" 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 <silent> <plug>PIVphpDocRange :call PhpDocRange()<CR>
vnoremap <silent> <plug>PIVphpAlign :call PhpAlign()<CR>
"inoremap <buffer> <leader>d :call PhpDocSingle()<CR>i
-" Map ; to run PHP parser check
-" noremap ; :!php5 -l %<CR>
-
" Map ; to "add ; to the end of the line, when missing"
"noremap <buffer> ; :s/\([^;]\)$/\1;/<cr>
@@ -103,37 +100,36 @@ inoremap <buffer> <C-H> <ESC>:!phpm <C-R>=expand("<cword>")<CR><CR>
" }}}
" {{{ Automatic close char mapping
+if g:PIVAutoClose
+ if g:PIVPearStyle
+ inoremap <buffer> { {<CR>}<C-O>O
+ inoremap <buffer> ( ( )<LEFT><LEFT>
+ else
+ inoremap { {<CR>}<C-O>O
+ inoremap ( ()<LEFT>
+ endif
-if g:PIVPearStyle
- inoremap <buffer> { {<CR>}<C-O>O
- inoremap <buffer> ( ( )<LEFT><LEFT>
-else
- inoremap { {<CR>}<C-O>O
- inoremap ( ()<LEFT>
+ inoremap <buffer> [ []<LEFT>
+ inoremap <buffer> " ""<LEFT>
+ inoremap <buffer> ' ''<LEFT>
endif
-
-inoremap <buffer> [ []<LEFT>
-inoremap <buffer> " ""<LEFT>
-inoremap <buffer> ' ''<LEFT>
-
" }}} Automatic close char mapping
+
" {{{ Wrap visual selections with chars
-:vnoremap <buffer> ( "zdi(<C-R>z)<ESC>
-:vnoremap <buffer> { "zdi{<C-R>z}<ESC>
-:vnoremap <buffer> [ "zdi[<C-R>z]<ESC>
-:vnoremap <buffer> ' "zdi'<C-R>z'<ESC>
+vnoremap <buffer> ( "zdi(<C-R>z)<ESC>
+vnoremap <buffer> { "zdi{<C-R>z}<ESC>
+vnoremap <buffer> [ "zdi[<C-R>z]<ESC>
+vnoremap <buffer> ' "zdi'<C-R>z'<ESC>
" Removed in favor of register addressing
" :vnoremap " "zdi"<C-R>z"<ESC>
" }}} 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
View
6 plugin/piv.vim
@@ -1,8 +1,8 @@
" File: php.vim
" Description: PHP Integration for VIM plugin
-" Maintainer: Steve Francia <steve.francia@gmail.com> <http://spf13.com>
-" Version: 0.8
-" Last Change: 23rd April 2010
+" Maintainer: Steve Francia <piv@spf13.com> <http://spf13.com>
+" 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.
Please sign in to comment.
Something went wrong with that request. Please try again.