Emacs cheat sheet - part 2
This is a follow-up of my emacs cheat sheet.
Some notes about working with multiple files: frames, buffers, windows, and tabs.
I am also using the Emacs convention for denoting commands, thus unless configured otherwise:
-
C-
is Ctrl followed by another key -
M-
is Alt followed by another key -
S-
is Shift followed by another key
Buffer
Emacs can display multiple buffers, just like many editors and IDe can open multiple files at the same time.
-
show next buffer:
C-x <right>
-
show previous buffer:
C-x <left>
-
Kill current buffer:
C-x k
-
list all buffers:
C-x C-b
(dialog can be closed withq
) -
open/create a new file
C-x C-f
Window
Multiple windows can display parts of different buffers, or different parts of one buffer.
Multiple frames imply multiple windows because each frame has its own set of windows.
Each window belongs to one frame.
-
split frame horizontally:
C-x 2
-
split frame vertically:
C-x 3
-
select another window:
C-x o
or mouse click -
kill current window:
C-x 0
-
kill another window:
C-x 1
-
kill current window and buffer:
C-x 4 0
Note: when a buffer is closed/killed (C-x k
), the current window shows another existing buffer.
Tabs
Those work similarly to other graphical editors.
Separate tabs can be used for editing separate files. A tab contains a frame, which can be split into multiple windows.
-
open a new tab with the current buffer
C-x t 2
-
close the current tab:
C-x t 0
, or mouse click on thex
-
close all other tabs:
C-x t 1
-
select the next tab:
C-TAB
-
select the previous tab:
C-S-TAB
Do you want to share your opinion? Or is there an error, some parts that are not clear enough?
You can contact me anytime.