EMACS is a graphical editor that has colors, menus, and scroll bars. However, most people never see any of that. What you probably see when you start emacs is a blank screen with a white bar almost at the last line. Perhaps there is some copyright stuff that goes away when you press a key. Too bad, that makes emacs a little more difficult to use. However, that's the version this guide is going to cover.
$ emacs my_doc.txtYou'll see something like this on the screen:
The four dashs before the word 'Emacs:' tell you the condition of your document. If you need to save you file, it'll have two stars '*' with the dashes, if you are not allowed to edit this document (maybe it belongs to someone else?) it'll have two percent signs '%' with the dashes. It's not vital information, but it's nice to have.
The text after the word 'Emacs:' tells you the name of the buffer you are currently in. The difference between a buffer and a file is subtle, and most of the time, they'll be the same thing. More will be said about this later.
The text in parenthesis tells you what kind of document you are looking at. Usually you will be in Fundamental Mode, or text mode. This example has EMACS in Text Fill mode.
Usually, your document will be so big that it won't all fit on the screen. That's where the word 'All' comes in. That section of the status bar lets you know what section of the document you see on the screen. 'All' means that you see everything. 'Top' means you're at the top of the document. 'Bot' means your looking at the bottom. If it's a number instead of a word, that's the percentage of the document that you've scrolled down to.
That's it for the basics of the status bar. More information can be given, but it doesn't show up unless you ask for it. And that will be covered later.
A file is a document stored on the disk. When you save a document, you are saving it to a file. Then, later, you can load it again.
A directory is a way of organizing files. A directory can contain files, or other directories.
Quick EMACS Commands
|I pushed the wrong key. Help!:||Ctrl-g|
Working with files:
|Load a file:||Ctrl-x Ctrl-f|
|Load a directory:||Ctrl-x Ctrl-f|
|New file:||Ctrl-x Ctrl-f|
|Save a file:||Ctrl-x Ctrl-s|
|Save all open files:||Ctrl-x s|
|Save the file with a new name||Ctrl-x Ctrl-w|
Dealing with Buffers
|Switch buffers:||Ctrl-x b|
|Close buffer:||Ctrl-x k|
|Split current buffer||Ctrl-x 2|
|Make current buffer the only one on screen||Ctrl-x 1|
|Switch between the buffers on-screen||Ctrl-x o|
Cutting and pasting
|Cut and save text from here to mark:||Ctrl-w|
|Paste saved text:||Ctrl-y|
|Cut text from the cursor to the end of the line:||Ctrl-k|