LoginSignup
19
21

More than 5 years have passed since last update.

ATOM(エディタ)でHTML作業に便利なShift-Enterで<br>タグをつっこむ方法

Last updated at Posted at 2015-11-06

既知の高機能エディタ(SublimeTextやDreamweaver)はHTML作業中にShift + Enterで<br>タグを挿入してくれますが、Atomはデフォルトの設定ではできないので起動スクリプトと、キーマップファイルの設定をオーバーライド(上書き)します。

以下の2つのファイルを開き追記するだけでOKです。

貼り付けた画像_2015_11_06_15_15.png

起動スクリプト

init.coffee
atom.commands.add 'atom-text-editor',
  'insert-br': (event) ->
    editor = @getModel()
    editor.insertText("<br>")

insert-brの部分は任意です。

キーマップファイル

keymap.cson
'atom-workspace atom-text-editor:not([mini])':
  'shift-enter': 'insert-br'

これでひとまず <br> タグは Shift + Enterで補完されます。
何か干渉やクリティカルな問題があればご報告ください。

19
21
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
19
21