Emacs 效率指南:从入门到极客
$ emacs –why
Emacs is not just an editor — it's an operating system that happens to have a good text editor. Here's my guide to going from "What is this?" to "I live in Emacs now."
Essential Keybindings
C-x C-f find-file — open a file C-x C-s save-buffer — save C-x C-c save-buffers-kill — quit (eventually) C-g keyboard-quit — ESCAPE FROM EVERYTHING M-x execute-extended — the command palette C-h k describe-key — what does this key do?
Must-Have Packages
Org-mode (built-in, but configure it)
;; Better Org defaults (setq org-startup-indented t org-hide-leading-stars t org-log-done 'time)
Vertico + Consult (modern completion)
Replace the default minibuffer with something sane:
(use-package vertico :init (vertico-mode)) (use-package consult :bind (("C-x b" . consult-buffer) ("C-c g" . consult-grep)))
Magit (git, but actually enjoyable)
(use-package magit :bind (("C-x g" . magit-status)))
Pro Tips
- Use C-h everywhere — Emacs has the best documentation of any
software ever written. Press
C-h kto learn what any key does. - Kmacro is your friend —
F3to start recording,F4to replay. Macros beat repetitive editing every time. - Multiple cursors — install
multiple-cursorspackage and never manually edit 50 similar lines again. - Dired for file management —
C-x dopens a file manager. Yes, inside Emacs.
The .emacs.d Philosophy
"Your .emacs.d is your castle. Build it brick by brick, and never copy someone else's config wholesale."
Start minimal. Add only what you need. Understand every line.
;; A minimal init.el (package-initialize) (setq custom-file "~/.emacs.d/custom.el") (load custom-file 'noerror) ;; ... add your config below
Conclusion
Emacs has a steep learning curve, but the payoff is immense. You get an editor that adapts to your workflow, not the other way around.
$ emacs --version GNU Emacs 29.x Copyright (C) 2024 Free Software Foundation, Inc.
Next up: Terminal Aesthetics — making your shell look like a cyberpunk movie.