• 追加された行はこの色です。
  • 削除された行はこの色です。
* Nodeのjshintで整形 [#sbe732d3]
* Nodeのjs-beautifyで整形 [#sbe732d3]

** js-beautifyのインストール [#i17a65db]

*** Node.jsのインストール [#waa79528]
- http://nodejs.org/download/

*** js-beautifyのインストール [#y5642857]
 npm -g install js-beautify

*** インストールされるコマンド [#s06d1350]
- js-beautify
- html-beautify
- css-beautify

** Vim設定 [#x2f29184]
*** .vim/after/ftplugin/html.vim [#q450d48b]
  " js-beautify by node - https://github.com/einars/js-beautify
  if has('unix')
      let ret = system('which html-beautify')
      if !v:shell_error
          command! -range=% -nargs=* Tidy <line1>,<line2>! html-beautify --type=html -f -<CR>
          noremap ,ft <ESC>:'<,'>! html-beautify -s 2 -f -<CR>
      endif
  elseif has('win32') || has('win64')
      let ret = system('where /Q html-beautify')
      if !v:shell_error
          command! -range=% -nargs=* Tidy <line1>,<line2>! html-beautify -s 2 -f -<CR>
          noremap ,ft <ESC>:'<,'>! html-beautify -s 2 -f -<CR>
      endif
  endif

** 参考 [#g7961385]
https://github.com/einars/js-beautify


トップ   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS