⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 0211-0216.html

📁 linux-unix130.linux.and.unix.ebooks130 linux and unix ebookslinuxLearning Linux - Collection of 12 E
💻 HTML
字号:




<HTML>

<HEAD>

<TITLE>Sams Teach Yourself Linux in 24 Hours:Text Processing:EarthWeb Inc.-</TITLE>

<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">
<SCRIPT>
<!--
function displayWindow(url, width, height) {
        var Win = window.open(url,"displayWindow",'width=' + width +
',height=' + height + ',resizable=1,scrollbars=yes');
}
//-->
</SCRIPT>
</HEAD>

 -->




<!-- ISBN=0672311623 //-->

<!-- TITLE=Sams Teach Yourself Linux in 24 Hours//-->

<!-- AUTHOR=Bill Ball//-->

<!-- PUBLISHER=Macmillan Computer Publishing//-->

<!-- IMPRINT=Sams//-->

<!-- CHAPTER=14 //-->

<!-- PAGES=0211-0228 //-->

<!-- UNASSIGNED1 //-->

<!-- UNASSIGNED2 //-->













<P><CENTER>

<a href="../ch13/0208-0210.html">Previous</A> | <a href="../ewtoc.html">Table of Contents</A> | <a href="0217-0220.html">Next</A>

</CENTER></P>



<A NAME="PAGENUM-211"><P>Page 211</P></A>





<H3><A NAME="ch14_ 1">

Part IV</a></H3>



<H2>



Using Linux Productively



</H2>



<P><b>Hour</b>

</P>



<OL START=14>

<LI>          Text Processing

<LI>          Preparing Documents

<LI>          Graphics Tools

<LI>          Learning Math and Financial Tools

<LI>          Personal Productivity Tools

<LI>          Playing Linux Games

</OL>



<A NAME="PAGENUM-212"><P>Page 212</P></A>









<A NAME="PAGENUM-213"><P>Page 213</P></A>









<H3><A NAME="ch14_ 2">Hour 14</A></H3>





<H2>

<A NAME="ch14_ 3">Text Processing

</A>

</H2>



<P>This hour provides you with an overview of some word processing, or

text editing, tools for Linux. There's not enough time to cover all of the 100

or more Linux text editors, but this hour provides you with highlights of

the features of the tools you'll find on your CD-ROM. It also shows you the

basics of using these editors to get you started.

</P>



<H3><A NAME="ch14_ 4">

Word Processors in the Linux Environment

</A></H3>



<P>Text editors are used by many different types of people. Casual users,

writers, programmers, and system administrators will all use a text editor at one

time or another in Linux. You'll definitely need to know how to change text

files to configure Linux to work the way you want. What follows is an

introduction to different word processors, text editors, and text tools you can use

during your Linux sessions.

</P>



<P>Although how you use a computer dictates what type of software is

important

</P>



<A NAME="PAGENUM-214"><P>Page 214</P></A>





<P>

and should be installed, most people agree that more than half our time when using

a computer is spent using a text editor or word processor. This will change, of course,

as computer software interfaces evolve and network communication becomes more

integrated into our work environment, but in general, if you're using Linux on your

computer at home you're probably going to be word processing or editing files a lot of the time.

</P>



<P>The tools in this hour are interactive programs that allow you to enter text, move a

cursor, or drop a menu. These programs and related files vary in size from nearly 20

megabytes to less than 200,000 characters. However, there are more than two dozen text

tools, including line editors such as the ed or ex commands, for Linux, that while not

interactive, enable you to change, manipulate, or rearrange text.

</P>



<H4><A NAME="ch14_ 5">

Features of the emacs Environment

</A></H4>



<P>What do you call a text editor that edits text, reads Usenet news, acts as a personal

calendar and diary, sends electronic mail, is a programming language interpreter, plays games,

is a Linux shell, and more? Why, emacs, of course!

</P>



<P>emacs, which stands for editing macros, was originally developed by Richard Stallman,

who founded the Free Software Foundation, or FSF. The emacs editor is distributed by the

FSF as part of the GNU, or GNU's Not UNIX project. Without a doubt, emacs is the

most widely available and fully featured free editor, and runs on more computer systems

than any other text editor.

</P>



<P>There isn't enough time in this hour (or this book!) to cover all the features of this

program. Look at Table 14.1 to find most of the keyboard commands you can use to get started.

</P>



<P>Table 14.1. Basic emacs commands and keystroke combinations.

</P>



<TABLE>



<TR><TD>

Action

</TD><TD>

Key Combination

</TD></TR><TR><TD>

</TD><TD>

C-b=hold down Ctrl key, press b

</TD></TR><TR><TD>

</TD><TD>

M-v=hold down Alt key, press v

</TD></TR><TR><TD>

Cursor backward

</TD><TD>

C-b

</TD></TR><TR><TD>

Cursor forward

</TD><TD>

C-f

</TD></TR><TR><TD>

Cursor up

</TD><TD>

C-p

</TD></TR><TR><TD>

Cursor down

</TD><TD>

C-n

</TD></TR><TR><TD>

Go to beginning of line

</TD><TD>

C-a

