The
filetype plugin indent on
line is supposed to come after the two Pathogen lines.The relevant documentation says:
This code should sit in a file like
~/.vim/nerdtree_plugin/mymapping.vim
.So, since you use Pathogen, the right place is probably:
~/.vim/bundle/[nerdtree directory]/nerdtree_plugin/mymapping.vim
Unknown function: NERDTreeAddKeyMap
-
13-04-2022 - |
質問
I'm trying to add a keymap to my NERDTree configuration which executes the current FileNode and displays the output. I put this script file in my ~/.vim/plugin directory.
The keymap actually works when I source the script file from within Vim, but displays the error "Unknown function: NERDTreeAddKeyMap" when starting Vim.
I used Pathogen for my plugins, and in my ~/.vimrc I have all the necessary :
" Enable filetype plugins
filetype plugin indent on
" Start Pathogen plugin to load bundle
call pathogen#infect()
call pathogen#helptags()
As well as NERDTree in my ~/.vim/bundle directory.
Where should I move the script so that it is automatically loaded on Vim startup, without this ugly error ?
解決
所属していません StackOverflow