Olical / dotfiles

Configuration for Linux, i3, Kitty, Fish, Neovim and more
https://oli.me.uk
The Unlicense
508 stars 45 forks source link

tern and ycm #1

Closed asmod3us closed 11 years ago

asmod3us commented 11 years ago

Hey,

I came here from a ycm issue threat. You mentioned using tern and ycm. I'm trying to set that up too. Is tern completion showing up for you in the ycm popup window? I find that "some" completion seems to be displayed, but certainly not context relevant stuff.

Browsing through your config, I didn't find any special setup for it except for the ctags/jcstags stuff. Is that the "magic" to get it working? Or did I miss something else?

My current ycm config is

let g:ycm_seed_identifiers_with_syntax=1 let g:ycm_add_preview_to_completeopt = 0 let g:ycm_confirm_extra_conf=0 set completeopt-=preview let g:ycm_cache_omnifunc = 0

Olical commented 11 years ago

Hmm, mine is still working find and I am completely up to date. Try creating a blank file like:

var obj = {
    foo: true,
    bar: 'hello'
};

var baz = 'something-else';

When you type obj. it should suggest those two values within the object and their type. If it doesn't do that, maybe you haven't grabbed the npm modules or something?

asmod3us commented 11 years ago

I think my setup is fine, since i can see tern's node process while vim is running.

So I just tried your sample and when i type the '.' after object, a completion popup appears. It doesn't show anything related to obj. I took a screenhot: http://goo.gl/cmlb4d. However, when i invoke vim's omnicompletion explicitly with C-x C-p it offers me somewhat more relavant completion: http://goo.gl/uN7HtU.

May I ask for a screenshot of your completion in action? I think i'll probably ask the ycm guys if there's a setting for that. Hold on, as i'm typing this i figured it out. I had an autocmd that set an omnifunc:

autocmd FileType javascript setlocal omnifunc=javascriptcomplete#CompleteJS

Removing that line did the trick. Many thanks for getting me on the right track ;-) I'm leaving this comment in case others stumble over the same thing.

Olical commented 11 years ago

I'm glad you found the problem! :D

I close this off now then.