[PLUTO-ildp] Traduzione collaborativa Using Vi (Editing another file) ... :-)

Hugh Hartmann hhartmann a fastwebnet.it
Dom 1 Dic 2013 22:14:33 CET


Un saluto "rassegnato" si propaga a tutti i partecipanti alla lista
.. :-))

Riporto qui di seguito l'ottava e la nona (e anche decima e undicesima 
per la verità) sezione del testo Using Vi in inglese per chi volesse 
tradurle, sperando che ci sia la traduzione collaborativa auspicata .... :-)


[...]

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.

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


Au Revoire
Hugh Hartmann






Maggiori informazioni sulla lista pluto-ildp