Emacs Notes

Emacs Notes

Updated: October 21, 2020
Emacs

Emacs notes (doom emacs)

Org #

handy cheatsheet: https://orgmode.org/orgcard.pdf

  • To get a TODO item created on the same level as the one in which you’re working (org-insert-todo-heading)

  • Add tag: To add a tag to a heading (* line) SPC m q (or C-c C-q) then type the tag name, should appear in gray

  • Tag search: To search all the tags: SPC o a m

  • Schedule/Deadline: To set something as scheduled in org-agenda (so it shows up when you SPC o A n) SPC m d s, similarly for setting a deadline for something SPC m d d

  • Sort TODOs: to sort TODOs (in various ways) go to the heading and select org-sort-entries. Capitalization of an option will reverse the sort order.

  • Insert a code block <s followed immediately by Tab

Magit #

Committing #

Specific lines in a changed file #

Say you’ve edited some file (README.md) with the following lines:

  commit this

  don't commit this

and you want to only commit one line (line 1, in this example):

  magit status (SPC g g)

you’ll then get a magit window, look into the Unstaged changes line (open with Tab). You should then see some git output with the delta:

  +
  +commit this
  +
  +don't commit this

To select only the commit this line, you would highlight the line as a visual section (in Vim lingo) and stage it with s. Then commit the newly-staged section with

  magit-commit (c)
  // or
  magit-create-commit (SPC g c c)

Now you can push to a repository with magit-push

You can visual-select any number of lines, hit s, select a totally different line, hit s (again) and then commit to be ultra-selective with your staging.