Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 18 additions & 4 deletions README
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,25 @@
* Vim snippets for Drupal 7
*/

- REQUIRED: snipMate for vim: http://www.vim.org/scripts/script.php?script_id=2540
- Included: All 330+ Drupal 7 hooks
- Missing: Other functions
REQUIRED

pathogen https://github.com/tpope/vim-pathogen
snipMate fork made by garbas https://github.com/garbas/vim-snipmate

INSTALL

clone repo in to the ~/.vim/bundle directory

cd ~/.vim/bundle
git clone git://github.com/tanarurkerem/drupal-snippets.git

USAGE

- Replace the php.snippets file in the ~/.vim/snippets directory with the one included.
- Type hook_HOOKNAME<tab> for annotated snippets, and h_HOOKNAME<tab> for the non-annotated versions.
- Most snippets include multiple <tab> placemarks.

INFO

- Included: All 330+ Drupal 7 hooks
- Missing: Other functions

75 changes: 0 additions & 75 deletions help/installing-vim.html

This file was deleted.

3 changes: 0 additions & 3 deletions help/snippets.help.ini

This file was deleted.

20 changes: 20 additions & 0 deletions plugin/snipMate_drupal.vim
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
" config which can be overridden (shared lines)
if !exists('g:snipMate')
let g:snipMate = {}
endif
let s:snipMate = g:snipMate

let s:snipMate['scope_aliases'] = get(s:snipMate,'scope_aliases',{'php' :'drupal,php' })

if has("autocmd")
" Drupal php files.
augroup module
autocmd BufRead,BufNewFile *.module set filetype=php
autocmd BufRead,BufNewFile *.install set filetype=php
autocmd BufRead,BufNewFile *.test set filetype=php
autocmd BufRead,BufNewFile *.inc set filetype=php
autocmd BufRead,BufNewFile *.profile set filetype=php
autocmd BufRead,BufNewFile *.make set filetype=dmake
augroup END
endif
" vim:noet:sw=4:ts=4:ft=vim
9 changes: 0 additions & 9 deletions snippets.info

This file was deleted.

11 changes: 0 additions & 11 deletions snippets.module

This file was deleted.

127 changes: 127 additions & 0 deletions snippets/dmake.snippets
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
snippet core
api = 2
core = ${1}.x
${2}
#contrib Module, Theme or Profile
snippet p
projects[${1}][subdir] = ${2:contrib}
${3}

#contrib Module, Theme or Profile specified Version
snippet pv
projects[${1:}][subdir] = ${2:contrib}
projects[$1][version] = ${3}
${4}
#contrib Module, Theme or Profile from Git
snippet pg branch
projects[${1:}][subdir] = ${2:contrib}
projects[$1][download][type] = git
projects[$1][download][url] = http://git.drupal.org/project/$1.git
projects[$1][download][branch] = ${3:master}
${4}
snippet pg tag
projects[${1:}][subdir] = ${2:contrib}
projects[$1][download][type] = git
projects[$1][download][url] = http://git.drupal.org/project/$1.git
projects[$1][download][tag] = ${3:}
${4}
snippet pg revision
projects[${1:}][subdir] = ${2:contrib}
projects[$1][download][type] = git
projects[$1][download][url] = http://git.drupal.org/project/$1.git
projects[$1][download][revision] = ${3:}
${4}
#custom Module from Git
snippet cmg branch
projects[${1:}][subdir] = ${2:custom}
projects[$1][type] = module
projects[$1][download][type] = git
projects[$1][download][url] = ${3}/$1.git
projects[$1][download][branch] = ${4:master}
${5}
snippet cmg tag
projects[${1:}][subdir] = ${2:custom}
projects[$1][type] = module
projects[$1][download][type] = git
projects[$1][download][url] = ${3}/$1.git
projects[$1][download][tag] = ${4:}
${5}
snippet cmg revision
projects[${1:}][subdir] = ${2:custom}
projects[$1][type] = module
projects[$1][download][type] = git
projects[$1][download][url] = ${3}/$1.git
projects[$1][download][revision] = ${4:}
${5}
#custom Theme from Git
snippet ctg branch
projects[${1:}][subdir] = ${2:custom}
projects[$1][type] = theme
projects[$1][download][type] = git
projects[$1][download][url] = ${3}/$1.git
projects[$1][download][branch] = ${4:master}
${5}
snippet ctg tag
projects[${1:}][subdir] = ${2:custom}
projects[$1][type] = theme
projects[$1][download][type] = git
projects[$1][download][url] = ${3}/$1.git
projects[$1][download][tag] = ${4:}
${5}
snippet ctg revision
projects[${1:}][subdir] = ${2:custom}
projects[$1][type] = theme
projects[$1][download][type] = git
projects[$1][download][url] = ${3}/$1.git
projects[$1][download][revision] = ${4:}
${5}
#custom Profile from Git
snippet cpg branch
projects[${1:}][subdir] = ${2:custom}
projects[$1][type] = profile
projects[$1][download][type] = git
projects[$1][download][url] = ${3}/$1.git
projects[$1][download][branch] = ${4:master}
${5}
snippet cpg tag
projects[${1:}][subdir] = ${2:custom}
projects[$1][type] = profile
projects[$1][download][type] = git
projects[$1][download][url] = ${3}/$1.git
projects[$1][download][tag] = ${4:}
${5}
snippet cpg revision
projects[${1:}][subdir] = ${2:custom}
projects[$1][type] = profile
projects[$1][download][type] = git
projects[$1][download][url] = ${3}/$1.git
projects[$1][download][revision] = ${4:}
${5}
#custom Feature from Git
snippet cfg branch
projects[${1:}][subdir] = ${2:features}
projects[$1][type] = module
projects[$1][download][type] = git
projects[$1][download][url] = ${3}/$1.git
projects[$1][download][branch] = ${4:master}
${5}
snippet cfg tag
projects[${1:}][subdir] = ${2:features}
projects[$1][type] = module
projects[$1][download][type] = git
projects[$1][download][url] = ${3}/$1.git
projects[$1][download][tag] = ${4:}
${5}
snippet cfg revision
projects[${1:}][subdir] = ${2:features}
projects[$1][type] = module
projects[$1][download][type] = git
projects[$1][download][url] = ${3}/$1.git
projects[$1][download][revision] = ${4:}
${5}
#Libraries
snippet l file
libraries[${1:}][download][type] = file
libraries[$1][download][url] = ${2}
libraries[$1][download][md5] = ${3}
${4}
Loading