I'm trying to set up tern_for_vim plugin to have nice autocompletion in JavaScript. While editing ".js" files, "Ctrl+X Ctrl+O" gives nice semantic results, picking up the "backbone.js" and other libraries. However, when I'm editing a JS block inside an HTML file, this doesn't work, I only see the buffer-based standard completion. I can't figure out what's the problem. How to fix this?
相关问题
- Emacs shell: save commit message
- How to change the first two uppercase characters o
- Insert text into current buffer from function
- Hot reload on save
- Substituting zero-width match in vim script
相关文章
- 如何让 vim 支持 .cshtml 文件的代码高亮
- Auto-save in VIM as you type
- How can I use gcc's -I command to add recursiv
- Vim: overloaded mapping for multiple modes
- How to use relative line numbering universally in
- How to copy the value of a vim option to a registe
- E185: Cannot find color scheme*
- How do I fix vim to properly indent folds containi
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)
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.