Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

We’re showing branches in this repository, but you can also compare across forks.

base fork: chr0n1x/.dotFiles
base: eebcf67c39
...
head fork: chr0n1x/.dotFiles
compare: 8250bb0a69
  • 2 commits
  • 3 files changed
  • 0 commit comments
  • 1 contributor
Commits on Mar 17, 2013
chr0n1x NerdTree: starts on left again 5bf5610
chr0n1x PHP syntax 8250bb0
Showing with 105 additions and 1 deletion.
  1. +1 −0  .vim/syntax/.gitignore
  2. +103 −0 .vim/syntax/php.vim
  3. +1 −1  .vimrc
1  .vim/syntax/.gitignore
View
@@ -0,0 +1 @@
+!*
103 .vim/syntax/php.vim
View
@@ -0,0 +1,103 @@
+"
+" Settings for PHP filetype
+"
+
+" Load PHP Documentor for VIM
+"source ~/.vim/php-doc.vim
+
+" Set up automatic formatting
+set formatoptions+=tcqlro
+
+" Jump to matching bracket for 3/10th of a second (works with showmatch)
+"set matchtime=3
+"set showmatch
+
+" Set maximum text width (for wrapping)
+set textwidth=80
+
+"
+" Syntax options
+"
+" Enable folding of class/function blocks
+let php_folding = 1
+
+" Do not use short tags to find PHP blocks
+let php_noShortTags = 1
+
+" Highlighti SQL inside PHP strings
+let php_sql_query=1
+
+
+"
+" Linting
+"
+" Use PHP syntax check when doing :make
+set makeprg=php\ -l\ %
+
+" Parse PHP error output
+set errorformat=%m\ in\ %f\ on\ line\ %l
+
+" Function to locate endpoints of a PHP block {{{
+function! PhpBlockSelect(mode)
+ let motion = "v"
+ let line = getline(".")
+ let pos = col(".")-1
+ let end = col("$")-1
+
+ if a:mode == 1
+ if line[pos] == '?' && pos+1 < end && line[pos+1] == '>'
+ let motion .= "l"
+ elseif line[pos] == '>' && pos > 1 && line[pos-1] == '?'
+ " do nothing
+ else
+ let motion .= "/?>/e\<CR>"
+ endif
+ let motion .= "o"
+ if end > 0
+ let motion .= "l"
+ endif
+ let motion .= "?<\\?php\\>\<CR>"
+ else
+ if line[pos] == '?' && pos+1 < end && line[pos+1] == '>'
+ " do nothing
+ elseif line[pos] == '>' && pos > 1 && line[pos-1] == '?'
+ let motion .= "h?\\S\<CR>""
+ else
+ let motion .= "/?>/;?\\S\<CR>"
+ endif
+ let motion .= "o?<\\?php\\>\<CR>4l/\\S\<CR>"
+ endif
+
+ return motion
+endfunction
+" }}}
+
+" Mappings to select full/inner PHP block
+nmap <silent> <expr> vaP PhpBlockSelect(1)
+nmap <silent> <expr> viP PhpBlockSelect(0)
+" Mappings for operator mode to work on full/inner PHP block
+omap <silent> aP :silent normal vaP<CR>
+omap <silent> iP :silent normal viP<CR>
+
+" Mappings for PHP Documentor for VIM
+inoremap <buffer> <C-P> <Esc>:call PhpDocSingle()<CR>i
+nnoremap <buffer> <C-P> :call PhpDocSingle()<CR>
+vnoremap <buffer> <C-P> :call PhpDocRange()<CR>
+" Generate @uses tag based on inheritance info
+let g:pdv_cfg_Uses = 1
+" Set default Copyright
+let g:pdv_cfg_Copyright = "Copyright (C) 2006 Andrei Zmievski"
+
+" Exuberant Ctags
+"
+" Map <F4> to re-build tags file
+nmap <silent> <F4>
+ \ :!ctags -f ./tags
+ \ --langmap="php:+.inc"
+ \ -h ".php.inc" -R --totals=yes
+ \ --tag-relative=yes --PHP-kinds=+cf-v .<CR>
+
+" Set tag filename(s)
+set tags=./tags,tags
+
+" vim: set fdm=marker:
2  .vimrc
View
@@ -11,7 +11,7 @@ let NERDTreeMouseMode=2
let NERDTreeShowHidden=1
let NERDTreeIgnore=['\.pyc','\~$','\.swo$','\.swp$','\.git','\.hg','\.svn','\.bzr']
let NERDTreeKeepTreeInNewTab=1
-let g:NERDTreeWinPos = "right"
+"let g:NERDTreeWinPos = "right"
let g:nerdtree_tabs_open_on_gui_startup=0
filetype off

No commit comments for this range

Something went wrong with that request. Please try again.