gush.org (2756B)
1 It is hard to put into words how much Emacs encroaches on my life. 2 There are [[https://en.wikiquote.org/wiki/Emacs][very poetic quotes]] out there, e.g. 3 4 #+attr_html: :cite https://en.wikiquote.org/wiki/Emacs 5 #+begin_quote 6 Emacs outshines all other editing software in approximately the same 7 way that the noonday sun does the stars. It is not just bigger and 8 brighter; it simply makes everything else vanish. 9 #+end_quote 10 — Neal Stephenson, {{{cite(In the Beginning… was the Command Line)}}} 11 12 Perhaps if I put enough miscellaneous trivia into this file, it will 13 eventually grow into something that can justify this level of 14 hyperbole. 15 * Conventions 16 ** =RET= vs =C-j= 17 :PROPERTIES: 18 :CUSTOM_ID: convention/electric-indent 19 :END: 20 By default, Emacs turns on ~electric-indent-mode~, which, among other 21 effects, sets down a convention that works across most modes: 22 23 - =RET= is the "DWIM" binding that opens a new line at the "correct" 24 indentation level; 25 - =C-j= is the simple binding that literally just inserts a newline. 26 27 My (completely post-hoc) mnemonics for this is that =RET= is either 28 29 - =C-m=: I rarely want to insert an actual /carriage return/; if I do 30 though, I can quote-insert it with =C-q C-m=, like other control 31 characters, 32 - the =<retrun>= function key: it stands to reason that a "function 33 key" would do something "smart". 34 35 While =C-j= is "literally byte 10, aka the newline character", i.e. a 36 character that I will indeed write as-is in my files. 37 38 (Pay no mind to ~lisp-interaction-mode~ aka =*scratch*= breaking this 39 convention by binding =C-j= to ~eval-print-last-sexp~; we wouldn't want 40 things to become /too/ consistent now would we 😀) 41 * Third-party packages 42 ** Magit 43 A bit unfair to lump Magit in "third-parties" given its popularity, 44 and its fruitful secret life as "tarsius's personal Elisp mad lab". 45 Some may call it "NIH syndrom", but I personally thank Jonas for 46 pushing the boundaries of what Emacs can do, from UX (transient, 47 magit-section) to DevEx (cond-let, llama). 48 *** blame 49 - =b= drills down recursively into the current chunk's history. I 50 used to 51 1. blame, 52 2. land on an "uninteresting" commit (cleanup, refactoring), 53 3. =SPC= to get the revision buffer, 54 4. scroll to the relevant hunk, 55 5. =RET= on the corresponding removed line, 56 6. go to 1, 57 until I finally found the "interesting" commit; turns out =b= 58 automates all of this. 59 *** diff buffers 60 - =RET= vs =C-j=: I like that they follow what I think of as [[#convention/electric-indent]["the 61 electric-indent convention"]], i.e. "=RET= does something smart; =C-j= 62 stays dumb" 63 - =RET= visits DWIM read-only blobs: 64 - added or context line? current revision 65 - removed line? parent revision 66 - =C-j= visits the current worktree file