xavierd / clang_complete

Vim plugin that use clang for completing C/C++ code.
http://www.vim.org/scripts/script.php?script_id=3302
1.96k stars 308 forks source link

Snippets Engine #201

Open ghost opened 11 years ago

ghost commented 11 years ago

Hello everyone!

I'm only able to use clang_complete engine and using it cause some annoying things:

foo(<#variable1#>,<#variable2#>)

I can move around these two guys, but if I edit the any argument, I can't go to the next using tab

When I try to use ultisnips engine I got this error:

Error detected while processing function 13_ClangCompleteInit..g:ClangSetSnippetEngine..snippets#ult isnips#init..snippets#ultisnips#reset: line 1: Traceback (most recent call last): File "", line 1, in NameError: name 'UltiSnips_Manager' is not defined Error detected while processing function 13_ClangCompleteInit: line 71: E171: Missing :endif

snipmate:

rror detected while processing function 13_ClangCompleteInit..g:ClangSetSnippetEngine: line 7: Snippets engine snipmate not found. Error detected while processing function 13_ClangCompleteInit: line 71: E171: Missing :endif

Plugins: SuperTab, SnipMate, Clang_complete 1.8

xaizek commented 11 years ago

Hi,

you're using very old version of clang_complete, which could be the reason of your issues. Try pulling current version from master branch.

I can move around these two guys, but if I edit the any argument, I can't go to the next using tab

This is not an issue, <tab> key moves to the next placeholder only in normal mode.

ghost commented 11 years ago

Thanks for the quick reply :-)

I downloaded the plugin in www.vim.org , I saw the message: "Latest version will always be on github". But I thought it would not make much difference, any way, I got this error now.

snipmate: Still not finding

ultisnips:

Error detected while processing function 13_ClangCompleteInit..g:ClangSetSnippetEngine..snippets#ult isnips#init: line 1: E492: Not an editor command: UltiSnipsAddFiletypes c.clang_complete Error detected while processing function 13_ClangCompleteInit: line 88: E171: Missing :endif

I'm trying to change my engine just for this issue with tab (that's not a issue). Normal mode, ok, now I'm happy :-) But there isn't a way to make it more like snipmate, just hit tab in insert mode?

xaizek commented 11 years ago

Issues with snipmate engine can be related to issue #200. The engine is found, but one of functions of snipmate plugin does not.

Since you don't have ultisnips installed, it shouldn't work, though error message could be better.

But there isn't a way to make it more like snipmate, just hit tab in insert mode?

Only by changing sources, but I'm not sure if it will work fine, because supertab also uses <tab> key.

ghost commented 11 years ago

Seems obvious that I need ultisnips installed to get ultisnips engine works, but how snipmate engine didn't work..

Supertab works fine with the snipmate, so I think it's possible. (Ultisnips or snipmate engines works well with tab?)

Sorry for off-questions, if you have some documentation to indicate to me, I haven't found good one about snippets in clang_complete plugin.

xaizek commented 11 years ago

Ultisnips or snipmate engines works well with tab?

I think yes, at least it worked before (not sure about current version, since I use clang_complete engine).

if you have some documentation to indicate to me

Only the one in doc/clang_complete.txt, but it's not enough verbose and you probably already read it.

ghost commented 11 years ago

Snipmate and Ultisnips updated

Ultisnips don't work well with tab, snipmate engine with same error

I'll use clang_complete engine, however, I think it's more productive if you can just press tab, if it's possible to do.

I couldn't find a help file to say that clang_complete engine uses normal mode to go on tab, maybe it's good to add that? Or maybe I was a fool about it.

xaizek commented 11 years ago

For me snipmate just does nothing, but I don't see any errors. I checked snipmate.vim and found ReloadSnippets() function there (which should be the cause of your error). Maybe the reason is the order in which plugins are loaded.