</TD></TR><TR><TD>

Go to end of line

</TD><TD>

C-e

</TD></TR><TR><TD>

Page down

</TD><TD>

C-v

</TD></TR></TABLE>



<A NAME="PAGENUM-215"><P>Page 215</P></A>





<TABLE>



<TR><TD>

Action

</TD><TD>

Key Combination

</TD></TR><TR><TD>

Page up

</TD><TD>

M-v

</TD></TR><TR><TD>

Go to end of file

</TD><TD>

M-&gt;

</TD></TR><TR><TD>

Go to beginning of file

</TD><TD>

M-&lt;

</TD></TR><TR><TD>

Delete character

</TD><TD>

C-d

</TD></TR><TR><TD>

Delete word

</TD><TD>

M-d

</TD></TR><TR><TD>

Delete line

</TD><TD>

C-k

</TD></TR><TR><TD>

Undo

</TD><TD>

C-_

</TD></TR><TR><TD>

Open File

</TD><TD>

C-x C-f

</TD></TR><TR><TD>

Save File

</TD><TD>

C-x C-s

</TD></TR><TR><TD>

Save As

</TD><TD>

C-x C-w

</TD></TR><TR><TD>

Help

</TD><TD>

C-h

</TD></TR><TR><TD>

Tutorial

</TD><TD>

C-h t

</TD></TR><TR><TD>

Quit

</TD><TD>

C-x C-c

</TD></TR></TABLE>



<P>emacs has 22 different command-line options, but is easy to start.

To run emacs and open a text file for editing, just specify the file's

name on the command line. For example,

</P>



<!-- CODE SNIP //-->

<PRE>

# emacs myfile.txt

</PRE>

<!-- END CODE SNIP //-->



<P>This loads the editor and opens your file. If you just specify emacs on the command

line by itself, the program starts, displays an opening screen, and clears when you touch

the keyboard. Starting the emacs tutorial is highly recommended if you're a beginner.

Hold down the Ctrl key and press the h key. You'll see a prompt on the emacs command

line at the bottom of the screen. Press the t key, and then press Enter to start the tutorial.

</P>



<P>If you enter this command at the shell prompt of an X11 terminal window, the X11

version of emacs with mouse and menu support automatically starts (see Figure 14.1). But

what if you want to run the console, or non-X11 version of emacs instead? In this case, use

a different name for emacs, emacs-nox, or use the

-nw, or no-window command-line option:

</P>



<!-- CODE SNIP //-->

<PRE>

# emacs-nox myfile.txt

# emacs -nw myfile.txt

</PRE>

<!-- END CODE SNIP //-->



<P>Both commands run emacs in your X11 terminal window, although you'll still see a

menu bar across the top of the terminal screen. emacs also obeys most X11 Toolkit options,

such as geometry settings. Some of the X11 options you may find helpful include the following:

</P>



<UL>

<LI>   geometry 80x24+400+200&#151;Start in a window 80 characters wide by 24 lines, at

screen position X (400) Y (200)

<LI>     fg color&#151;Set foreground to color

<LI>     bg color&#151;Set background to color

</UL>



<A NAME="PAGENUM-216"><P>Page 216</P></A>



<UL>



<LI>     cr color&#151;Set text cursor to color

<LI>     ms color&#151;Set mouse cursor to color

</UL>



<P>Use these options, and others, to customize how emacs looks when started in X11:

</P>



<!-- CODE SNIP //-->

<PRE>

# emacs -geometry 80x24 -fg black -bg white blue -cr red

</PRE>

<!-- END CODE SNIP //-->



<P>This starts emacs in a window 80 characters wide by 24 lines high. The text is black,

with a white background. The cursor is red, and the mouse cursor is blue. emacs also

has 13 different X resource settings you can configure and enter into your

.Xresources file in your home directory. You also can save editor defaults (such as word wrapping, or fill-mode

on) in a file called .emacs in your home directory. See the emacs manual page for details.

</P>



<P>The emacs program for Red Hat Linux comes in four different packages

containing various 

</P>



<P>Figure 14.1.<BR>

The emacs editor <br>

features split windows, <br>

built-in help, a tutorial,<br>

and other tools to help <br>

you be more productive.</P>

<a href="javascript:displayWindow('images/ch14fg01.jpg', 288, 216)"><img src="images/tn_ch14fg01.jpg"></a><BR>

<BR>





<P>files and utilities. If you install everything, emacs requires more than 35 megabytes of

disk space. You can, however, save 15 megabytes if you don't install the 

Emacs-d package,

which is the source for emacs functions, modes, and utilities. If you don't use the X

Window system, you can save another 2.5 megabytes by not installing the

Emacs-X11 package.

</P>



<P>You'll find documentation for emacs under the

/usr/doc, /usr/share/emacs/20.2/etc, and /usr/info directory. You also can read the emacs manual page for an overview.

</P>



<P><CENTER>

<a href="../ch13/0208-0210.html">Previous</A> | <a href="../ewtoc.html">Table of Contents</A> | <a href="0217-0220.html">Next</A>

</CENTER></P>











</td>
</tr>
</table>

<!-- begin footer information -->









</body></html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -