Vim error: cannot create diffs. Vim folder has no diff.exe - vim

When trying to use vim diff to compare two files on windows 7, I get an error message: cannot create diff. My vim version is 7.4.965.
Searching for this on the internet, it seems that C:/Program Files/Vim/vim74 should normally contain a diff.exe: it doesn't in my case.
Is this a correct assumption, and if so, how can I fix my Vim installation?

Did you see vim.exe in this directory?
My vim is installed in C:/Program Files(x86)/Vim/vim74

Related

VIM plugin NERDTree unable to handle subfolder name with matching parenthese

I met a problem with the NERDTree plugin while using VIM. It seems that NERDTree cannot handle some folder properly, if there are matching parenthese in the folder name, such as "[D]2015", "(t)", "foo[bar]", etc..
I can view its containing files by an O or X command on its parent folder within the NERDTree window, while o and x on this folder have no effect. If I just stay within the NERDTree window, I find no way to access/edit files in such a folder.
I can reach the contents in such a folder using ":Explorer" with netrw, or using command-line or external shell. However, I wonder if there are some tricks to fix this problem within the scope of NERDTree.
I met this problem on win7 (32bit) first.
My NERDTree plugin is a zip clone of the latest version(4.2.0) from its repository on github, last modified at 2014.11.20.
My VIM version is 7.4, the one from VIM's offical website. The beginning of its version info is as follows:
VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Aug 10 2013 14:38:33)
MS-Windows 32-bit GUI version with OLE support
Compiled by mool#tororo
Big version with GUI. ...
I also checked it on Ubuntu-14.04 (64bit) and found the same problem with NERDTree.
I read the NERDTree's reference manual and found some information in its change log of 4.1.0, bugfixes part:
fix some win32 path escaping issues. Thanks to Stephan Baumeister, Ricky, jfilip1024, and Chris Chambers
but I am not sure whether this is relevant or not.
By the way, the option NERDTreeHijackNetrw makes me confused. I let "g:NERDTreeHijackNetrw=0" but it seems have no effect.

vim - should i place all .vim files when enabling a plugin in vimfiles or vim74 folder?

Do all .vim files go into vimfiles or vim 74 folders when installing a plugin? on windows 7 and is this the standard for all vim plugins?
Thanks
If you have a single name.vim file, that usually goes into %HOMEDRIVE%\%HOMEPATH%\vimfiles\plugin\ on Windows. If this doesn't exist yet, create it. You can check the actual locations from within Vim via
:echo &runtimepath
Directories under C:\Program Files\vim\vim74 are reserved for the scripts that come with Vim. You must not put any files there; that'll just cause problems when upgrading!
On Windows, third party plugins and colorschemes are supposed to go in this directory:
%userprofile%\vimfiles\
including your vimrc if you only use Vim 7.4:
%userprofile%\vimfiles\vimrc

Vim 7.3 on Ubuntu 12.10 doesn't have 'ftplugin' directory anywhere

