omnicomplete

Is VIM omni-completion really so limited? Or am I missing something?

走远了吗. 提交于 2020-01-22 19:49:05
问题 Ruby: file = File.new("some.txt", "r") lines = file.readlines Omni-completion tests file.readl --------- readline <- PASSED readlines --------- "hola".capital --------- capitalize <- PASSED capitalize! --------- lines. <-- FAILED (no suggestions) lines[0].capital <-- FAILED (no suggestions) I tried Python as well, and it worked in similar way. So it looks like omni-completion can't be used for real development, as it fails on pretty simple cases? Am I missing some thing? May be the

Is there any way to get python omnicomplete to work with non-system modules in vim?

一曲冷凌霜 提交于 2020-01-10 08:26:56
问题 The only thing I can get python omnicomplete to work with are system modules. I get nothing for help with modules in my site-packages or modules that I'm currently working on. 回答1: I get completion for my own modules in my PYTHONPATH or site-packages. I'm not sure what version of the pythoncomplete.vim script you're using, but you may want to make sure it's the latest. EDIT: Here's some examples of what I'm seeing on my system... This file (mymodule.py), I puth in a directory in PYTHONPATH,

Problem with Vim omnicomplete and system Python

只愿长相守 提交于 2019-12-23 19:01:29
问题 I have Vim set up, with +python ( :version says it's ok). My .vimrc contains filetype plugin on set ofu=syntaxcomplete#Complete autocmd FileType python setlocal omnifunc=pythoncomplete#Complete When some .py file is open, and I type i.e. pri and press Ctrl - X , Ctrl - O , it says no pattern was found? Am I missing something? Can I somehow rebuild Vim's Python keyword database? 回答1: Rather than syntaxcomplete#Complete , use pythoncomplete#Complete : # ~/.vim/ftplugin/python.vim setlocal

vim update complete popup as I type

旧街凉风 提交于 2019-12-23 18:52:07
问题 I am trying to use complete() in vim so that it reads the value as well. For example, from vim 's complete() example, inoremap <F5> <C-R>=ListMonths()<CR> func! ListMonths() call complete(col('.'), ['January', 'February', 'March', \ 'April', 'May', 'June', 'July', 'August', 'September', \ 'October', 'November', 'December']) return '' endfunc if I type <F5> I will get all the months as a pop up. Now, what I want is, if I type "J", only January, June and July will be shown, "Ju" will give June

ctags for autocompleting c++ library functions in vim

守給你的承諾、 提交于 2019-12-13 08:01:58
问题 After following some tutorials i tried to use exuberant ctags to autocomplete e.g. openGL functions. I used the command ctags -R --languages=C,C++ --c++-kinds=+p --fields=+iaS --extra=+q ./ in the directory where the freeglut.h, glew.h etc resides. Then copying this to a directory pointed by in the .vimrc file (with 'set tags+=./myTag/tags' in my .vimrc) When I try to autocomplete some glut functions i dont get the funciton parameters listed, only the function itself gets completed, but

Vim omnicompletion for Java

ε祈祈猫儿з 提交于 2019-12-12 07:51:33
问题 I've read heaps of blogs on Vim's supposedly great omnicompletion, and yet no matter what I do I can't get it to work satisfactorily. It took me ages to figure discover that the version of ctags that is preinstalled on my system was the emacs one, and didn't have the --recurse option, but now that I've run ctags-exuberant on my copy of the OpenJDK sources to attempt to get some kind of code completion going, Vim hangs whenever I try to invoke it with [C-n] or [C-p]. All I really want is

VIM - Sourcing tags from multiple locations in project

回眸只為那壹抹淺笑 提交于 2019-12-09 06:25:35
问题 Good day, I typically work on relatively small (less than 20,000 lines of code) projects that are all self contained within a single directory, have their own Makefile, and are fairly easy to work with. VIM is my preferred editor, and when I open a project, I typically build the ctags list via a mapping to the F10 key: map <F10> :!ctags -R --c++-kinds=+p --fields=+iaS --extra=+q .<CR> This allows me to jump to the definition of a variable/struct/etc via moving the cursor over the text, and

Vim 中使用 OmniComplete 为 C/C++ 自动补全(部分增加)

最后都变了- 提交于 2019-12-07 08:41:15
对原文做了部分修改及增加, 原文地址 http://timothyqiu.com/archives/using-omnicomplete-for-c-cplusplus-in-vim/ OmniComplete 并不是插件的名字,而是 Vim 众多补全方式中的一种(全能补全)。说白了 OmniComplete 其实就是根据光标前的内容猜测光标后的内容,具体怎么猜取决于所采用的脚本。 而 OmniCppComplete 就是专为 C/C++ 编写的 OmniComplete 一个补全脚本。 那么经常和 OmniCppComplete 一起出没的 Ctags 又是什么呢?Ctags 全名 Exuberant Ctags,是一个独立的程序(也就是说,其实和 Vim 一点关系都没有)。它可以为各种语言的源代码生成语言元素(language object)索引文件。对于 C/C++ 来说,就是把源代码中的各种宏、函数、类、类成员等等元素和它们的相关信息生成索引文件,供其它程序使用。 OmniCppComplete 脚本就是根据 Ctags 生成的索引文件进行补全的。 好了,背景知识就是这样,安装步骤如下: 安装 Ctags 一般ctags 都是默认安装过的,fedora下可以用yum list ctags,查看是否安装 从官网下载 Ctags 可执行文件,网站是 http://ctags

Vim status bar prediction/completion?

心不动则不痛 提交于 2019-12-05 18:09:08
问题 I played with some vim scripting yesterday and managed to get some over-the-status-bar prediction to whatever I'm typing at the moment, with cycling - see screenshot (gray + yellow bar). Problem is, I can't remember how I got that or find the code snippet I used for that vim magic (I remember it being quite simple): it was either an example in the docs or something I picked up in the vim wiki. So, I'm trying to retrace my steps - any clue on what vimscript function/s to look up for these? I

Is VIM omni-completion really so limited? Or am I missing something?

倾然丶 夕夏残阳落幕 提交于 2019-12-04 05:07:16
Ruby: file = File.new("some.txt", "r") lines = file.readlines Omni-completion tests file.readl --------- readline <- PASSED readlines --------- "hola".capital --------- capitalize <- PASSED capitalize! --------- lines. <-- FAILED (no suggestions) lines[0].capital <-- FAILED (no suggestions) I tried Python as well, and it worked in similar way. So it looks like omni-completion can't be used for real development, as it fails on pretty simple cases? Am I missing some thing? May be the intellisense can be improved some how for Ruby/Python? The issue is that Vim does not know if line is a String,