ternjs / tern_for_vim

Tern plugin for Vim
MIT License
1.83k stars 100 forks source link

'Unknown function: tern#Enable' weird problem #119

Closed yaohui-wyh closed 9 years ago

yaohui-wyh commented 9 years ago

Hi, after installed tern_for_vim, vim gives the following error when open a JavaScript file:

"app.js" [noeol][dos] 77L, 2226C
Error detected while processing /Users/user/.vim/bundle/tern_for_vim/after/ftplugin/javascript_tern.vim:
line    1:
E117: Unknown function: tern#Enable

I've checked the similar issue Issue#95 but still cannot get it work.


Some detailed info:

vim --version: OS X version 7.4 (Compiled by Homebrew), with python support (+python)

I'm using Vundle:

...
Plugin 'ternjs/tern_for_vim'

call vundle#end()
filetype plugin indent on
...

After BundleInstall the plugin repo has been successfully cloned into ~/.vim/bundle/tern_for_vim, git log on HEAD:

* e044f14 (HEAD, origin/master, origin/HEAD, master) 2015-11-09 Marijn Haverbeke Disallow sending a file fragment in definition queries

Also npm install under the plugin directory:

:~/.vim/bundle/tern_for_vim$ npm list
tern_for_vim@0.5.0 /Users/user/.vim/bundle/tern_for_vim
└─┬ tern@0.16.0
  ├── acorn@2.6.4
  ├─┬ glob@3.2.11
  │ ├── inherits@2.0.1
  │ └── minimatch@0.3.0
  ├─┬ minimatch@0.2.14
  │ ├── lru-cache@2.7.0
  │ └── sigmund@1.0.1
  └── typescript@1.0.1

tern is also installed via npm globally, and runs without error

/usr/local/lib       
...                                                                                                                                 
└── tern@0.16.0

I guess the problem might be that vim is not loading the plugin. I've tried reinstalled Vundle and clean up the entire ~/.vim/bundle folder and start all over, but still got the error.

Thanks!

yaohui-wyh commented 9 years ago

Well, I found something new:

Rename folder 'tern_for_vim' under ~/.vim/bundle to any name not ends with 'vim', such as 'tern', and also change the vimrc part Plugin 'ternjs/tern_for_vim' to Plugin 'ternjs/tern'. Then everything works.

Such weird behavior might be a problem of Vundle?

yaohui-wyh commented 9 years ago

I've tried on an Ubuntu 12.04 machine, and everything works. I would close the issue since such weird problem could not likely be a bug.

Thanks and regards

tnguyen14 commented 8 years ago

I am seeing this problem as well. Is there a different, more automatic solution than renaming the plugin folder?