There are two ways to use tern_for_vim plugin in HTML files as the webpage say.
use tern_for_vim plugin in HTML files
Both method can work ,both of them can't make js completion menu pop up automatically.
Method1:
1.vim test.html
2.:setlocal omnifunc=tern#Complete
3.To input `<C-X><C-O>` after `document.`
Now js completion pop up.
Two issues remain for this method.
1.To write setlocal omnifunc=tern#Complete
in .vimrc can't work.
Why?
2.How to make js completion menu pop up automatically after document.
,instead of input <C-X><C-O>
?
Method2:
sudo cp .vim/bundle/tern_for_vim/after/ftplugin/javascript_tern.vim .vim/bundle/tern_for_vim/after/ftplugin/html_tern.vim
You should input <C-X><C-O>
after document.
in order to call js completion menu for your html file edited.
The js completion menu for js file edited can't pop up after document.
automatically.
1.How to make js completion menu pop up automatically after document.
,instead of input <C-X><C-O>
? (same as in Method1 the second item.)