Question

Right now I have backup and swapfile turned off in my vimrc, like this

    set nobackup
    set noswapfile

and everything works fine. But if I decide to turn backup and swapfile on

    set backup
    set swapfile

then vim starts acting differently. For example, if I try to use nerdtree (I have F4 mapped to :NERDTreeToggle) I'll hit F4 and the entire screen will go blank, prompting me to hit enter to continue.

But when I have backup and swapfile turned off hitting F4 opens nerdtree like normal. Why does this happen? How do I turn on backup and swapfile without changing the behavior of vim?

Was it helpful?

Solution

In general, the settings should not affect Vim behavior. If this is limited to NERD_tree, I would contact the plugin author and ask for help. (I could not reproduce your problem.)

When this doesn't happen when you type the :NERDTreeToggle command yourself, maybe your mapping is missing a <silent> or :silent NERDTreeToggle.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top