2015-12-30 13:14:38 +00:00
|
|
|
# emacs
|
|
|
|
|
2016-01-07 17:31:27 +00:00
|
|
|
> The extensible, customizable, self-documenting, real-time display editor.
|
2021-06-14 23:27:30 +01:00
|
|
|
> See also `emacsclient`.
|
2019-06-08 01:04:00 +01:00
|
|
|
> More information: <https://www.gnu.org/software/emacs>.
|
2015-12-30 13:14:38 +00:00
|
|
|
|
2021-06-14 23:27:30 +01:00
|
|
|
- Start Emacs and open a file:
|
2015-12-30 13:14:38 +00:00
|
|
|
|
2021-06-14 23:27:30 +01:00
|
|
|
`emacs {{path/to/file}}`
|
2015-12-29 23:11:42 +00:00
|
|
|
|
2021-06-14 23:27:30 +01:00
|
|
|
- Open a file at a specified line number:
|
2015-12-29 23:11:42 +00:00
|
|
|
|
2021-06-14 23:27:30 +01:00
|
|
|
`emacs +{{line_number}} {{path/to/file}}`
|
2015-12-29 23:11:42 +00:00
|
|
|
|
2022-09-02 03:22:16 +01:00
|
|
|
- Run an Emacs Lisp file as a script:
|
|
|
|
|
|
|
|
`emacs --script {{path/to/file.el}}`
|
|
|
|
|
2021-06-14 23:27:30 +01:00
|
|
|
- Start Emacs in console mode (without an X window):
|
2020-01-23 14:01:39 +00:00
|
|
|
|
2021-06-14 23:27:30 +01:00
|
|
|
`emacs --no-window-system`
|
2020-01-23 14:01:39 +00:00
|
|
|
|
2021-06-14 23:27:30 +01:00
|
|
|
- Start an Emacs server in the background (accessible via `emacsclient`):
|
2015-12-29 23:11:42 +00:00
|
|
|
|
2021-06-14 23:27:30 +01:00
|
|
|
`emacs --daemon`
|
2020-01-23 14:01:39 +00:00
|
|
|
|
2021-06-14 23:27:30 +01:00
|
|
|
- Stop a running Emacs server and all its instances, asking for confirmation on unsaved files:
|
2020-01-23 14:01:39 +00:00
|
|
|
|
2021-06-14 23:27:30 +01:00
|
|
|
`emacsclient --eval '(save-buffers-kill-emacs)'`
|
|
|
|
|
|
|
|
- Save a file in Emacs:
|
|
|
|
|
2023-12-29 16:02:08 +00:00
|
|
|
`<Ctrl> + X, <Ctrl> + S`
|
2021-06-14 23:27:30 +01:00
|
|
|
|
|
|
|
- Quit Emacs:
|
|
|
|
|
2023-12-29 16:02:08 +00:00
|
|
|
`<Ctrl> + X, <Ctrl> + C`
|