Emacs Basic (2)
Commands to Manipulate Files
C-x C-f, find-file.
This is the main command used to read a file into a buffer for editing. It's actually rather subtle. When you execute this command, it prompts you for the name of the file (with completion). Then it checks to see if you're already editing that file in some buffer; if you are, it simply switches to that buffer and doesn't actually read in the file from disk again. If you're not, a new buffer is created, named for the file, and initialized with a copy of the file. In either case the current window is switched to view this buffer.
C-x C-s, save-buffer.This is the main command used to save a file, or, more accurately, to write a copy of the current buffer out to the disk, overwriting the buffer's file, and handling backup versions.
C-x s, save-some-buffers.Allows you to save all your buffers that are visiting files, querying you for each one and offering several options for each (save it, don't save it, peek at it first then maybe save it, etc).
Commands to Manipulate Buffers
C-x b, switch-to-buffer.
Prompts for a buffer name and switches the buffer of the current window to that buffer. Doesn't change your window configuration. This command will also create a new empty buffer if you type a new name; this new buffer will not be visiting any file, no matter what you name it.
C-x C-b, list-buffers.Pops up a new window which lists all your buffers, giving for each the name, modified or not, size in bytes, major mode and the file the buffer is visiting.
C-x k, kill-buffer.Prompts for a buffer name and removes the entire data structure for that buffer from Emacs. If the buffer is modified you'll be given an opportunity to save it. Note that this in no way removes or deletes the associated file, if any.
C-x C-q, vc-toggle-read-only.Make a buffer read-only (so that attempts to modify it are treated as errors), or make it read-write if it was read-only. Also, if the files is under version control, it will check the file out for you.
Commands to Manipulate Windows
C-v, scroll-up.
The basic command to scroll forward (towards the end of the file) one screenful. By default Emacs leaves you two lines of context from the previous screen.
M-v, scroll-down.Just like C-v, but scrolls backwards.
C-x o, other-window.Switch to another window, making it the active window. Repeated invocation of this command moves through all the windows, left to right and top to bottom, and then circles around again. Under a windowing system, you can use the left mouse button to switch windows.
C-x 1, delete-other-windows.Deletes all other windows except the current one, making one window on the screen. Note that this in no way deletes the buffers or files associated with the deleted windows.
C-x 0, delete-window.Deletes just the current window, resizing the others appropriately.
C-x 2, split-window-vertically.Splits the current window in two, vertically. This creates a new window, but not a new buffer: the same buffer will now be viewed in the two windows. This allows you to view two different parts of the same buffer simultaneously.
C-x 3, split-window-horizontally.Splits the current window in two, horizontally. This creates a new window, but not a new buffer: the same buffer will now be viewed in the two windows. This allows you to view two different parts of the same buffer simultaneously.
C-M-v, scroll-other-window.Just like C-v, but scrolls the other window. If you have more than two windows, the other window is the window that C-o would switch to.
0 Comments:
Post a Comment