Donn,

On Sun 13-Aug-06 6:22am -0600, you wrote:

> ********************************************************************
> command DiffOrig vert new | set bt=nofile | r # | 0d* | diffthis |
>     \ wincmd p | diffthis
> ********************************************************************
> 
> I have a question?  That is under Vim (I suppose 7) what, where how
> does this fit?  What does it do?
> 
> Is "command" the binary or a comment/text?  Is this a Win or Unix or
> both command?  I did see .vimrc which seems to imply Unix/Linux.

Diff mode was introduced in Version 6.  The above command will run in
either version of Vim/Gvim 6.4/7.0 and on Win and Unix.

A good place to start understanding Vim programming of maps, commands,
functions, etc. is the user manual:

        :h user-manual

The section Tuning Vim gets into this sort of programming.  In
particular, for the user manual section on commands:

        :h 40.2

Along with the user manual is the reference manual.  For the section
covering :command:

        :h user-commands

BTW, in the command definition above, "0d*" should be "0d_" (it
deletes the empty first line to the black whole register).  I believe
that for the :d command "0d_" is exactly equivalent to "1d_".

You can see exactly what DiffOrig does by typing the 7 commands
yourself.

Start off editing a file from disk.  Make a small change to the edit
buffer (and don't save it).  Now type each of the command line
commands followed by a <CR> (I've added the first set command for a
reason which will be obvious):

        :set co=999 lines=99
        :vert new
        :set bt=nofile
        :r #
        :0d_
        :diffthis
        :wincmd p
        :diffthis

You can read about each command from the help feature:

        :h :set
        :h 'co'
        :h 'lines'
        :h :vert
        :h :new
        :h 'bt'
        :h :r
        :h :_#
        :h alternate-file
        :h :d
        :h quote_
        :h :diffthis
        :h :wincmd
        :h ctrl-w_p

-- 
Best regards,
Bill

Reply via email to