mattn / emmet-vim

emmet for vim: http://emmet.io/
http://mattn.github.io/emmet-vim
MIT License
6.41k stars 411 forks source link

JS and PHP expand issue #453

Closed Simounet closed 5 years ago

Simounet commented 5 years ago

Hi there, Since ae7d31f2, I can't use expands on PHP and JS files anymore. In both cases, the type from https://github.com/mattn/emmet-vim/blob/master/autoload/emmet.vim#L518 returns html. Have a nice day.

mattn commented 5 years ago

What file type do you use? php ? I can expand html in php file.

Simounet commented 5 years ago

Yep, test.php for example. I've added some custom snippets from my .vimrc file. Using Vim 7.4.1689.

mattn commented 5 years ago

Could you please show me your custom configuration?

Simounet commented 5 years ago

Of course:

Bundle 'mattn/emmet-vim'
"let g:user_emmet_expandabbr_key = '<C-Y>,'
"let g:user_emmet_expandabbr_key = '<tab>'
let g:user_emmet_expandabbr_key = '<C-e>'
" " Emmet custom settings
let g:user_emmet_settings = {
\  'php' : {
\    'extends' : 'html',
\    'filters' : 'c',
\    'snippets': {
\      'pr': "echo '<pre>' . print_r( |, true ) . '</pre>';",
\      'e': 'echo |;',
\      'vd': 'var_dump(|);'
\    }
\  },
\  'javascript' : {
\    'snippets': {
\      'cl': 'console.log( | );',
\      'cd': 'console.dir( | );',
\      'ci': 'console.info( | );',
\      'cde': 'console.debug( | )'
\    }
\  }
\}

nnoremap <Leader>as :Emmet as<CR>"+Pa\|
nnoremap <Leader>deb :Emmet as<CR>
M4R7iNP commented 5 years ago

Happens for me too. I only get HTML snippets in PHP files. This is my emmet config. Try :Emmet phphead in a PHP file.

Nice plugin btw, I use it daily :)