Emacs Basicsλ︎
Understanding the basic terminology will help make the most out of Spacemacs and allow very effective use.
Terminology | Description |
---|---|
File | A file on the file system |
Buffer | A container to display a file or other information (file navigation, REPL, data inspector, test report, etc.) |
Window | Contains a buffer, organises multiple buffers in a frame |
Frame | Holds one or more windows. Opening another frame gives you another instance of Emacs |
Status bar | Information about current window and buffer, e.g. window number, buffer mode & name, location of cursor. Also referred to as the mode line. |
Mini-buffer | A command line for Emacs - shows commands and some results, acts as an interactive prompt for some commands |
Spacemacs also adds Layouts to manage a set of buffers within the scope of a project and Workspaces allow multiple window configurations
Working with Framesλ︎
By default, Spacemacs opens with a frame that contains a single window, that window containing the Spacemacs home buffer.
Space F n creates a new frame containing a single window that contains a buffer.
Space F d closes the current frame, unless its the last Emacs frame running, then Emacs itself closes.
Space q q to quit Emacs closes all frames.
Working with windowsλ︎
Each frame contains one or more windows. Each window is assigned a unique number when created, even across multiple frames.
Space followed by a number jumps to the window with that number, e.g. Space 1 jumps to window number 1.
Windows are used to display multiple buffers (files, REPL, error messages, etc) within the same frame
Key Binding | Description |
---|---|
Space w . | Open Window transient state menu for multiple command |
Space w 2 | 2 window layout - shows current buffer in new window |
Space w 3 | 3 window layout - shows current buffer in new windows |
Space w m | maximise the current buffer |
Space w d | delete current window |
Space w g | toggles golden ratio view of windows |
Working with windowsλ︎
A buffer is the fundamental presentation of information in Emacs. Buffers can show the contents of a file, search results in a helm-popup, an interactive process e.g. REPL buffer, etc.
Space Tab toggles between the current buffer and the last active buffer
Key Binding | Description |
---|---|
Space b . | Open buffer transient state menu for multiple command |
Space b b | Show list of open buffers and recently opened buffers |
Space b d | Kill current buffer |
Space b h | Open Spacemacs Home buffer |
Space b m | Open Spacemacs *messages* buffer - log of Emacs actions and commands |
Space b s | Open Spacemacs scratch buffer - a persistent buffer for random note taking |
Space b w | Toggle read-only mode on a buffer (Spacemacs Org docs open in Read-only mode by default) |
Space b x | Kill buffer and the window containing it |
Space b R | Revert buffer to file saved on disk (causes .dir-locals.el to load into Emacs) |
Space b Y | Copy contents of a whole buffer |
Golden Ratioλ︎
Golden-ratio automatically lays out windows in a Fibonacci style pattern. The active window becomes the largest window and all other windows are automatically shrunk so they are out of the way, but still visible.