2014-12-07 106 views
8

每當我關注我的MacVim窗口時,它會凍結幾秒鐘。看起來這是由於NERDTree刷新它的根節點(它打印NERDTree: Refreshing root node. This could take a while... DONE在窗口焦點上禁用根節點刷新

由於我經常切換進出MacVim,所以這非常煩人並且減慢了我的工作流程。有沒有配置NERDTree不會自動執行此操作的方法?

編輯:我使用劍鋒

回答

11

我要走出一條腿,說你正在使用janus。 Janus adds a FocusGained event,所以當你做:au FocusGained爲一輝提到,你會看到類似這樣的:

AuNERDTreeCmd FocusGained 
    *   call s:UpdateNERDTree() 

您可以通過添加刪除焦點事件結合下述您.vimrc.after

autocmd! AuNERDTreeCmd FocusGained 
+0

謝謝 - 工作!我確實在使用janus(我真的應該在我的問題中提到 - 我現在要補充說明)。一個小小的評論 - 我認爲在janus中添加上述命令的適當文件是'.vimrc.after' – chopper 2014-12-20 13:01:42

2

我覺得NERDTree本身並不自動刷新根節點。其實我不能重現這個問題。你需要input R key (default) to refresh the root node

每當我關注它凍結我的MacVim窗口幾秒鐘

聽起來你正在使用FocusGained自動命令事件做一些事情。您可以使用以下命令檢查它。

:au FocusGained 

您將獲得FocusGained自動命令事件的列表。

--- Auto-Commands --- 
FocusGained 
    * ... 

例如,你可以自動刷新NERDTree根像this

+0

謝謝,樹 - 這表明我正確的方向,但我最終接受BBonifield的答案,因爲他提供了一個補救辦法。 – chopper 2014-12-20 13:03:09