Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Vim error 1187 (cannot source the defaults.vim file) after installing Vundle

Tags:

git

vim

vundle

I'm absolutely new in C and Vim (now learning), started from Python, but now turned to C for educational reasons, along with which I had to learn the Vim (the point is, it wasn't my choice). The system is Windows 10. Here is the problem:

  1. I installed Vim (32-bit) from here (https://github.com/vim/vim-win32-installer/releases), adjusted it (added to path, edited enviromental variables and so on as in tutorials), found a proper _vimrc file. Vim started working successfully (at least, it opened without errors, showed all the functionality and let me edit the _vimrc file (I mean, before looking for a proper one in the web)).

  2. The next step was to install a Vundle. As in tutorial, I've made in C:\Program Files\Vim a "vimfiles" directory with "bundle" folder and followed the instruction to insert in CMD "git clone https://github.com/VundleVim/Vundle.vim.git C:\Program Files\Vim\vimfiles\bundle". Common CMD told me GTFO, but Git CMD reacted to the command, though again refusing to satisfy me, as there were "too many arguments".

  3. Okay, I googled for it more and found another tutorial with CMD instruction, which advised to insert a "git clone https://github.com/VundleVim/Vundle.vim.git ~/vimfiles/bundle/Vundle.vim" command. It actually worked (I thought), black plate of CMD got filled with multiple white letters indicating the downloading process. After the process was finished, I've checked the vimfiles\bundle folder, it appeared to be empty, but never mind, I did as I was told to.

  4. The next step instructed to edit the _vimrc file, to add some strings about Vundle into it. And as soon as I've tried to open _vimrc via Vim (or gVim), it showed a warning with Error E1187: failed to source defaults.vim. The Vim window opened without any functionality, empty, with only two lines on the bottom containing, I guess, the file size info.

  5. I've cried a bit, but then gathered myself and decided to delete the whole "vimfiles" folder in hope to make it back to the previous step. It didn't work. I thought that it might be the second repository, which led me to the mistake, so I recreated vimfiles\bundle folder, but for this time I used the first repository with shortening my directory as in the second repository command (~/vimfiles/bundle/Vundle.vim). The answer was: "this directory is not empty etc."

  6. After another session of crying I accepted the challenge and deleted (de-installed) Vim, downloaded it as from the very beginning, repeated all the aforementioned actions. But once again, the installation of Vundle informed me that "vimfiles\bundle" folder was not empty, so "suck, my dear". Again, the reinstalled Vim didn't work properly because of the same error 1187; although it showed the contains of _vimrc file, but for reading only.

  7. Then I've surrendered and went here to seak for a help/advice/mercy. Please help, because I'm going to foam from my mouth soon with this Vim.

like image 546
TiimeIrre Avatar asked Feb 16 '26 13:02

TiimeIrre


2 Answers

This is still a problem in Cygwin64 releases.

Since this is one of the highest posts on Cygwin64 VI with the error "Cannot source the defaults.vim file", I thought to post this simple, quick fix.

Touch .exrc in your home (~) directory (cygwin64 home, not windows). Problem goes away. I found the answer last year on a Redhat forum when it cropped up as an issue years ago. Note this is an .exrc and not .virc or .vimrc file as one answer here gives.

like image 189
SurplusGadgets Avatar answered Feb 18 '26 18:02

SurplusGadgets


I had this issue after building from source. I created .vimrc file in my ~ directory and the issue was resolved.

like image 41
Pauls Bebris Avatar answered Feb 18 '26 18:02

Pauls Bebris