Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 805955
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T00:10:06+00:00 2026-05-15T00:10:06+00:00

I have Vim set up to use the excellent NERDTree plugin. However, there are

  • 0

I have Vim set up to use the excellent NERDTree plugin. However, there are some environments where I do not want this plugin to be loaded.

In my .vimrc I have a sections that are only run when specific environment variables are true. In one of these sections I would like to disable the loading of NERDTree but all of the information I’ve come across states how to disable all plugins, not just one.

Could someone demonstrate how to disable the loading of one specific plugin in Vim?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T00:10:06+00:00Added an answer on May 15, 2026 at 12:10 am

    Most plugins have a (re)inclusion guard.

    Open the plugin, see the name of the guard, if any (if not, add one by yourself, and contact the author to make him fix his plugin), and finally set its value to 1 in your .vimrc.
    That’s all.

    I can’t be more specific as “open, and look for the guard” as not all plugins use the same guards-naming policy. It’s often g:loaded_pluginname though.

    Regarding ftplugins, it becomes more tricky. The guard is a buffer-local variable. As such, it can’t be specified into your .vimrc (as it would apply only to the first buffer you open).
    The easiest way would be to move your ftplugin from .vim/ftplugin to .vim/after/ftplugin, and to set the relevant anti-reinclusion guard to 1 in a ftplugin in your non-after hierarchy. As long as the ftplugin does not expect to be placed in after/ (or the contrary, it should be fine).
    Note: most ftplugins believe they are unique and (mis-)use the variable b:did_ftplugin as reinclusion guard.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I use vim. Specifically I am using Janus . I have expandtab set. However,
I recently started using NERDTree with vim, and have set it to automatically open
I'm a bit confused about the use of Vim's menus. I have set wildmenu
I want to use Vim's soft wrap capability ( :set wrap ) to wrap
I have a few mappings in vim for moving between splits set in my
so 1GvG:s/..../g can replace over an entire buffer However, suppose I have multiple vim
I'm using vim 6.3.81 on a xterm through putty. When I use set mouse=a
So recently I have been trying to set up a Vim-based iOS workflow. I
I have tmux set up with $TERM being set to screen-256color correctly. This works
Note I am using the local vim plugin that allows me to use a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.