[PLUTO-ildp] Traduzione collaborativa Using Vi (commands moving cursor) ... :-)

Hugh Hartmann hhartmann a fastwebnet.it
Lun 25 Nov 2013 23:30:00 CET


Un saluto "assopito" si dirama a tutti i partecipanti alla lista
.. :-))

Riporto qui di seguito la sesta, settima, ottava e la nona sezione del 
testo Using Vi da tradurre .... :-)

[...]

6 Commands for moving the cursor.
You already know how to use the arrow keys to move around the document. 
In addition, you can use the h, j, k, and l commands to move the cursor 
left, down, up, and right, respectively. This comes in handy when (for 
some reason) your arrow keys aren't working correctly.

The w command moves the cursor to the beginning of the next word; the b 
command moves it to the beginning of the previous word.

The 0 command (that's the zero key) moves the cursor to the beginning of 
the current line, and the $ command moves it to the end of the line.

When editing large files, you'll want to move forwards or backwards 
through the file a screenful at a time. Pressing Ctrl-F moves the cursor 
one screenful forward, and Ctrl-B moves it a screenful back.

To move the cursor to the end of the file, press G. You can also move to 
an arbitrary line; for example, typing the command 10G would move the 
cursor to line 10 in the file. To move to the beginning of the file, use 1G.

You can couple moving commands with other commands, such as those for 
deleting text. For example, the d$ command deletes everything from the 
cursor to the end of the line; dG deletes everything from the cursor to 
the end of the file, and so on.

7 Saving files and quitting vi.
To quit vi without making changes to the file, use the command :q!.
When you press the ``:'', the cursor moves to the last line on the 
screen and you'll be in last line mode.

COW IS THE TIME FOR ALL WOMEN TO COME TO THE AID OF THE HUNGRY__

~

~

~

:__

In last line mode, certain extended commands are available. One of them 
is q!, which quits vi without saving. The command :wq saves the file and 
then exits vi.

The command ZZ (from command mode, without the ``:'') is equivalent to 
:wq. If the file has not been changed since the last save, it merely 
exits, preserving the modification time of the last change. Remember 
that you must press Enter after a command entered in last line mode.

To save the file without quitting vi, use :w.

8 Editing another file.
To edit another file, use the :e command. For example, to stop editing 
test and edit the file foo instead, use the command:

COW IS THE TIME FOR ALL WOMEN TO COME TO THE AID OF THE HUNGRY__

~

~

~

:e foo__

If you use :e without saving the file first, you'll get the error message:

No write since last change (":edit!" overrides)

which means that vi doesn't want to edit another file until you save the 
first one. At this point, you can use :w to save the original file, and 
then use :e, or you can use the command:

COW IS THE TIME FOR ALL WOMEN TO COME TO THE AID OF THE HUNGRY__

~

~

~

:e! foo__

The ``!'' tells vi that you really mean it--edit the new file without 
saving changes to the first.

9 Including other files.
If you use the :r command, you can include the contents of another file 
in the current file.

For example, the command:

:r foo.txt

inserts the contents of the file foo.txt in the text at the location of 
the cursor.

10 Running shell commands.
You can also run shell commands within vi. The :r! command works like 
:r, but rather than read a file, it inserts the output of the given 
command into the buffer at the current cursor location. For example, if 
you use the command:

r! ls -F

you'll end up with:

COW IS THE TIME FOR ALL WOMEN TO COME TO THE AID OF THE HUNGRY__

letters/

misc/

papers/

~

~

You can also ``shell out'' of vi, in other words, run a command from 
within vi, and return to the editor when you're done. For example, if 
you use the command:

:! ls -F

the ls -F command will be executed and the results displayed on the 
screen, but not inserted into the file you're editing. If you use the 
command:

:shell

vi starts an instance of the shell, letting you temporarily put vi ``on 
hold'' while you execute other commands. Just log out of the shell 
(using the exit command) to return to vi.

11 Getting vi help.
vi doesn't provide much in the way of interactive help (most Linux 
programs don't), but you can always read the man page for vi. vi is a 
visual front-end to the ex editor; which handles many of the last-line 
mode commands in vi. So, in addition to reading the man page for vi, see 
ex as well.

------------------------------------------------------------------------

Ecco, siamo arrivati alla fine del testo Using Vi

Sarebbe bello, una volta tradotto e revisionato completamente 
trasformarlo in un file .sgml (LinuxDoc che č pių facile) e poi metterlo 
a disposizione nel sito nei formati txt, html, pdf ... :-)



Au Revoire
Hugh Hartmann






Maggiori informazioni sulla lista pluto-ildp