Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Disable root node refresh on window focus

Whenever I focus my MacVim window it freezes for several seconds. It seems that this is due to NERDTree refreshing it's root node (It prints NERDTree: Refreshing root node. This could take a while... DONE)

Since I often switch in and out of MacVim this is very annoying and slows down my workflow. Is there a way of configuring NERDTree not to do this automatically?

EDIT: I am using janus

like image 728
chopper Avatar asked Dec 07 '14 21:12

chopper


People also ask

Is it possible to disable the Refresh icon on the browser?

But dear disabling the refresh icon on the browser is next to impossible. Like disabling the back button we manipulate with the browser history. But We cant manipulate with the browser defaults.

How to disable the mouse-click on refresh button?

The function "disableF5" is quick and easy and keeps that button from doing anything. However, to prevent the mouse-click on refresh button, a couple things take place. When lock is clicked, user session data has a variable called "locked" that becomes TRUE

Is there a way to disable refreshing from the context menu?

You'll probably also want to add cases for Ctrl+F5 and Ctrl+R. Also, most browsers allow refreshing from the context menu. Not much you can do here besides disabling the context menu all together, which in most cases is something to avoid. Of course, this doesn't disable refreshing at all.

How to disable the Ctrl+F5 button on the browser?

You can disable the ctrl+f5 and only f5 button/keypress using javascript. Below are few links you can follow up with:- But dear disabling the refresh icon on the browser is next to impossible. Like disabling the back button we manipulate with the browser history. But We cant manipulate with the browser defaults.


1 Answers

I'm going to go out on a limb and say that you're using janus. Janus adds a FocusGained event, and so when you do :au FocusGained as Kazuki mentioned, you'll see something like:

AuNERDTreeCmd  FocusGained
    *         call s:UpdateNERDTree()

You can remove that focus event binding by adding the following to your .vimrc.after:

autocmd! AuNERDTreeCmd FocusGained
like image 179
BBonifield Avatar answered Sep 23 '22 23:09

BBonifield