Книга: Learning GNU Emacs, 3rd Edition

1.7 Opening a File

You can open a file by specifying the filename when you start Emacs from the command line or by typing C-x C-f (the long command name is find-file).

The paper icon on the toolbar also runs this command. In some applications, a similar icon simply creates a new, unnamed file (e.g., Document1 in Word). Emacs expects you to provide a filename, as we'll see in a moment.

Press: C-x C-f


Emacs prompts you for a filename.

To press C-x C-f, hold down Ctrl, press x and then press f. Now release Ctrl.

After you press C-x C-f, Emacs uses the minibuffer to ask you for the filename. Whenever Emacs wants input from you, it puts the cursor in the minibuffer. When you're done typing in the minibuffer, press Enter.

Type: newfileEnter


Emacs starts another buffer with the new file in it.

What if you try to read the same file twice? Instead of creating a new buffer, Emacs just moves you to the buffer the file is in.

You can also open a file in Emacs by dragging and dropping it on an Emacs window or on the Emacs icon.

Now is a good time to try typing if you haven't already done so. You may find yourself wanting to learn more about cursor movement and editing; that's fine. Feel free to skim the rest of this chapter and go on to Chapter 2. We recommend that you read the sections on saving files and exiting Emacs. There's also a table of commands at the end of this chapter for future reference. If you'd like to learn more about working with files as well as some shortcuts, stay with us through the rest of the chapter.

Оглавление книги


Генерация: 0.995. Запросов К БД/Cache: 3 / 0
поделиться
Вверх Вниз