Vim可以支持多参数代码完成吗?

时间:2018-09-07 15:31:55

标签: vim autocomplete code-completion

我将YouCompleteMe与Vim一起使用,可以很好地完成包括函数名在内的标识符。

但是,我仍然感觉不如在IDE中完成生产率高。在IDE中,我可以通过“令牌”完成整个函数调用,可以通过这些令牌进行制表以填写每个参数(或接受默认参数名称,例如,通过相同的参数进行传递)当前作用域中的命名参数。

以下是一个示例,说明令牌化自动完成相对于Vim工作流程如何加快我的速度:

I type the name of a function, <code>NSMakeRect</code>, which autocompletes with  labeled placeholders for each of the four arguments. I jump to the first placeholder, then type a value and repeat for the remaining arguments.

I perform the same operation in Vim, but it only autocompletes the first part of the function call and I have to type the rest by hand.

或者,如果我正在调用方法的基类的实现:

I type <code>super</code> and then the name of a method, and the method invocation appears with named placeholders for each argument. I jump to each placeholder and press "return", which replaces the placeholder with its label, which match the names of the variables I want to pass through.

Again, Vim only completes the first part of the method name, and I type the rest by hand.

我在示例中使用的是ObjC,因为它特别冗长,但是相同的区别适用于C和C ++。

任何Vim插件或工作流程都可以实现这种快速的,面向令牌的代码完成吗?

0 个答案:

没有答案