Skip to content

Instantly share code, notes, and snippets.

@oxyc
Created February 21, 2012 11:29
Show Gist options
  • Save oxyc/1875991 to your computer and use it in GitHub Desktop.
Save oxyc/1875991 to your computer and use it in GitHub Desktop.
function! SetWPConfig ()
setlocal shiftwidth=4 softtabstop=4 tabstop=4 noexpandtab
setlocal listchars=trail:·
endfunction
function! SetDrupalConfig ()
setlocal shiftwidth=2 softtabstop=2 tabstop=2 expandtab
setlocal listchars=tab:▸\ ,trail:·
endfunction
" Wordpress files
au BufRead,BufNewFile */wp-content/*.php call SetWPConfig()
" Drupal files
augroup module
au BufRead,BufNewFile *.module set filetype=php | call SetDrupalConfig()
au BufRead,BufNewFile *.install set filetype=php | call SetDrupalConfig()
au BufRead,BufNewFile *.test set filetype=php | call SetDrupalConfig()
au BufRead,BufNewFile */sites/all/*.php call SetDrupalConfig()
augroup END
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment