Search code examples
vimpluginsnerdtreecppcheck

how to install cpp_check.vmb in vim


I've found that cpp_check vim plugin on http://www.vim.org/scripts/script.php?script_id=5192 and I want to install it my vim plugin list. I have downloaded the .vmb from the link above, copied and I ran vim cpp_cppcheck.vmb & :so &, which copied the cpp_check.vim to ~/.vim/ftplugin/, I tried it out but it ddn't seem to work. I then moved the .vimfile into the plugin/ directory which allows me to execute :Cppcheck on a new vim instance but as soon as I launch :NERDTree in my vim environment, I loose the command :Cppcheck why is this and how can I fix it?

And if I close NERDTree again with NERDTreeClose, I get the :Cppcheck functionality back, too.
My .vimrc looks like:

$ cat ~/.vimrc
" Pathogen
execute pathogen#infect()
call pathogen#helptags() " generate helptags for everything in 'runtimepath'
syntax on
filetype plugin indent on

set tabstop=4
set shiftwidth=4
set expandtab
set autoindent
set autochdir

set tags=./tags,tags;$HOME

nmap <F8> :TagbarToggle<CR>

if has('cscope')
    set cscopetag cscopeverbose
    if has('quickfix')
        set cscopequickfix=s-,c-,d-,i-,t-,e-
    endif

    cnoreabbrev csa cs add
    cnoreabbrev csf cs find
    cnoreabbrev csk cs kill
    cnoreabbrev csr cs reset
    cnoreabbrev css cs show
    cnoreabbrev csh cs help

    command -nargs=0 Cscope cs add $VIMSRC/src/cscope.out $VIMSRC/src
endif

" g:CCTreeCscopeDb = "./cscope.out"

Solution

  • This is meant to be a C++ ftplugin.

    Activate filetype plugins in your vimrc