Skip to content

"E121: Undefined variable: b:NERDTree" #1

@cmdcolin

Description

@cmdcolin

Hi there,

I just was trying to use the command

:NERDTreeProjectSave myproj

It gave me the error "E121: Undefined variable: b:NERDTree"

My full vimrc is

set t_Co=256
if empty(glob('~/.vim/autoload/plug.vim'))
  silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs
      \ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
    autocmd VimEnter * PlugInstall --sync | source $MYVIMRC
endif

call plug#begin('~/.vim/plugged')
Plug 'editorconfig/editorconfig-vim' " editorconfig, always not fucking working
Plug 'tpope/vim-commentary' " allows typing v-select block then gc to comment block
Plug 'tpope/vim-fugitive' " allows some git commands inside vim
Plug 'joshdick/onedark.vim' " theme
Plug 'vim-airline/vim-airline' " status line
Plug 'leafgarland/typescript-vim'
Plug 'pangloss/vim-javascript'
Plug 'scrooloose/nerdtree' ""
Plug 'w0rp/ale' " autofix and linting
Plug 'Xuyuanp/nerdtree-git-plugin' " display files as modified from git in nerdtree
Plug 'junegunn/fzf.vim'
Plug 'yegappan/mru'
Plug 'scrooloose/nerdtree-project-plugin'
call plug#end()
colorscheme onedark
let g:airline#extensions#tabline#enabled = 1
autocmd vimenter * NERDTree
autocmd VimEnter * wincmd p

"closes nerdtree on last
autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif
set mouse=a
set autoread
set nu
set noswapfile
set nobackup
set nowb

let NERDTreeMouseMode=3
let g:ale_fixers = ['eslint']



let g:ale_fix_on_save = 1
set backspace=indent,eol,start " for some reason backspace doesn't work normally, wtf
set list
let g:EditorConfig_exclude_patterns = ['fugitive://.*']

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions