Skip to content

Instantly share code, notes, and snippets.

@iwata
Forked from hokaccha/template.vim
Created June 26, 2011 00:26
Show Gist options
  • Save iwata/1047080 to your computer and use it in GitHub Desktop.
Save iwata/1047080 to your computer and use it in GitHub Desktop.
" textobj-template - Text objects for WAF template engine.
" Version: 0.0.1
" Author: Kazuhito Hokamura
" License: MIT license (see <http://www.opensource.org/licenses/mit-license>)
if exists('g:loaded_textobj_template')
finish
endif
call textobj#user#plugin('template', {
\ 'tt': {
\ 'select-a': 'aTT',
\ 'select-i': 'iTT',
\ '*pattern*': ['\[%-\? ', ' -\?%\]'],
\ },
\ 'tt2': {
\ 'select-a': 'aTT',
\ 'select-i': 'iTT',
\ '*pattern*': ['\[%-\? ', ' -\?%\]'],
\ },
\ 'tt2html': {
\ 'select-a': 'aTT',
\ 'select-i': 'iTT',
\ '*pattern*': ['\[%-\? ', ' -\?%\]'],
\ },
\ 'mt': {
\ 'select-a': 'aTm',
\ 'select-i': 'iTm',
\ '*pattern*': ['<?= ', ' ?>'],
\ },
\ 'rhtml': {
\ 'select-a': 'aTr',
\ 'select-i': 'iTr',
\ '*pattern*': ['<%= ', ' %>'],
\ },
\ 'django': {
\ 'select-a': 'aTd',
\ 'select-i': 'iTd',
\ '*pattern*': ['{\(%\|{\) ', ' \(%\|}\)}'],
\ },
\ })
let loaded_textobj_template= 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment