vim でオムニコンプリーションまたはオムニコンプリーション関数を使用して、glibc 関数の自動補完を実現したいと考えています。たとえば、C ソース ファイルに pri と入力し、C-x C-o を押して printf を補完するリストをポップアップ表示します。
問題は、ctags を使用して、glibc-headers-2.15-57.fc17.i686 によってインストールされた標準 C ヘッダー ファイルを処理し、tags_glibc ファイルを生成することです。ただし、C ソース ファイルに pri と入力し、C-x C-o と入力すると、ポップアップ メニューには stdio2.h の printf の定義とプロトタイプ宣言のみが表示され、stdio.h の printf 宣言は表示されません。奇妙なのは、vim を使用して生成されたタグ ファイルを表示し、printf を検索し、次の 3 つのエントリを見つけたことです。
リーリー
同じ現象は、fprintf (このシンボルは stdio.h および stdio2.h で使用可能)、memcpy (string.h および string3.h で使用可能) などの関数でも発生します。
使用される ctags コマンドは次のとおりです:
リーリー
リーリー
質問
-e
Include extern tags. ctags will normally ignore extern declarations of functions or variables; that's handy when generating tags for your own programs. A tags file for the extern declarations in the system's standard header files can be a very handy resource, so this -e flag was created.
From http://elvis.the-little-red-haired-gi...
使用tags文件时,需要在tags所在的目录打开vim。
不同目录时需要在vim里设置tags变量,变量值为tags文件路径。例如: