-
Notifications
You must be signed in to change notification settings - Fork 214
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
a few questions #156
Comments
What the If you have a concrete example of what you are trying to complete, what you expect to happen, and what actually happens, then I can probably clear up any confusion about what is going on. |
Yeah, I’ve been using completion for some things but when I started reading the docs in depth, I realized that I didn’t know anything :) So, what I want to do is for vim/your excellent plugin to try to finish programming language kewords, etc. Sort of the thing that happens when I press “CTRL-N” in the INSERT mode. If that fails I would like it to try to complete the word as just an English word. Say I’m in a Perl program and I’m writing a comment. And I forgot how to spell “necessary” — superb would try to complete based on the variables/keywords in the file and if not, look inside the English dictionary. Actually, that mode of completion would work for everything (even email messages — I think?). I read about chaining yesterday and couldn’t make it to work the way I described above. I put this in my .vimrc:
This results in just dictionary completion (vars/keywords in the file are ignored) I don't get what |
You've got the right idea, unfortunately supertab can only chain together omni completion (or user completion) with any other completion as a fallback. This is because only omni and user completion have functions that can be called to examine their results. Keyword, dictionary, spelling, and all the other completion methods don't have a way for a plugin to invoke them and examine the results (short of rewriting their functionality in vimscript), so supertab can only send those keybindings to vim, without knowing if anything was suggested or not.
When you set the default completion to
Which part do you find confusing? I can probably clarify anything that isn't clear.
That depends on what |
So, doesn't putting
Well, the docs say the default completion mode is And why wouldn't I want the 'context' mode as the default anyway? Isn't it the best of all worlds? So, what should the chaining configuration be so that the first shot is at "context", then the dictionary completion? Do you mind pasting what you think it would look like? |
I think I need to understand how vim completion works in vim in general. Then ask my questions. So let me do my homework first. |
Supertab's completion chaining only supports chaining
Supertab sends that keybinding (Ctrl-P) to vim, so it tells vim to run keyword completion. Run the following in vim to see the help documentation for that insert completion method:
That's a personal preference and could depend on what you're doing. In this case, yes, I think it is what you want, especially since it is one of the only two methods that will utilize completion chaining.
It's exactly what you have, but with the default set to context:
As the supertab completion chaining docs state (
After this discussion, I think I'm going to update the |
update SuperTabChain to set the omni precedence and the default completion to 1 of the supported defaults and prevent overriding of that through calls to SuperTabSetCompletionType. refs #156
Hi
Love the plugin. A couple of questions:
<CTRL-X><CTRL-P>
?let g:SuperTabSetDefaultCompletionType="context"
let g:SuperTabContextDefaultCompletionType="<c-x><c-k>"
Hoping that if there are no completions, it will complete from the dictionary, but it doesn't :( When I do:
call SuperTabSetDefaultCompletionType('<c-x><c-k>')
it does work for dictionary completions, but then I'm not sure if for example perl completion is "fully operational".
What am I missing?
The text was updated successfully, but these errors were encountered: