Skip to content

Commit

Permalink
General cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
spf13 committed Jan 9, 2012
1 parent ccfcd58 commit 5c688a4
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 28 deletions.
46 changes: 21 additions & 25 deletions ftplugin/php.vim
Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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>

Expand All @@ -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

Expand Down
6 changes: 3 additions & 3 deletions 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.
Expand Down

0 comments on commit 5c688a4

Please sign in to comment.