291 lines
4.7 KiB
HTML
291 lines
4.7 KiB
HTML
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
|
<HTML
|
|
><HEAD
|
|
><TITLE
|
|
>Editing Files </TITLE
|
|
><META
|
|
NAME="GENERATOR"
|
|
CONTENT="Modular DocBook HTML Stylesheet Version 1.7"><LINK
|
|
REL="HOME"
|
|
TITLE="From VMS to Linux HOWTO"
|
|
HREF="index.html"><LINK
|
|
REL="PREVIOUS"
|
|
TITLE="Short Intro "
|
|
HREF="short-intro.html"><LINK
|
|
REL="NEXT"
|
|
TITLE="TeXing "
|
|
HREF="texing.html"></HEAD
|
|
><BODY
|
|
CLASS="SECT1"
|
|
BGCOLOR="#FFFFFF"
|
|
TEXT="#000000"
|
|
LINK="#0000FF"
|
|
VLINK="#840084"
|
|
ALINK="#0000FF"
|
|
><DIV
|
|
CLASS="NAVHEADER"
|
|
><TABLE
|
|
SUMMARY="Header navigation table"
|
|
WIDTH="100%"
|
|
BORDER="0"
|
|
CELLPADDING="0"
|
|
CELLSPACING="0"
|
|
><TR
|
|
><TH
|
|
COLSPAN="3"
|
|
ALIGN="center"
|
|
>From VMS to Linux HOWTO</TH
|
|
></TR
|
|
><TR
|
|
><TD
|
|
WIDTH="10%"
|
|
ALIGN="left"
|
|
VALIGN="bottom"
|
|
><A
|
|
HREF="short-intro.html"
|
|
ACCESSKEY="P"
|
|
>Prev</A
|
|
></TD
|
|
><TD
|
|
WIDTH="80%"
|
|
ALIGN="center"
|
|
VALIGN="bottom"
|
|
></TD
|
|
><TD
|
|
WIDTH="10%"
|
|
ALIGN="right"
|
|
VALIGN="bottom"
|
|
><A
|
|
HREF="texing.html"
|
|
ACCESSKEY="N"
|
|
>Next</A
|
|
></TD
|
|
></TR
|
|
></TABLE
|
|
><HR
|
|
ALIGN="LEFT"
|
|
WIDTH="100%"></DIV
|
|
><DIV
|
|
CLASS="SECT1"
|
|
><H1
|
|
CLASS="SECT1"
|
|
><A
|
|
NAME="EDITING-FILES"
|
|
></A
|
|
>3. Editing Files</H1
|
|
><P
|
|
>Linux doesn't have <TT
|
|
CLASS="LITERAL"
|
|
>EDT</TT
|
|
>, but there are scores of editors available. The
|
|
only one that's guaranteed to be included in every UNIX version is
|
|
<TT
|
|
CLASS="LITERAL"
|
|
>vi</TT
|
|
>---forget it, your sysadm must have installed something better.
|
|
Probably the most popular editor is <TT
|
|
CLASS="LITERAL"
|
|
>emacs</TT
|
|
>, which can emulate <TT
|
|
CLASS="LITERAL"
|
|
>EDT</TT
|
|
>
|
|
to a certain degree; <TT
|
|
CLASS="LITERAL"
|
|
>jed</TT
|
|
> is another editor that provides <TT
|
|
CLASS="LITERAL"
|
|
>EDT</TT
|
|
>
|
|
emulation.</P
|
|
><P
|
|
>These two editors are particularly useful for editing program sources, since
|
|
they have two features unknown to <TT
|
|
CLASS="LITERAL"
|
|
>EDT</TT
|
|
>: syntax hilighting and automatic
|
|
indentation. Moreover, you can compile your programs from within the editor
|
|
(command <TT
|
|
CLASS="LITERAL"
|
|
>ESC-X compile</TT
|
|
>); in case of a syntax error, the cursor will be
|
|
positioned on the offending line. I bet that you'll never want to use the
|
|
true blue <TT
|
|
CLASS="LITERAL"
|
|
>EDT</TT
|
|
> again.</P
|
|
><P
|
|
>If you have <TT
|
|
CLASS="LITERAL"
|
|
>emacs</TT
|
|
>: start it, then type <TT
|
|
CLASS="LITERAL"
|
|
>ESC-X edt-emulation-on</TT
|
|
>.
|
|
Pressing ALT--X or ESC-X is <TT
|
|
CLASS="LITERAL"
|
|
>emacs</TT
|
|
>' way of issuing commands, like
|
|
<TT
|
|
CLASS="LITERAL"
|
|
>EDT</TT
|
|
>'s CTRL--Z. From now on, <TT
|
|
CLASS="LITERAL"
|
|
>emacs</TT
|
|
> acts like <TT
|
|
CLASS="LITERAL"
|
|
>EDT</TT
|
|
> apart from a
|
|
few commands. Differences:</P
|
|
><P
|
|
> <P
|
|
></P
|
|
><UL
|
|
><LI
|
|
><P
|
|
> <EM
|
|
>don't</EM
|
|
> press CTRL--Z to issue commands (if you did, you stopped
|
|
<TT
|
|
CLASS="LITERAL"
|
|
>emacs</TT
|
|
>. Type <TT
|
|
CLASS="LITERAL"
|
|
>fg</TT
|
|
> to resume it); </P
|
|
></LI
|
|
><LI
|
|
><P
|
|
> there's an extensive on-line help. Press CTRL-H ?, or CTRL-H T to
|
|
start a tutorial; </P
|
|
></LI
|
|
><LI
|
|
><P
|
|
> to save a file, press CTRL-X CTRL-S; </P
|
|
></LI
|
|
><LI
|
|
><P
|
|
> to exit, press CTRL-X CTRL-C; </P
|
|
></LI
|
|
><LI
|
|
><P
|
|
> to insert a new file in a buffer, press CTRL-X CTRL-F, then
|
|
CTRL-X B to switch among buffers. </P
|
|
></LI
|
|
></UL
|
|
> </P
|
|
><P
|
|
>If you have <TT
|
|
CLASS="LITERAL"
|
|
>jed</TT
|
|
>: ask your sysadm to configure <TT
|
|
CLASS="LITERAL"
|
|
>jed</TT
|
|
> properly.
|
|
Emulation is already on when you start it; use the normal keypad keys, and
|
|
press CTRL--H CTRL--H or CTRL-? to get help. Commands are issued in the same
|
|
way as <TT
|
|
CLASS="LITERAL"
|
|
>emacs</TT
|
|
>'. In addition, there are some handy key bindings missing
|
|
in the original <TT
|
|
CLASS="LITERAL"
|
|
>EDT</TT
|
|
>; key bindings can also be tailored to your own
|
|
taste. Ask your sysadm.</P
|
|
><P
|
|
>In alternative, you may use another editor with a completely different
|
|
interface. <TT
|
|
CLASS="LITERAL"
|
|
>emacs</TT
|
|
> in native mode is an obvious choice; another popular
|
|
editor is <TT
|
|
CLASS="LITERAL"
|
|
>joe</TT
|
|
>, which can emulate other editors like <TT
|
|
CLASS="LITERAL"
|
|
>emacs</TT
|
|
> itself
|
|
(being even easier to use) or the DOS editor. Invoke the editor as
|
|
<TT
|
|
CLASS="LITERAL"
|
|
>jmacs</TT
|
|
> or <TT
|
|
CLASS="LITERAL"
|
|
>jstar</TT
|
|
> and press, respectively, CTRL-X H or CTRL-J to get
|
|
online help. <TT
|
|
CLASS="LITERAL"
|
|
>emacs</TT
|
|
> and <TT
|
|
CLASS="LITERAL"
|
|
>jed</TT
|
|
> are <EM
|
|
>much</EM
|
|
> more powerful than good
|
|
ol' <TT
|
|
CLASS="LITERAL"
|
|
>EDT</TT
|
|
>.</P
|
|
></DIV
|
|
><DIV
|
|
CLASS="NAVFOOTER"
|
|
><HR
|
|
ALIGN="LEFT"
|
|
WIDTH="100%"><TABLE
|
|
SUMMARY="Footer navigation table"
|
|
WIDTH="100%"
|
|
BORDER="0"
|
|
CELLPADDING="0"
|
|
CELLSPACING="0"
|
|
><TR
|
|
><TD
|
|
WIDTH="33%"
|
|
ALIGN="left"
|
|
VALIGN="top"
|
|
><A
|
|
HREF="short-intro.html"
|
|
ACCESSKEY="P"
|
|
>Prev</A
|
|
></TD
|
|
><TD
|
|
WIDTH="34%"
|
|
ALIGN="center"
|
|
VALIGN="top"
|
|
><A
|
|
HREF="index.html"
|
|
ACCESSKEY="H"
|
|
>Home</A
|
|
></TD
|
|
><TD
|
|
WIDTH="33%"
|
|
ALIGN="right"
|
|
VALIGN="top"
|
|
><A
|
|
HREF="texing.html"
|
|
ACCESSKEY="N"
|
|
>Next</A
|
|
></TD
|
|
></TR
|
|
><TR
|
|
><TD
|
|
WIDTH="33%"
|
|
ALIGN="left"
|
|
VALIGN="top"
|
|
>Short Intro</TD
|
|
><TD
|
|
WIDTH="34%"
|
|
ALIGN="center"
|
|
VALIGN="top"
|
|
> </TD
|
|
><TD
|
|
WIDTH="33%"
|
|
ALIGN="right"
|
|
VALIGN="top"
|
|
>TeXing</TD
|
|
></TR
|
|
></TABLE
|
|
></DIV
|
|
></BODY
|
|
></HTML
|
|
> |