adding new stuff
This commit is contained in:
parent
f84d7183aa
commit
9ef8a96f9a
1580 changed files with 0 additions and 0 deletions
71
plugins/bundle/xptemplate/ftplugin/eruby/eruby.ftdetect.vim
Normal file
71
plugins/bundle/xptemplate/ftplugin/eruby/eruby.ftdetect.vim
Normal file
|
|
@ -0,0 +1,71 @@
|
|||
if exists("b:__ERUBY_FTDETECT_VIM__")
|
||||
finish
|
||||
endif
|
||||
let b:__ERUBY_FTDETECT_VIM__ = 1
|
||||
|
||||
|
||||
if &filetype !~ 'eruby'
|
||||
finish
|
||||
endif
|
||||
|
||||
|
||||
|
||||
let s:skipPattern = 'synIDattr(synID(line("."), col("."), 0), "name") =~? "\\vstring|comment"'
|
||||
let s:pattern = {
|
||||
\ 'ruby' : {
|
||||
\ 'start' : '\V\c<%',
|
||||
\ 'mid' : '',
|
||||
\ 'end' : '\V\c%>',
|
||||
\ 'skip' : s:skipPattern,
|
||||
\ },
|
||||
\ 'javascript' : {
|
||||
\ 'start' : '\V\c<script\_[^>]\*>',
|
||||
\ 'mid' : '',
|
||||
\ 'end' : '\V\c</script>',
|
||||
\ 'skip' : s:skipPattern,
|
||||
\ },
|
||||
\ 'css' : {
|
||||
\ 'start' : '\V\c<style\_[^>]\*>',
|
||||
\ 'mid' : '',
|
||||
\ 'end' : '\V\c</style>',
|
||||
\ 'skip' : s:skipPattern,
|
||||
\ },
|
||||
\}
|
||||
|
||||
let s:topFT = 'eruby'
|
||||
|
||||
fun! XPT_erubyFiletypeDetect() "{{{
|
||||
let pos = [ line( "." ), col( "." ) ]
|
||||
|
||||
let synName = xpt#util#NearestSynName()
|
||||
|
||||
if synName == ''
|
||||
" top level ft is html
|
||||
return s:topFT
|
||||
|
||||
else
|
||||
|
||||
for [ name, ftPattern ] in items( s:pattern )
|
||||
let pos = searchpairpos( ftPattern.start, ftPattern.mid, ftPattern.end, 'nbW', ftPattern.skip )
|
||||
if pos != [0, 0]
|
||||
return name
|
||||
endif
|
||||
endfor
|
||||
|
||||
if synName =~ '^\cjavascript'
|
||||
return 'javascript'
|
||||
elseif synName =~ '^\ccss'
|
||||
return 'css'
|
||||
endif
|
||||
|
||||
return s:topFT
|
||||
|
||||
endif
|
||||
|
||||
endfunction "}}}
|
||||
|
||||
if exists( 'b:XPTfiletypeDetect' )
|
||||
unlet b:XPTfiletypeDetect
|
||||
endif
|
||||
let b:XPTfiletypeDetect = function( 'XPT_erubyFiletypeDetect' )
|
||||
|
||||
21
plugins/bundle/xptemplate/ftplugin/eruby/eruby.xpt.vim
Normal file
21
plugins/bundle/xptemplate/ftplugin/eruby/eruby.xpt.vim
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
XPTemplate priority=lang-
|
||||
|
||||
XPTinclude
|
||||
\ _common/common
|
||||
\ html/html
|
||||
\ html/eruby*
|
||||
|
||||
XPTembed
|
||||
\ ruby/ruby
|
||||
\ javascript/javascript
|
||||
\ css/css
|
||||
|
||||
" ========================= Function and Variables =============================
|
||||
|
||||
" ================================= Snippets ===================================
|
||||
|
||||
|
||||
|
||||
|
||||
" ================================= Wrapper ===================================
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue