0

I've been trying to install this package called nerdTree-visual-selection. It is a package that 'defines key mappings that will work on nodes contained in a Visual selection in NERDTree'. It was weird coz the Readme didn't specify how to install the package.

Firstly, I just tried using the vimplug using Plug 'PhilRunninger/nerdtree-visual-selection' and doing PlugInstall. However I am really confused because nothing really happened and nerdtree-visual-selection doesn't appear at the installation info window that appears.

I even tried just pasting the code to my .vimrc, but didn't work giving the following errors. It seems to be related to the variables not being visible in .vimrc, but I am not really familiar with vimscript.

So I assume that there is a different way to install this thing. Can anyone explain how to install this package? Thank you:)

Error detected while processing /home/bd08001/.vimrc:
line  278:
E121: Undefined variable: g:NERDTreeMapActivateNode
line  279:
E121: Undefined variable: g:NERDTreeMapOpenSplit
line  280:
E121: Undefined variable: g:NERDTreeMapOpenVSplit
line  281:
E121: Undefined variable: g:NERDTreeMapOpenInTab
Press ENTER or type command to continue
1

However I am really confused because nothing really happened and nerdtree-visual-selection doesn't appear at the installation info window that appears.

Normally every OP at StackOverflow is required to provide "a minimal complete and verifiable example", as otherwise every question is practically the same as "take three guesses where I could fail". My guess is that you probably saved your config file and then immediately tried :PlugInstall. And this doesn't work, because all configuration scripts are cached into RAM and not auto-updated after the files were changed. So you could just re-run Vim and tried :PlugInstall once again and then it probably had worked.

I even tried just pasting the code to my .vimrc, but didn't work giving the following errors

That code silently assumes that a few variables already exist at the time it is processed. As normally they are defined by NERDTree plugin, it follows that the code could only work if it is sourced after it. Observing that vimrc is usually sourced before any plugin... you now know why it fails (i.e. the code is fragile and bad).

But you don't need to mess with this issue if you succeed to install it properly.

1
  • thank you! its been long since i installed any new plugins, so I might have forgotten things
    – B1LLP4RK
    Oct 17 at 10:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.