Using tern_for_vim plugin in HTML files

落花浮王杯 提交于 2019-11-30 21:26:12

I looked at the plugin; I hope I have the right one: https://github.com/marijnh/tern_for_vim

It seems to make a difference only for javascript files. If you want to use it for html files, you could try one of these (in order of increasing levels of indirection)

:setlocal omnifunc=tern#Complete
:call tern#Enable()
:runtime after/ftplugin/javascript_tern.vim
:set ft=html.javascript_tern
:set ft=html.javascript

If any of these have the desired effect, then you can set vim up to do the corresponding thing automatically. Probably simplest (if the middle suggestion works) is to make a copy of javascript_tern.vim in the same directory, and call it html_tern.vim.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!