Wątki

[ Pobierz całość w formacie PDF ]
.However, this is very slow|you have to moveyour hand all the way to your mouse! Most people who use Emacs primarily use the keyboard forgetting around.Use C-p and C-b to get all the way back to the upper-left corner.Now keep C-b held a littlelonger.You should hear an annoying bell sound, and see the message Beginning of buffer"2In case you hadn't noticed yet, many of Emacs's movement commands consist of combining Control with asingle mnemonic letter. 8.2.GETTING STARTED QUICKLYIN X 73appear in the minibu er.At this point you might wonder, But what is a bu er?"When Emacs works on a le, it doesn't actually work on the le itself.Instead, it copies thecontents of the le into a special Emacs work area called a bu er, where you can modify it to yourheart's content.When you are done working, you tell Emacs to save the bu er|in other words, towrite the bu er's contents into the corresponding le.Until you do this, the le remains unchanged,and the bu er's contents exist only inside of Emacs.With that in mind, prepare to insert your rst character into the bu er.Until now, everythingwe have done has been non-destructive", so this is a big moment.You can choose any characteryou like, but if you want to do this in style, I suggest using a nice, solid, capital X".As you typeit, take a look at the beginning of the mode line at the bottom of the screen.When you change thebu er so that its contents are no longer the same as those of the le on disk, Emacs displays twoasterisks at the beginning of the mode line, to let you know that the bu er has been modi ed:--**-Emacs: some_file.txt Fundamental --Top------------------------These two asterisks are displayed as soon as you modify the bu er, and remain visible until yousave the bu er.You can save the bu er multiple times during an editing session|the commandto do so is just C-x C-s hold down Control and hit x" and s" while it's down.okay, so youprobably already gured that out!.It's deliberately easy to type, because saving your bu ers issomething best done early and often.I'm going to list a few more commands now, along with the ones you've learned already, andyou can practice them however you like.I'd suggest becoming familiar with them before going anyfurther:C-f Move forward one character.C-b Move backward one character.C-n Go to next line.C-p Go to previous line.C-a Go to beginning of line.C-e Go to end of line.C-v Go to next page screenful of text.C-l Redraw the screen, with current line in center.C-d Delete this character practice this one.C-k Delete text from here to end of line.C-x C-s Save the bu er in its corresponding le.Backspace Delete preceding character the one you just typed.8.2 Getting Started Quickly in XIf all you're interesting in is editing a few les quickly, an X user doesn't have to go much furtherbeyond the menus at the top of the screen: 74 CHAPTER 8.EDITING FILES WITH EMACSThese menus are not available in text mode.When you rst start Emacs, there will be four menus at the top of the screen: Bu ers, File, Edit,and Help.To use a menu, simply move the mouse pointer over the name like File, click and holddown on the left button.Then, move the pointer to the action you want and release the mousebutton.If you change your mind, move the mouse pointer away from the menu and release thebutton.The Bu ers menu lists the di erent les you've been editing in this incarnation of Emacs.TheFile menu shows a bunch of commands for loading and saving les|many of them will be describedlater.The Edit menu displays some commands for editing one bu er, and the Help menu shouldhopefully give on-line documentation.You'll notice keyboard equivalents are listed next to the choices in the menu.Since, in the longrun, they'll be quicker, you might want to learn them.Also, for better or for worse, most of Emacs'sfunctionality is only available through the keyboard|you might want to read the rest of this chapter.8.3 Editing Many Files at OnceEmacs can work on more than one le at a time.In fact, the only limit on how many bu ers yourEmacs can contain is the actual amount of memory available on the machine.The command tobring a new le into an Emacs bu er is C-x C-f.When you type it, you will be prompted for alename in the minibu er:Find file: ~The syntax here is the same one used to specify les from the shell prompt; slashes representsubdirectories, ~means your home directory.You also get lename completion, meaning that ifyou've typed enough of a lename at the prompt to identify the le uniquely, you can just hit Tabto complete it or to show possible completions, if there are more than one.Space also has a rolein lename completion in the minibu er, similar to Tab , but I'll let you experiment to nd outhow the two di er.Once you have the full lename in the minibu er, hit Return , and Emacs willbring up a bu er displaying that le.In Emacs, this process is known as nding a le.Go aheadand nd some other unimportant text le now, and bring it into Emacs do this from our originalbu er some file.txt [ Pobierz całość w formacie PDF ]

  • zanotowane.pl
  • doc.pisz.pl
  • pdf.pisz.pl
  • mikr.xlx.pl
  • Powered by MyScript