简体   繁体   English

带有emacs web-mode和colorization的.scss文件

[英].scss file with emacs web-mode & colorization

I'm using emacs with web modes and other stuff. 我正在使用带有网络模式和其他东西的emacs。

I'm updating my .emacs because I'm working with new tools. 我正在更新我的.emacs因为我正在使用新工具。 One of them is Sass. 其中一个是萨斯。 So, I wanna work with my *.scss files without problem and in fact it works cool. 所以,我想使用我的*.scss文件没有问题,事实上它很酷。 But not perfect. 但并不完美。 Why? 为什么?

My emacs has: (setq web-mode-enable-css-colorization t) 我的emacs有:( (setq web-mode-enable-css-colorization t)

And in my css I can see the colors. 在我的CSS中,我可以看到颜色。 But in my scss I can't. 但在我的scss我不能。

How can I activate css-colorization to scss files? 如何激活css-colorization到scss文件?

Maybe this could help. 也许这可能有所帮助。

There is a Major mode for editing SCSS files in Emacs: 在Emacs中有一个用于编辑SCSS文件的主要模式:

https://www.emacswiki.org/emacs/ScssMode https://www.emacswiki.org/emacs/ScssMode

I finally did it. 我终于做到了。

But it was with a work around. 但这是一个解决方案。 So, I installed the rainbow-mode from Elpa. 所以,我安装了Elpa的rainbow-mode

Plus, in my .emacs I added: (add-hook 'web-mode-hook 'rainbow-mode) 另外,在我的.emacs中,我添加了: (add-hook 'web-mode-hook 'rainbow-mode)

Thanks! 谢谢!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM