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
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.)
Related
Ok so I'm setting up MacVim on my new macbook with Yosemite, using a homebrew installation.
To start off with I have no ~/.vimrc or ~/.gvimrc files setup at all.
Also I'm already familiar with links on stackoverflow which have explained that the .gvimrc file settings are usually applied after the .vimrc settings
When I execute the following command directly in MacVim my color scheme is applied fine
:colorscheme twilight
However, when I add the following line to a newly created ~/.gvimrc file the colour scheme does not load when I restart MacVim
colorscheme twilight
Keep in mind that I have nothing else apart from this line in my .gvimrc file and I have not setup a .vimrc file. If I execute the following command in MacVim
:scriptnames
I get the following output (not all lines included for clarity):
1: /usr/local/Cellar/macvim/7.4-73_1/MacVim.app/Contents/Resources/vim/vimrc
...
14: /usr/local/Cellar/macvim/7.4-73_1/MacVim.app/Contents/Resources/vim/gvimrc
...
20: ~/.gvimrc
You will noticed that MacVim thinks it has loaded the .gvimrc file. Anyone got any ideas why the color scheme won't load?
Ok so it looks like I've figured out what the problem is. The gvimrc and vimrc files were setup fine in the end, the problem is to do with what command you're supposed to execute to run MacVim
I came across the following link:
https://code.google.com/p/macvim/issues/detail?id=138
It was post #6 which made me realise that I was possibly running MacVim in the wrong way. I'm figuring that initially I probably mistakenly ran the MacVim binary directly which according to that post is the incorrect way to do it. Of course because I was running MacVim from spotlight it was repeatedly rerunning the incorrect command.
Anyway, I ran the command Vim -g from the command line instead and it worked fine.
I am using VIM 7.0 on RHEL release 5.4, and downloaded cscope plugin from: http://cscope.sourceforge.net/cscope_maps.vim
and copied it to path(one instance at a time): ~/.vim/plugin/cscope_maps.vim & /usr/share/vim/vim70/autoload
and generated cscope -qbR from root dir of source files, & opening *.C files from same dir.
According to this(point 5) & cscope_maps.vim, I should be able to do keyword search by multiple keystroke: CTRL-\ <option> or CTRL-# <option> by placing the cursor under the keyword as we do for ctags. But I am able to access the cscope keyword search only through the vim's command line argument (ie., :cs f d or :cs f c) and not with multiple key stroke shortcut.
I've also tried pasting all the contents of cscope_maps.vim to ~/.vimrc, but it didn't help
Is there something I am doing wrong/ any other way to make it work?
As described in the plugin's documentation, copy the plugin to
~/.vim/plugin/cscope_maps.vim
The autoload directory you've chosen is wrong, this is for plugins' on-demand functionality.
Also, /usr/share/vim/vim70/ is owned by the default Vim package, don't touch anything there (in general), or you'll run into problems when reinstalling / upgrading packages! If you do need to have a system-wide plugin, check :help runtimepath and find / add a proper location that you own on the system.
Probably your code base is other then .c files. I was facing same issue as my code base includes c and c++ both. I was trying with c++ functions and was facing same issue you mentioned.
Hint- Build cscope data base with all required files.
Probably, you are missing the CSCOPE_DB environment variable - i.e, it should point to the valid cscope.out file
To check, once you are in vim, run :echo $CSCOPE_DB, mine shows:
/home/me/views/myrepo/cscope.out
I had the same problem with cscope and Vim 7.4. I could solve it in Arch uncommenting in cscope_maps.vim the bellow lines:
set timeoutlen=4000
set ttimeout
BTW I followed this tutorial to install cscope vim plugin on Arch:
https://wiki.archlinux.org/index.php/vim#cscope
I'm trying to get autocompletion for OCaml. I like using Vim and I found this plugin:
https://github.com/the-lambda-church/merlin
I installed it using OPAM and added the required lines to load it to my .vimrc
I made sure that OPAM bin folder (which contains ocamlmerlin) is in my .profile file and
checked that I can access it from the terminal and for vim I printed the PATH variable using "Ctrl-r =$PATH" and it shows that it contains OPAM bin folder.
It still doesn't work, I have no clue what else to do to make it work. I get syntax highlighting but that exists without merlin anyway. I want autocompletion to work.
If I press Ctrl-N to show completion suggestion I get "normal" vim completion which is basically just a list of words that are mentioned in the document.
Checking the startup log file, I can see that Vim did indeed load merlin:
chdir(/home/incraved/.opam/system/share/ocamlmerlin/vim/plugin)
fchdir() to previous dir
sourcing "/home/incraved/.opam/system/share/ocamlmerlin/vim/plugin/merlin.vim"
finished sourcing /home/incraved/.opam/system/share/ocamlmerlin/vim/plugin/merlin.vim
Searching for "/home/incraved/.opam/system/share/ocamlmerlin/vimbufsync/plugin/**/*.vim"
Any ideas?
Ctrl-N is the default completion; its sources are configured by the 'complete' option, but cannot include custom sources.
The Merlin plugin uses Omni completion, which is triggered with Ctrl-X Ctrl-O; see :help compl-omni.
I am using gVim on Windows 7 and I have tried installing fugitive.vim as described here.
As per the link , I have extracted fugitive.vim to
vim73/plugin folder which is in the runtime path for my gVim. But when I restart the gVim, I get "Not an editor command" message when I type in :Gedit , or :Git and also :h fugitive isn't giving a help page.
Also, I tried using the recommended pathogen.vim method as described here. I extracted pathogen.vim into my vim73/autoload folder and then created a bundle folder in gVim home directory(c:\Program Files\Vim). I extracted fugitive.vim into the bundle folder.
Updated the _vimrc file with the execute pathogen#infect() command and restarted gVim, but no luck..
Please help me understand where I am going wrong.
I have found it difficult to get fugitive working on Windows.
I do have a few things for you to try, found using :h plugin.
:echo has("eval")
If this returns 0, your build of vim/gvim does not support plugins.
:echo g:loaded_fugitive
If this returns an error, vim did not spot your plugin during start, check :h plugin for correct directories to install to.
If this returns 1, as mine did and it still did not work, try adding set shellslash to your .vimrc file. This got mine working.
I'm using the script to open gVim in fullscreen downloaded from here: http://www.vim.org/scripts/script.php?script_id=2596.
I've also added this line to the startup settings:
:call libcallnr("gvimfullscreen.dll", "ToggleFullScreen", 0)
When running gVim with this setting, I get the following error:
Error detected while processing _virmc:
E364: Library call failed for "ToggleFullScreen()"
Is there anything else I need to do with the files from that script? If I need to compile it somehow, would like someone to guide me through that process as I'm fairly new to Vim. Thanks!
Edit: I'm running Windows 7
I guess you mean ~/.vimrc or ~/.gvimrc by "startup settings". When that is executed, the GUI isn't initialized yet. Try delaying the execution with an autocmd:
:autocmd GUIEnter * call libcallnr("gvimfullscreen.dll", "ToggleFullScreen", 0)
It doesn't seem to be working if you place that call line in your vimrc. It should be called after Vim has finished loading. I suggest using that mapping from the readme:
map <F11> <Esc>:call libcallnr("gvimfullscreen.dll", "ToggleFullScreen", 0)<CR>
It worked for me.
I had the same problem when I was install this script through Vundle.
It's solved the problem:
Copy the DLL to the folder where GVIM.EXE is located.
An alternative to copying the gvimfullscreen.dll to the executable directory is to specify the file path, like this:
call libcallnr(expand("$VIM") . "/bundle/gvimfullscreen_win32/gvimfullscreen.dll", "ToggleFullScreen", 0)
In this example, I'm using $VIM and the bundle directory, but you can change this to a full path, or use another variable/path that works better for you.
This isn't a direct answer, but after searching for a solution for quite a while, I've decided that the prettiest way to run Vim on Windows is via Cygwin, via the (bundled) mintty terminal. It has a genuine full screen and even transparencies!