Skip to content

Instantly share code, notes, and snippets.

@nisaacson
Created February 26, 2014 17:23
Show Gist options
  • Star 26 You must be signed in to star a gist
  • Fork 6 You must be signed in to fork a gist
  • Save nisaacson/9234157 to your computer and use it in GitHub Desktop.
Save nisaacson/9234157 to your computer and use it in GitHub Desktop.
Use tern with vim for node.js development.
{
"libs": [
"browser",
"underscore",
"jquery"
],
"plugins": {
"node": {}
}
}
"""""""""""""""""
" Tern settings
"""""""""""""""""
Bundle 'marijnh/tern_for_vim'
let g:tern_show_argument_hints='on_hold'
" and
let g:tern_map_keys=1
@joeyzhao0113
Copy link

After set the .vimrc as below:

"""""""""""""""""
" Tern settings
"""""""""""""""""
Bundle 'marijnh/tern_for_vim'
let g:tern_show_argument_hints='on_hold'
" and 
let g:tern_map_keys=1

I will get error when run vim command:

E492: Not an editor command: Bundle 'marijnh/tern_for_vim'
Press ENTER or type command to continue

Is there anything need to be changed in this configuration file?

@argshook
Copy link

@joeyzhao0113 hey man you most probably don't have a plugin manager which has Bundle command or don't have any plugin manager at all. google around there are plenty. I use NeoBundle so i'd have to do NeoBundle 'marijnh/tern_for_vim'. If you were to use Vundle, for example, then it's Plugin 'marijnh/tern_for_vim'

@argshook
Copy link

so i had this same issue again and googled my own answer from half a year ago
which didn't help...

make sure you use tern with filetype=javascript.
tern doesn't register its commands for other filetypes, in my case it was typescript.
obvious now but easy to forget when often switching between js & ts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment