mattn / emmet-vim

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

Add stylus support, please. #206

Open samzeng opened 10 years ago

samzeng commented 10 years ago

It seems does not work in Stylus.

aaronbushnell commented 9 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.

criloz commented 9 years ago

+ 1

nullablemind commented 8 years ago

+1

nullablemind commented 8 years ago

Please make support for the stylus

nullablemind commented 8 years ago

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
veirus commented 7 years ago

Alternatively, you can:

  1. add \ 'stylus': { \ 'extends': 'css', \ }, somewhere near 1630 in emmet-vim/autoload/emmet.vim;
  2. $cd emmet/lang $cp sass.vim stylus.vim $vim stylus.vim > :%s/sass/stylus/g > :wq
  3. ???
  4. PROFIT!
mattn commented 7 years ago

I'm not good to stylus. If you make PR, I'll merge it.

danbruegge commented 7 years ago

@veirus thanks for it. On stylus with {} blocks it will work, but normally you don't use these.

veirus commented 7 years ago

@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.

danbruegge commented 7 years ago

@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. :)

UncleGreg commented 7 years ago

@mattn is there a chance to add stylus to emmet-vim now?

mattn commented 7 years ago

I don't use stylus. So priority is not high. If anyone send PR, I can review it.