让 .vue 支持 atom

Tab key

Currently, Emmet expands abbreviations by Tab key only for HTML, CSS, Sass/SCSS and LESS syntaxes. Tab handler scope is limited because it overrides default snippets.

If you want to make Emmet expand abbreviations with Tab key for other syntaxes, you can do the following:

  1. Use Open Your Keymap menu item to open your custom keymap.cson file.
  2. Add the following section into it:
'atom-text-editor[data-grammar="YOUR GRAMMAR HERE"]:not([mini])':
    'tab': 'emmet:expand-abbreviation-with-tab'

Replace YOUR GRAMMAR HERE with actual grammar attribute value. The easiest way to get grammar name of currently opened editor is to open DevTools and find corresponding <atom-text-editor> element: it will contain data-grammar attribute with value you need. For example, for HTML syntax it’s a text html basic.

You can add as many sections as you like for different syntaxes. Note that default snippets will no longer work, but you can add your own snippets in Emmet.

 

// github 上的官方文档说,修改  keymap.cson 即可。此文件在window下的目录是 atom\app-xxxxx\resources\app\dot-atom\keymap.cson ,完后,在最后一行添加即可。

不过我在使用中也不是很好,比如说   div.test 就不能生成带class的div,只能是纯标签。所以,在非 html,我一般用 ctrl +e

 

'atom-text-editor[data-grammar="vue"]:not([mini])':
    'tab': 'emmet:expand-abbreviation-with-tab'

  

 

转载于:https://www.cnblogs.com/Tachi/p/6527977.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值