tldr/pages/common/emacs.md

38 lines
795 B
Markdown
Raw Normal View History

2015-12-30 13:14:38 +00:00
# emacs
> 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):
2021-06-14 23:27:30 +01:00
`emacs --no-window-system`
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`
2021-06-14 23:27:30 +01:00
- Stop a running Emacs server and all its instances, asking for confirmation on unsaved files:
2021-06-14 23:27:30 +01:00
`emacsclient --eval '(save-buffers-kill-emacs)'`
- Save a file in Emacs:
`Ctrl + X, Ctrl + S`
- Quit Emacs:
`Ctrl + X, Ctrl + C`