-
Notifications
You must be signed in to change notification settings - Fork 100
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
Ex-Mode completion by external tool #259
Comments
I think it is better to pass the full command line as argument and let the script decide whether to provide a completion. In this way the script can support multiple characters for different modes of completion, or override some builtin completion. |
@yyt16384 Do you mean to give the whole command line as one argument, or separated. You are right, to give the full command line provides more flexibility but on the other side the script has to implement the logic to separate the parts that is already implemented in vimb. |
@fanglingsu No, I think @yyt16384 means to call the script on every completion invocation regardless of the context, i.e., without |
Sounds flexible, but also slow. To complete, it must be called a script that my handle the completion, if this does not return anything or returns a special return code the vimb internal one is used. At the moment I don't see a reason to complexify the completion to much to allo the user to change the behavior. In my opinion it should be sufficient to allow to kick in custom logic by using a special completion char like the |
@fanglingsu I totally agree. I also thought about the possibility of slowing things down. So the first approach seems more optimal for now. On the other hand, why not borrow something from Vim itself? I mentioned the While in Vim you cannot override completion for default commands, since it doesn't allow user-defined commands to start with a lowercase letter, this behavior not necesserily needs to be inherited in Vimb. (I don't really know the reasons behind this.) The |
I am undecided. Of course, the |
According to #253 there are cases where the current implementation of completion does not meet the needs of the users or is in a way to inflexible. So it would be nice to be able to let vimb call a configurable script that generates the completions entries.
Suggestion is to do something similar to the bookmark completion for the
:open
and:tabopen
commands. If the inpubox contains a known command followed by space and and '@', the command and the stuff after the add should be given to the script which is considered to write the resulting matching entries tostdout
to be displayed like all the other completions.:command @tokens given to script<Tab>
would call the configured script with the two params 'command' and 'token given to script'.If the script writes lines containing a tab-char, then the line is split at the first one into the two parts that are displayed in the url history completion (only if
FEATURE_TITLE_IN_COMPLETION
is defined).The text was updated successfully, but these errors were encountered: