2012-05-10 6 views
6

vimでclangを使うのが好きです。ブーストによるclang_completeの検索時間を短縮する方法

私が常に持っている1つの問題は、私がブーストを含めるときはいつでも、私が "。"を入れるたびにブーストライブラリを通過するということです。オブジェクト名の後に。 5〜10秒かかります。

私はブーストヘッダーに変更を加えていないので、ブーストを通じて検索をキャッシュする方法はありますか? そうでない場合は、自動補完検索からブーストを削除する方法はありますか?

更新は、(1)adaszko 後により応答する応答:せG:

  1. 1 = clang_use_library Iは、変数の名前を入力します。
  2. 私は^ Nを押します。 Vimはboostツリーを検索し始めます。変数を自動補完します。
  3. 「」を押します。そして、次のエラーを取得:
Error detected while processing function ClangComplete: 
line 35: 
Traceback (most recent call last): 
Press ENTER or type command to continue 
Error detected while processing function ClangComplete: 
line 35: 
    File "<string>", line 1, in <module> 
Press ENTER or type command to continue 
Error detected while processing function ClangComplete: 
line 35: 
NameError: name 'vim' is not defined 
Press ENTER or type command to continue 
Error detected while processing function ClangComplete: 
line 40: 
E121: Undefined variable: l:res 
Press ENTER or type command to continue 
Error detected while processing function ClangComplete: 
line 40: 
E15: Invalid expression: l:res 
Press ENTER or type command to continue 
Error detected while processing function ClangComplete: 
line 58: 
E121: Undefined variable: l:res 
Press ENTER or type command to continue 
Error detected while processing function ClangComplete: 
line 58: 
E15: Invalid expression: l:res 
Press ENTER or type command to continue 

を...と何の自動compeltion

更新はありません(2) ないclang_completeが問題の世話をする必要がある場合は必ずブースト付き。プラグインなしのvimは、boostを使って検索します。 スーパーユーザーにはanswerがあり、ブーストディレクトリで検索をコメントアウトすることができます。

+0

Vimの変数gの価値は何ですか:clang_use_library? – adaszko

+0

@adaszko ':let g:clang_use_library'が' g:clang_use_library#0'を返します –

答えて

0

hereから、あなたの.vimrcに以下を追加することができます。

:set include=^\\s*#\\s*include\ \\(<boost/\\)\\@! 

(ブーストを通じて検索をキャッシュの問題ががまだ開いている)

3

少なくとも2つのオプションがあります。オプション#1はg:clang_use_library1に設定します。ここ:help g:clang_use_libraryはそれについて言っているのです:

Instead of calling the clang/clang++ tool use libclang directly. This 
gives access to many more clang features. Furthermore it automatically 
caches all includes in memory. Updates after changes in the same file will 
therefore be a lot faster. 

しかしこれはPythonのVimの統合の作業設定が必要です。

オプション#2を使用すると、->.::後 自動補完を無効にし、あなたが望むときはいつでも<C-x> <C-o> 代わりに手動clang_completeを呼び出すために使用することができるによって0g:clang_complete_autoを設定することです。

私は両方を使用します。

+0

オプション2が処理されました –

+0

おそらくこれは将来のバージョンで改善されるでしょう。オプション1のために – adaszko

+0

、私はアップデートを追加しました( –

0

私は、パフォーマンスの向上をたくさんやりましたclang_completeするには、問題#187でこれについて確認できます。問題の大きな部分は、最適化されていないコードによるスクリプトのパフォーマンスが弱いことでした。

関連する問題