How to start vimdiff?

489 views
Skip to first unread message

wolfv

unread,
Jun 7, 2014, 3:07:37 AM6/7/14
to vim...@googlegroups.com
I would like to learn vimdiff, but haven't got very far.
I can start vim and gvim from the Command Prompt, but not vimdiff.
How to start vimdiff?

Here is what I tried on the Command Prompt:

C:\>vimdiff
'vimdiff' is not recognized as an internal or external command,
operable program or batch file.

C:\>vim

C:\>gvim

C:\>

I am running vim 7.4 on Windows 7.

Thank you.

John Beckett

unread,
Jun 7, 2014, 5:51:47 AM6/7/14
to vim...@googlegroups.com
wolfv wrote:
> How to start vimdiff?

Using ":help vimdiff" shows that vimdiff is equivalent to "vim -d".

Using gvim (which I recommend), you could start it at command prompt:

gvim -d file1 file2

Or, if you are already editing file2, you would enter:

:diffs file1

It is handy to do the last step in a new tab:

gvim file2
:tab sp
:vert diffs file1

John


Marc Weber

unread,
Jun 7, 2014, 6:22:18 AM6/7/14
to vim_use
:bufdo diffoff

might be useful, too
Marc Weber

wolfv

unread,
Jun 7, 2014, 8:36:38 AM6/7/14
to vim...@googlegroups.com

Thanks. "vim -d" worked.
The important thing is that it works.
Just curious why "vimdiff" gets an error.
The manual says, "The easiest way to start editing in diff mode is with the "vimdiff" command."

Here is what I get from the Command Prompt:

C:\>vimdiff a.txt b.txt


'vimdiff' is not recognized as an internal or external command,
operable program or batch file.

C:\>vim -d a.txt b.txt

C:\>vim -d

Tim Chase

unread,
Jun 7, 2014, 9:04:04 AM6/7/14
to vim...@googlegroups.com, wolf...@gmail.com
On 2014-06-07 05:36, wolfv wrote:
> Thanks. "vim -d" worked.
> The important thing is that it works.
> Just curious why "vimdiff" gets an error.
> The manual says, "The easiest way to start editing in diff mode is
> with the "vimdiff" command."
>
> Here is what I get from the Command Prompt:
>
> C:\>vimdiff a.txt b.txt
> 'vimdiff' is not recognized as an internal or external command,
> operable program or batch file.

I believe that, when you install Vim on Win32, it creates
several .bat files to perform this functionality. You may not have
that directory on your $PATH (which you can check at the command-line
with the "path" command). In the version I have, it drops the .bat
files in c:\windows which is on my path. So I'd scan your hard-drive
for "vimdiff.bat" and make sure that directory is in your PATH which
can be set in

Control Panel
-> System Properties tab
-> Environment Variables button

Additionally, if you use ":diffsplit", I recommend prefixing it with
"vert" to get the behavior you're used to:

:vert diffsplit otherfile.txt

-tim


wolfv

unread,
Jun 7, 2014, 10:35:40 AM6/7/14
to vim...@googlegroups.com, wolf...@gmail.com
Thanks Tim. That explains it, there is no "vimdiff.bat" on my system.

Rajarajan Rajamani

unread,
Jun 7, 2014, 11:20:03 AM6/7/14
to vim...@googlegroups.com

Try vim -d file1 file2
I only use vim in linux, but I guess that should work.

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ben Fritz

unread,
Jun 8, 2014, 3:20:14 PM6/8/14
to vim...@googlegroups.com, wolf...@gmail.com
On Saturday, June 7, 2014 9:35:40 AM UTC-5, wolfv wrote:
> Thanks Tim. That explains it, there is no "vimdiff.bat" on my system.

Is there a "gvimdiff.bat"? I use that occasionally, but I don't remember whether Vim's installer created it, of if I did so manually.

Tim Chase

unread,
Jun 8, 2014, 3:30:36 PM6/8/14
to vim...@googlegroups.com, fritzo...@gmail.com, wolf...@gmail.com
I'm pretty sure that, at least the 7.0.0 that I have on my work XP
machine (I can hear Tony groaning at that version number), it dropped
both a vimdiff.bat and a gvimdiff.bat in my \WINDOWS directory, as I
don't invoke it as such on Win32 (I use ":vert diffsplit" there).

-tim




Tony Mechelynck

unread,
Jun 8, 2014, 4:39:28 PM6/8/14
to vim...@googlegroups.com
Me groan? I have more important things to groan about at the moment.
Anyway, it's your funeral, not only about Vim but also about M$W. ;-)

Best regards,
Tony.
--
A lifetime isn't nearly long enough to figure out what it's all about.

Tim Chase

unread,
Jun 9, 2014, 8:17:21 AM6/9/14
to vim...@googlegroups.com
On 2014-06-08 22:39, Tony Mechelynck wrote:
>> 7.0.0 that I have on my work XP machine
>> (I can hear Tony groaning at that version number)
>
> Me groan? I have more important things to groan about at the
> moment. Anyway, it's your funeral, not only about Vim but also
> about M$W.

Yeah, it's an XP VM for $SIDE_JOB. Though it is nice to be able to
test things on a Win32 machine (even if it's ancient and unsupported
now). At home, it's the year-old 7.3.547 that is stock with Debian
Stable which helps me better gauge whether an issue on the XP box is
fixed in more recent versions.

Though of new features since 7.x, I wouldn't miss most of them in my
day-to-day usage of vim except for new quotation/tag text objects,
internal vimgrep, and spell-checking. There are a couple other new
things that are nice to have, but I get along fine without them. I
thought I'd use 'relativenumber' more, but found it too distracting
to use regularly; and "conceal" sounds promising, but haven't gotten
around to learning it.

-tim



Tony Mechelynck

unread,
Jun 30, 2014, 3:10:20 AM6/30/14
to vim...@googlegroups.com
I don't use relativenumber or conceal myself. I use vimgrep a lot but
IIRC it's been there since 7.0 so no problem there.

What other things do I use?
Extra Unicode support (7.0): recognizable glyphs above U+FFFF,
'maxcombine', 8g8
MatchParen (7.0)
'cursorline' and 'cursorcolumn' (7.0)
Tab pages (7.0)
Scrolling back at the more-prompt and hit-Enter-prompt (7.0)
:map and :abbr with <expr> (7.0)
a" a' i" i' text objects (7.0)

Floating point (7.2)

Additional floating-point functions (7.3)

And certainly some more which I don't think of at the moment. One new
7.4 thing I don't use (yet) is the new "NFA" regexp engine.


As soon as I see a new patchlevel I compile it for both Huge and Tiny
featuresets but that's a little overdoing it for most users. It's my
contribution to testing (e.g., that there are the right #ifdef
directives to avoid compile errors in the Tiny build). I also have a Vim
from my distro but it's later in the $PATH. ATM it's a Huge 7.4.52 with
+x11 +xterm_clipboard but -gui.


Best regards,
Tony.
--
"After the survivor of the Spanish conquest has told his life's story he is
convicted by the Inquisition:

"He posted no brief in defense or mitigation of his offenses, and
when he was most solemnly advised by the Court President of the dire
consequences he faced if found guilty, Juan Damasceno volunteered
only one comment:

'It will mean I do not go to the Christian heaven?'

He was told that that would indeed be the worst of his punishments:
that he would most assuredly not go to Heaven. At which, his smile
sent a thrill of horror through every soul of the Court."
["Aztec", by Gary Jennings]

Reply all
Reply to author
Forward
0 new messages