mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
doc: diff-mode: minor adjustments
This commit is contained in:
parent
a720b64851
commit
98413a4932
@ -19,8 +19,8 @@ The basics are explained in section |08.7| of the user manual.
|
||||
==============================================================================
|
||||
1. Starting diff mode
|
||||
|
||||
To start editing in diff mode, start Nvim with "nvim -d". This starts Nvim
|
||||
and sets up for viewing the differences between the arguments. >
|
||||
To start editing in diff mode, run "nvim -d". This starts Nvim as usual, and
|
||||
additionally sets up for viewing the differences between the arguments. >
|
||||
|
||||
nvim -d file1 file2 [file3 [file4]]
|
||||
|
||||
@ -39,7 +39,7 @@ diffs at the same time, each in their own tab page.
|
||||
|
||||
What happens is that Nvim opens a window for each of the files. This is like
|
||||
using the |-O| argument. This uses vertical splits, but if you prefer
|
||||
horizontal splits add the |-o| argument instead: >
|
||||
horizontal splits use the |-o| argument instead: >
|
||||
|
||||
nvim -d -o file1 file2 [file3 [file4]]
|
||||
|
||||
@ -79,20 +79,20 @@ While already in Vim you can start diff mode in three ways.
|
||||
|
||||
*E98*
|
||||
:diffs[plit] {filename} *:diffs* *:diffsplit*
|
||||
Open a new window on the file {filename}. The options set for
|
||||
"nvim -d" are set for the current and the newly opened window.
|
||||
Open a new window on the file {filename}. The options are set
|
||||
as for "nvim -d" for the current and the newly opened window.
|
||||
Also see 'diffexpr'.
|
||||
|
||||
*:difft* *:diffthis*
|
||||
:difft[his] Make the current window part of the diff windows. This sets
|
||||
the options set for "nvim -d".
|
||||
the options as for "nvim -d".
|
||||
|
||||
:diffp[atch] {patchfile} *E816* *:diffp* *:diffpatch*
|
||||
Use the current buffer, patch it with the diff found in
|
||||
{patchfile} and open a buffer on the result. This sets the
|
||||
options set for "nvim -d". {patchfile} can be in any format
|
||||
that the "patch" program understands or 'patchexpr' can
|
||||
handle.
|
||||
options as for "nvim -d".
|
||||
{patchfile} can be in any format that the "patch" program
|
||||
understands or 'patchexpr' can handle.
|
||||
Note that {patchfile} should only contain a diff for one file,
|
||||
the current file. If {patchfile} contains diffs for other
|
||||
files as well, the results are unpredictable. Vim changes
|
||||
|
@ -341,9 +341,9 @@ There is a special way to start Nvim, which shows the differences between two
|
||||
files. Let's take a file "main.c" and insert a few characters in one line.
|
||||
Write this file with the 'backup' option set, so that the backup file
|
||||
"main.c~" will contain the previous version of the file.
|
||||
Type the following in a shell to start Nvim in diff mode: >
|
||||
Type this command in a shell to start Nvim in diff mode: >
|
||||
|
||||
$ nvim -d main.c~ main.c
|
||||
nvim -d main.c~ main.c
|
||||
|
||||
Vim will start, with two windows side by side. You will only see the line
|
||||
in which you added characters, and a few lines above and below it.
|
||||
|
Loading…
Reference in New Issue
Block a user