无法获取 Vim 来引入字典;失败并显示此消息“-- 定义完成 (^D^N^P) 未找到模式”

Can't get Vim to bring in dictionary; fails with this message '-- Definition completion (^D^N^P) Pattern not found'

我已经在 Vim 中安装了 YCM 并且 <c-x><c-f> 用于文件完成效果很好。我也得到了正确的代码完成。

但刚刚注意到尝试访问 dictionary 似乎失败了,当使用:<c-x><c-d> 时。我只得到以下显示:

-- Definition completion (^D^N^P) Pattern not found

Vim版本:

VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Apr 21 2014 14:54:22)
MacOS X (unix) version

有什么想法吗?

<C-x><C-d> 是 "definition completion"。如果您使用的语言具有 "include" 机制并且 Vim 设置为遵循包含并识别该语言的 "definitions",则它会起作用。

参见:

:help i_ctrl-x_ctrl-d
:help 'include'
:help 'definition'

字典完成是 <C-x><C-k> 并且需要 'dictionary' 选项指向至少一个字典:

set dictionary=/path/to/dict

参见:

:help i_ctrl-x_ctrl-k
:help 'dictionary'