LoginSignup
16
8

More than 5 years have passed since last update.

VimでVueifyをシンタックスハイライトしたかった

Last updated at Posted at 2015-04-16

Vue.jsが流行っているらしいから入れた。

# npm install --save vue

Browserifyで使うならvueifyという便利なものがあると聞いて入れた。

vueifyでcomponent化
http://blog.koba04.com/post/2014/10/07/component-by-vueify/

vue1.png

Vimとかの場合は・・・

Vimとかの場合は・・・

Vimとかの場合は・・・!?

ワイ「そういやVueifyてHTML+jsだしJSXに似とるな?」

.vimrc
NeoBundle "pangloss/vim-javascript"
NeoBundle "mxw/vim-jsx"

NeoBundleでjsxハイライトを入れるやで~

.vim/bundle/vim-jsx/after/ftdetect/javascript.vim
autocmd BufNewFile,BufRead *.jsx,*.vue let b:jsx_ext_found = 1
autocmd BufNewFile,BufRead *.jsx,*.vue set filetype=javascript.jsx
autocmd BufNewFile,BufRead *.js
  \ if <SID>EnableJSX() | set filetype=javascript.jsx | endif

定義ファイル開いて.vueを追加するやで~

syntax.png

よし。

syntax2.png

つらみが残った。
そして思い至った。

HTMLでいいじゃん。

.vimrc
autocmd BufNewFile,BufRead *.{html,htm,vue*} set filetype=html

syntax3.png

syntax4.png

HTMLには最初からHTMLもcssもjsも含まれているのであった。
敗北を知りたい。

16
8
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
16
8