emmet-vim icon indicating copy to clipboard operation
emmet-vim copied to clipboard

Add stylus support, please.

Open samzeng opened this issue 11 years ago • 12 comments

It seems does not work in Stylus.

samzeng avatar May 14 '14 14:05 samzeng

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.

aaronbushnell avatar Jan 08 '15 04:01 aaronbushnell

+ 1

criloz avatar Nov 10 '15 02:11 criloz

+1

nullablemind avatar Dec 14 '15 07:12 nullablemind

Please make support for the stylus

nullablemind avatar Dec 14 '15 19:12 nullablemind

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

nullablemind avatar May 26 '16 06:05 nullablemind

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!

veirus avatar Dec 06 '16 06:12 veirus

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

mattn avatar Dec 09 '16 00:12 mattn

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

danbruegge avatar Dec 09 '16 17:12 danbruegge

@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 avatar Dec 10 '16 18:12 veirus

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

danbruegge avatar Dec 13 '16 18:12 danbruegge

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

UncleGreg avatar Oct 03 '17 07:10 UncleGreg

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

mattn avatar Oct 11 '17 03:10 mattn