Pergunta

i'm newbie on Vim and now I have problem:

I have installed Pathogen and CtrlP scripts on my vim. But CtrlP doesn't load properly any CtrlP's command or shortcut doesn't work, only help pages work. It says that :CtrlP is not editor command and CtrlP's shortcuts doesn't make anything.

Pathogen.vim is under ~/.vim/autoload/, and CtrlP is in ~/.vim/bundle/ctrlp.vim/

Here's my .gvimrc:

" Enable pathogen
call pathogen#infect()
call pathogen#helptags()

" Remove toolbars and scrollbars
set guioptions-=r " Scrollbars
set guioptions-=T " Toolbar
set guioptions-=m " Menubar

" Enable line numbers, curosorline and set colorscheme
set number
set cursorline
colo wombat

" Reload .gvimrc when saved it
au BufWritePost .gvimrc so %

" Ctrl-S file saving shortcut
nmap <C-S> :w<CR>

And here's how i installed scripts:

$ cd
$ mkdir -p .vim .vim/autoload .vim/bundle
$ curl -Sso ~/.vim/autoload/pathogen.vim \
    https://raw.github.com/tpope/vim-pathogen/master/autoload/pathogen.vim
$ cd .vim
$ git clone https://github.com/kien/ctrlp.vim.git bundle/ctrlp.vim
$ gvim ~/.gvimrc

And then I wrote that .gvimcr file, and googled and googled, and came here to ask.

Foi útil?

Solução

Yes, finally I solved it!

Move your execute pathogen#infect() and filetype plugin indent on to your ~/.vimrc, I have no idea, but seems that it doesn't work if these lines are in ~/.gvimrc.

Thanks!

Outras dicas

It looks you have taken wrong step at cloning CtrlP repo. @romainl already pointed that out but you fixes may not be correct.

Here is a revised steps

$ cd
$ mkdir -p .vim/autoload .vim/bundle
$ curl -Sso ~/.vim/autoload/pathogen.vim \
    https://raw.github.com/tpope/vim-pathogen/master/autoload/pathogen.vim
$ cd .vim/bundle
# Different git command! Do it in root of /bundle!
$ git clone https://github.com/kien/ctrlp.vim.git

Now go to vim, run :Help to rebuild help files by Pathogen.

Should be okay now.

You probably created the wrong tree directory. Make sure the ctrlp.vim directory is inside bundle directory. The same happened to me because I did git clone of ctrlp plugin repository inside the bundle repository.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top