Open samzeng opened 10 years ago
Was hoping for this too. Is there some way to map the Emmet functionality used in .css
to any filetype within .vimrc
? That would be nice so I could apply it to .less
, .sass
, .scss
, etc.
+
1
+1
Please make support for the stylus
I was able to set up your stylus.
You need to add this option:
autocmd BufRead,BufNewFile *.styl set filetype=css
Here are my settings for emmet-vim:
"==================================
"= Emmet
"==================================
let g:user_emmet_install_global = 0
autocmd FileType html,jade,css,sass,scss,stylus EmmetInstall
let g:user_emmet_leader_key = '<c-y>'
let g:user_emmet_prev_key = '<c-j>'
let g:user_emmet_next_key = '<c-k>'
imap <expr> <tab> emmet#expandAbbrIntelligent("\<tab>")
" Stylus config
autocmd BufNewFile,BufReadPost *.styl set filetype=stylus
autocmd BufNewFile,BufReadPost *.css set filetype=css
autocmd BufRead,BufNewFile *.styl set filetype=css
Alternatively, you can:
\ 'stylus': { \ 'extends': 'css', \ },
somewhere near 1630 in emmet-vim/autoload/emmet.vim
;$cd emmet/lang
$cp sass.vim stylus.vim
$vim stylus.vim
> :%s/sass/stylus/g
> :wq
I'm not good to stylus. If you make PR, I'll merge it.
@veirus thanks for it. On stylus with {} blocks it will work, but normally you don't use these.
@danbruegge don't thank me, in truth it's kinda horrible "hack" based on fact that Stylus compiler can handle Sass-syntax (which, I thought, is relatively close to Stylus), so use with caution. (Also it's really inconvenient and will break whenever you update emmet). Unfortunately I have not much time (nor proficiency) to make full support of Stylus-lang.
@veirus no problem. I think stylus syntax differs alot from normal css/sass. So maybe it can be hard to add support for it. In the last to days i moved away from stylus to postcss+cssnext. So i don't need stylus support anymore. :)
@mattn is there a chance to add stylus to emmet-vim now?
I don't use stylus. So priority is not high. If anyone send PR, I can review it.
It seems does not work in Stylus.