Open storyn26383 opened 6 years ago
I met the same problem today, and I find a temporary solution:
~/.vim/bundle/emmet-vim/autoload/emmet.vim
(linux)function! emmet#getFileType(...)
add this code before return type
function! emmet#getFileType(...) abort
...
...
if type ==# 'vue'
let pos = emmet#util#getcurpos()
let type = synIDattr(synID(pos[1], pos[2], 1), 'name')
if type =~# '^css\w'
let type = 'css'
endif
if type =~# '^html\w'
let type = 'html'
endif
if type =~# '^javaScript'
let type = 'javascript'
endif
if len(type) ==# 0 && type =~# '^xml'
let type = 'xml'
endif
endif
return type
endfunction
let s:emmet_settings = {
s:emmet_settings
:
let s:emmet_settings = {
\ 'vue': {
\ 'extends': 'html',
\ },
... }
I've tried to get around this in https://github.com/mattn/emmet-vim/pull/433 by switching the order in which things are analyzed (i.e. prioritizing the syntax at the cursor first, then falling back to the current type identifying method if it doesn't work). As a result, it works as it should for each block in the Vue files I have tested.
I'm not sure if it's a good solution. There seems to be an error in the Travis build that I haven't understood exactly what it is and I was waiting for @mattn's take on that.
:eyes:
Hello, when I use emmet in
*.vue
files, for example:There are three different syntax in a file, but emmet can't handle this situation properly.
If we can have another function like:
Then we can do something like this:
Thanks in advance.