Vim 7.3 on Ubuntu 12.10
I recently installed vim from the Ubuntu software center. So far, I've installed the following vim plugins: NERDTree, rails and ack.
I'm taking a course on python and another one on Ruby on Rails. I was surprised that vim didn't recognize the languages as far as indenting goes. Checking various questions and answers on this forum, as well as checking vim help, I see that there should be a directory named 'ftplugin' in the $VIMRUNTIME directory. My $VIMRUNTIME is just the same as $HOME which is ~/, but there is no 'ftplugin' in my home directory. There's also nothing like that in ~/.vim. Does that mean I don't have any filetype plugins?
If I don't, where can I get the usual set?
edit
Just to be clear: upon install, Vim doesn't do anything to your home directory. The ~/.vim directory and any subdirectory are to be created by the user: it is where you put your config so you are in charge.
endedit
You must create those directories yourself, no matter what OS you are using. On UNIX-like systems (Linux, Mac OS X…) all your stuff is supposed to go into ~/.vim:
$ cd
$ mkdir .vim
$ cd .vim
Some plugins may need to be placed into specific subdirectories:
~/.vim/autoload
~/.vim/plugin
etc.
You can:
create those directories just like you created ~/.vim and place all the files manually
$ unzip the plugins right there in ~/.vim, the necessary directories are created for you
use some plugin manager like Pathogen or VAM or Vundle and/or a VCS…
I'd advise you to start slow. Just install everything manually: it will help you getting more comfortable with the whole thing.
Anyway, since you have already installed a bunch of (useless IMO, except rails) plugins you probably already know all that.
Vim already has the necessary ftplugins, you only need to tell Vim to "activate" them by default. Add these two lines to your ~/.vimrc (create that file if you didn't already):
filetype plugin indent on
syntax on

VIM: Unable to uninstall Latex-Box plugin with Vimball

According to documentation, vimball uninstall should be a very simple process of typing in :RmVimball LatexBox
However, I get the error message
vimball (RmVimball) unable to find in .VimballRecord
I'm pretty sure I'm typing in the right prompt because LatexBox.vmb is the file I ran :so % on to install the plugin.
The Vimball documentation (http://www.cs.csubak.edu/docs/vim/pi_vimball.html) states:
:RmVimball removes all files generated by the specified vimball
(but not any directories it may have made). One may choose a path
for de-installation, too (see |'runtimepath'|); otherwise, the
default is the first existing directory on the |'runtimepath'|.
And indeed my .VimballRecord exists in the first existing directory of the output when I type in :echo &runtimepath . I opened up the .VimballRecord and it says
LatexBox.vmb: call delete('C:\Program Files (x86)\Vim\vimfiles/ftplugin/tex_LatexBox.vim')| ...
which seems to confirm that LatexBox is the correct plugin name. I'm very confused where the error is coming from. Otherwise -- How can I remove this plugin manually? (I'm concerned that going through and deleting files in the ftplugin folder is not thorough)
To uninstall a vim plugin is really easy, because there're no hidden stuff.
Go into C:\Program Files\vim\vimfiles(depending on your system)
Find out all files about LatexBox
Delete them.
Make a backup of vimfiles folder before deleting files.
If something goes wrong, you have a change to recover.
Update:
Answer you question about :helptags command:
When you install a plugin, it may contains help files(for example latexbox.txt).
It was often install in C:\Program Files\vim\vimfiles\doc directory (I will call it doc from now).
This direcotry may contains other help files for other plugins.
Notice there's a tags file in this doc directory. The tags file is used for jumping to location when you press Ctrl-] on a word.
Don't worry if doc\tags not exist.
You can use :helptags C:\Program Files\vim\vimfiles\doc to generate it.
When you install a plugin via vimball (which is just a vimscript to help you creating files/directories),
The vimball will create latexbox.txt in doc directory,
and run :helptags command to update the tags file automatically.
So, when you manually delete doc\latexbox.txt,
the tags file still contains infomatation about latexbox.txt.
Just run :helptags path\you\want\to\sync command again to get doc\tags synchronised.
Been there. The problem is that Vimball version (v31) that comes packaged with Vim is obsolete and does not support .vmb files. Check 1 for the latest Vimball version and you will be alright.

What is the difference between vim72 and vimfiles folder?

I am learning VIM. The VIM folder in the windows has two subdirectories VIM72 and VIMFILE. What is the difference between them? Where should I install my plugins?
Usually VIM72 (depends on the vim version) is the 'runtime' directory, I believe this is where vim is searching for all the stuff that it needs during 'runtime'. You would install your custom stuff, e.g. plugins, in your '$HOME/.vim' directory on linux (plugins in $HOME/.vim/plugin).
On windows it seems to be the vimfiles directory (you asked about VIMFILE on my windows system and vim71 it is vimfiles).
So I would try to store plugin in vimfiles\plugin directory on your system.
The difference would be that in VIM72 you would have all the runtime stuff that comes prepackaged with vim including binaries. You can install your own stuff in your vimfiles directory which will be usually searched first for stuff like syntax highlight, color schemes, plugins, documentation and so on.
You can find out the location of your vim72 directory, the location for your custom stuff like vim72/plugins, vim72/colors for colorshemes and so on, from vim do:
:echo $VIMRUNTIME
And finally, vim72 is used by vim 7.2 so when the version changes it will use different directory like vim73 and so on.
Expanding very slightly on stefan's answer:
Like he says, ~/.vim for linux-related systems, and usually vimfiles for gvim on Windows - this is your home vim directory.
You should put all of your own plugins into vimfiles to make sure that when you upgrade your vim installation you don't lose any of the custom plugins or modifications.
For example
There is a syntax file called cpp.vim in vim72/syntax.
If you now want to change a few things in this syntax file (say to add an extra keyword) you could have a copy of this syntax file in vimfiles/syntax with the additional keyword syntax rules.
Now when you upgrade vim to 7.3, you still have all of your custom plugins and settings.
If you were to instead change vim72/syntax/cpp.vim, when you next upgraded vim these files would be overwritten by the new versions and any changes that you made would be lost.
Plus, since vim72/syntax/ contains all of the original syntax files, it would be more difficult to tell which of these you had customised.
That 'vimfiles' directory is where you can install things system-wide without touching Vim's installation directory ('vim72'). The directory 'vim72' is subject to change when upgrading and a new major or minor version will use a different directory (e.g. Vim 7.1 used 'vim71' and Vim 8.0 will use 'vim80').

Resources