mirror of
https://github.com/mattn/emmet-vim.git
synced 2025-12-06 18:54:27 +08:00
toggleComment for slim
This commit is contained in:
@@ -218,17 +218,22 @@ function! zencoding#getFileType()
|
||||
if type == 'htmldjango' | let type = 'html' | endif
|
||||
if type == 'html.django_template' | let type = 'html' | endif
|
||||
if type == 'scss' | let type = 'css' | endif
|
||||
if synIDattr(synID(line("."), col("."), 1), "name") =~ '^css'
|
||||
let type = 'css'
|
||||
if len(type) == 0 && len(globpath(&rtp, 'autoload/zencoding/lang/'.&ft.'.vim'))
|
||||
let type = &ft
|
||||
endif
|
||||
if synIDattr(synID(line("."), col("."), 1), "name") =~ '^html'
|
||||
let type = 'html'
|
||||
endif
|
||||
if synIDattr(synID(line("."), col("."), 1), "name") =~ '^javaScript'
|
||||
let type = 'javascript'
|
||||
endif
|
||||
if len(type) == 0 && synIDattr(synID(line("."), col("."), 1), "name") =~ '^xml'
|
||||
let type = 'xml'
|
||||
if type == 'html'
|
||||
if synIDattr(synID(line("."), col("."), 1), "name") =~ '^css'
|
||||
let type = 'css'
|
||||
endif
|
||||
if synIDattr(synID(line("."), col("."), 1), "name") =~ '^html'
|
||||
let type = 'html'
|
||||
endif
|
||||
if synIDattr(synID(line("."), col("."), 1), "name") =~ '^javaScript'
|
||||
let type = 'javascript'
|
||||
endif
|
||||
if len(type) == 0 && synIDattr(synID(line("."), col("."), 1), "name") =~ '^xml'
|
||||
let type = 'xml'
|
||||
endif
|
||||
endif
|
||||
if len(type) == 0 | let type = 'html' | endif
|
||||
return type
|
||||
|
||||
@@ -105,5 +105,11 @@ function! zencoding#lang#slim#parseTag(tag)
|
||||
endfunction
|
||||
|
||||
function! zencoding#lang#slim#toggleComment()
|
||||
" TODO
|
||||
let line = getline('.')
|
||||
let space = matchstr(line, '^\s*')
|
||||
if line =~ '^\s*/'
|
||||
call setline('.', space . line[len(space)+1:])
|
||||
elseif line =~ '^\s*[a-z]'
|
||||
call setline('.', space . '/' . line[len(space):])
|
||||
endif
|
||||
endfunction
|
||||
|
||||
Reference in New Issue
Block a user