1

I'm trying to use the CoqIDE for vim plugin I found on this page.

I put the coq_IDE.vim file in ~/.vim/ftplugin folder. My current .vimrc file is:

set showcmd
set number
imap hl <Esc>
filetype plugin on

But when I start vim CoqIDE doesn't load automatically (I see no change whatsoever compared to normal vim, so I don't think it did). And when I try to load it manually by the command :source coq_IDE.vim, I get the following error message:

E484: Can't open file coq_IDE.vim

What could be the source of this error?

Here are some additional information that might be relevant:

1) I am running Ubuntu 14.04.

2) I checked that :version in vim shows +perl.

2) I am running vim from terminal, not gvim.

3) I tried removing and reinstalling different versions of vim (vim, vim-gtk, vim-gnome)

4) The CoqIDE installation guide says that coqtop.opt should be accessible via the PATH variable. Since I'm not even sure what this means, this might be the problem here, but that seems unlikely. From what I understand vim is getting errors when trying to read coq_IDE.vim, so it's not even getting to the part where it's looking for coqtop.opt.

5) I have CoqIDE installed from Ubuntu Software Center.

6) With :echo &runtimepath I get: ~/.vim,/var/lib/vim/addons,/usr/share/vim/vimfiles,/usr/share/vim/vim74,/usr/share/vim/vimfiles/after,/var/lib/vim/addons/after,~/.vim/after

1 Answers1

1

The instructions are bad.

Put the file in ~/.vim/plugin not ~/.vim/ftplugin

The file layout should look exactly like the file layout found in this mirror for the plugin. https://github.com/vim-scripts/CoqIDE. (Maybe take a look at pathogen or vundle,).

The reason the :source coq_IDE.vim fails is vim is looking for the file coq_IDE.vim in the current directory and it isn't there. Use the full path to file if you are going to source it manually. (You shouldn't need to though.)

FDinoff
  • 30,689
  • 5
  • 75
  • 96
  • I changed the folder name so that `coq_IDE.vim` is now in `~/.vim/plugin`, but still getting the same errors. Perhaps I should also downgrade the plugin version to 0.96b to match it more exactly? (I'm using 0.97.b right now.) I'm new to vim and I haven't used vundle yet, but I guess I'll check that out as well. – user3287108 May 18 '14 at 00:56
  • @user3287108 which error are you talking about? And downgrading shouldn't make a difference. Does the output of `:scriptnames` show the file being loaded? – FDinoff May 18 '14 at 00:58
  • Wait, I changed directory into `~/.vim/plugin` before using the `:source coq_IDE.vim` command and it doesn't give any more errors, so I think it's working. Now I'm getting errors with `coqtop` part but I guess that's a different question. Thanks. – user3287108 May 18 '14 at 01:05
  • @user3287108 do not manually source it. The plugin is automatically sourced at startup when it is in the ~/.vim/plugin folder – FDinoff May 18 '14 at 01:06