You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

39 lines
1.4 KiB

  1. # Emacs Tips
  2. *Posted 2007-05-22, updated 2021-07-01.*
  3. These are some emacs keybindings (and other functions) that I once found useful. I've mostly used Sublime Text for the last few years, however.
  4. ## Editing
  5. `C-[SPC]`: set mark
  6. `C-x C-x`: exchange point and mark
  7. `C-w`: kill (AKA "cut")
  8. `M-w`: kill-ring-save (AKA "copy")
  9. `C-y`: yank (AKA "paste")
  10. `M-h`: Put region around current paragraph (mark-paragraph).
  11. `C-x h`: Put region around the entire buffer (mark-whole-buffer).
  12. `C-u C-[SPC]`: Move in mark ring
  13. `M-d`: Kill word
  14. `M-[DEL]`: Kill word backwards
  15. `C-M-k`: Kill the following balanced expression (kill-sexp)
  16. ## Registers
  17. `C-x r r`: Save position of point in register r (point-to-register).
  18. `C-x r j r`: Jump to the position saved in register r (jump-to-register).
  19. `C-x r s r`: Copy region into register r (copy-to-register).
  20. `C-x r i r`: Insert text from register r (insert-register).
  21. ## Bookmarks
  22. `C-x r m [RET]`: Set the bookmark for the visited file, at point.
  23. `C-x r m bookmark [RET]`: Set the bookmark named bookmark at point (bookmark-set).
  24. `C-x r b bookmark [RET]`: Jump to the bookmark named bookmark (bookmark-jump).
  25. `C-x r l`: List all bookmarks (list-bookmarks).
  26. `M-x bookmark-save`: Save all the current bookmark values in the default bookmark file.
  27. ## Miscellaneous
  28. ``M-` `` shows the menu.
  29. `M-x highlight-changes-mode` toggles showing the changes you've made to the file since the last save.