next up previous
Next: Splitting windows and creating Up: emacs Previous: Tab completion of file

Editing more than one file at once

If you are editing more than one file at once, of course, you can always start two emacs sessions, one for each file. This is unnecessary and not recommended. Things get very confusing if you accidentally have two emacs sessions editing the same file. And more sessions require more resources, which can slow down your machine. Switching between files is much more comfortable within a single emacs session. Much better to use the multiple buffer feature of emacs.

If you are editing the first file and want to start editing the second file, simply use the hot key C-x C-f or the menu selection File->Open File to start the second file. The second file is loaded into its own buffer. The first file remains in its buffer, but it drops out of view. To switch between buffers, use the hot key combination C-x b. Be careful about the Control key here. C-x C-b gives you a list of buffers instead. By default the command C-x b takes you back to the previously visited buffer. If that is what you want, just hit Return. Otherwise, type the name of the buffer you want to go to. (Use Tab completion to make the process quick.) You can switch back and forth between the two recent buffers by typing C-x b repeatedly.

You may also switch between buffers by using the Buffers pull-down menu. The buffer list contains names with asterisks that are not associated with files. Select the buffer you want by dragging and releasing with the left mouse button.


next up previous
Next: Splitting windows and creating Up: emacs Previous: Tab completion of file
Carleton DeTar 2016-12-29