Hi,
I am trying to get autocompletion working for C files, specifically for
structure members.
I installed OmniCppComplete plugin.
I get "-- Omni completion (^O^N^P) Pattern not found" after I type the "." for
a struct variable "foo" as shown below.
I am using vim 7.3 and exuberant ctags 5.8.
-bash-3.2$ cat ~/.vimrc
" This is a comment
syntax on
set path=**
set tabstop=4
set number
" omnicppcomplete
set nocp
filetype plugin on
-bash-3.2$
-bash-3.2$ ls
f1.c f1.h tags
-bash-3.2$
-bash-3.2$ cat f1.h
typedef struct mystruct {
int a;
int b;
} myType;
-bash-3.2$ cat f1.c
#include "f1.h"
void main (void)
{
myType foo;
foo. <-- as soon as I type the ".", I get Pattern not found!
}
-bash-3.2$ cat tags
!_TAG_FILE_FORMAT 2 /extended format; --format=1 will not append ;"
to lines/
!_TAG_FILE_SORTED 1 /0=unsorted, 1=sorted, 2=foldcase/
!_TAG_PROGRAM_AUTHOR Darren Hiebert /[email protected]/
!_TAG_PROGRAM_NAME Exuberant Ctags //
!_TAG_PROGRAM_URL http://ctags.sourceforge.net /official site/
!_TAG_PROGRAM_VERSION 5.8 //
a f1.h /^ int a; $/;" m struct:mystruct
b f1.h /^ int b;$/;" m struct:mystruct
myType f1.h /^} myType;$/;" t typeref:struct:mystruct
mystruct f1.h /^typedef struct mystruct {$/;" s
mytype f1.c /^myType mytype;$/;" v
-bash-3.2$
-bash-3.2$ ctags --version
Exuberant Ctags 5.8, Copyright (C) 1996-2009 Darren Hiebert
Compiled: Jul 26 2009, 02:42:37
Addresses: <[email protected]>, http://ctags.sourceforge.net
Optional compiled features: +wildcards, +regex
-bash-3.2$
-bash-3.2$ vim --version
VIM - Vi IMproved 7.3 (2010 Aug 15, compiled May 17 2012 11:09:33)
Included patches: 1-487
Compiled by <[email protected]>
Huge version without GUI. Features included (+) or not (-):
+arabic +autocmd -balloon_eval -browse ++builtin_terms +byte_offset +cindent
-clientserver -clipboard +cmdline_compl +cmdline_hist +cmdline_info +comments
+conceal +cryptv +cscope +cursorbind +cursorshape +dialog_con +diff +digraphs
-dnd -ebcdic +emacs_tags +eval +ex_extra +extra_search +farsi +file_in_path
+find_in_path +float +folding -footer +fork() +gettext -hangul_input +iconv
+insert_expand +jumplist +keymap +langmap +libcall +linebreak +lispindent
+listcmds +localmap -lua +menu +mksession +modify_fname +mouse -mouseshape
+mouse_dec +mouse_gpm -mouse_jsbterm +mouse_netterm -mouse_sysmouse
+mouse_xterm +mouse_urxvt +multi_byte +multi_lang -mzscheme +netbeans_intg
+path_extra +perl +persistent_undo +postscript +printer +profile +python
-python3 +quickfix +reltime +rightleft -ruby +scrollbind +signs +smartindent
-sniff +startuptime +statusline -sun_workshop +syntax +tag_binary
+tag_old_static -tag_any_white +tcl +terminfo +termresponse +textobjects +title
-toolbar +user_commands +vertsplit +virtualedit +visual +visualextra +viminfo
+vreplace +wildignore +wildmenu +windows +writebackup -X11 -xfontset -xim -xsmp
-xterm_clipboard -xterm_save
system vimrc file: "$VIM/vimrc"
user vimrc file: "$HOME/.vimrc"
user exrc file: "$HOME/.exrc"
fall-back for $VIM: "/tools/oss/packages/x86_64-rhel5/vim/7.3/share/vim"
Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H -I/usr/brcm/oss/include
-I/usr/brcm/oss/include -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1
-I/usr/include -D_REENTRANT=1 -D_THREAD_SAFE=1 -D_LARGEFILE64_SOURCE=1
Linking: gcc -Wl,-E -L/usr/brcm/oss/lib64 -R/usr/brcm/oss/lib64
-L/usr/brcm/oss/lib -R/usr/brcm/oss/lib -L/usr/lib64 -R/usr/lib64
-L/usr/local/lib -Wl,--as-needed -o vim -lm -lelf -lnsl -lselinux
-lncurses -lacl -lattr -lgpm -Wl,-E
/tools/oss/packages/x86_64-rhel5/perl/5.8.8-64/lib/5.8.8/x86_64-linux-thread-multi/auto/DynaLoader/DynaLoader.a
-L/tools/oss/packages/x86_64-rhel5/perl/5.8.8-64/lib/5.8.8/x86_64-linux-thread-multi/CORE
-lperl -lnsl -ldl -lm -lcrypt -lutil -lpthread -lc
-L/tools/oss/packages/x86_64-rhel5/python/default/lib/python2.7/config
-lpython2.7 -lpthread -ldl -lutil -lm -Xlinker -export-dynamic -L/usr/lib
-ltcl8.4 -ldl -lpthread -lm
-bash-3.2$
My tags file looks OK to me with the typedef and structure members, etc.
omnicppcomplete must be working since as soon as I type ".", I get pattern not
found (I don't even need to type C-x C-o).
It is not the "typedef" that is causing me the problem because I have the same
problem without it as well (struct mystruct { int a; int b; }; etc).
Any idea how to debug this further? or what is wrong?
Thanks
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php