Emacs
This page contains a variety of useful links and notes on the text editor Emacs, roughly organized. I don’t reference them very often anymore but thought they might be useful to someone else.
Editing tricks
- Dired search and replace - link
C-q C-j
literal newline- Like hitting return:
M-j
- to jump to next sentence
M-e
- Delete everything in parenthesis (or
di)~/~di}
)C-M-k
flush-lines
http://xahlee.info/emacs/emacs/elisp_list_matching_lines.html- Remove blank lines:
M-x flush-lines RET ^$ RET
- Remove blank lines:
- Opposite:
keep-lines
- https://hungyi.net/posts/emacs-calculate-while-you-write/
Text input
M-x (set-input-method 'TeX) RET tex RET
M-x (evil-ex-show-digraphs) RET
Good keybinds to remember
M-o
(ivy-dispatching-done)
C-M-j
-(ivy-immediate-done)
Orgmode
org-set-startup-visibility
(C-u C-u TAB)org-agenda-notime-is-late
- “You can use this option to decide if the schedule for today should come before or after timeless agenda entries.”- include base64 image in org file
- Radio targets
- Command to reveal x many levels in orgmode
3 C-c <tab>
C-c /
org sparse treeC-c \
match tags
C-u C-c C-c
to make list item into checkbox- https://stackoverflow.com/questions/58820073/s-in-org-agenda-prefix-format-doesnt-display-dates-in-the-todo-view
Clocking
- https://orgmode.org/manual/Clocking-Work-Time.html
- Insert clock table:
org-clock-report
- Update clock blocks -
C-c C-c
(place cursor on BEGIN)
Org Mode Exporting
- https://orgmode.org/manual/Export-Settings.html
org-export-with-sub-superscripts
- Write orgmode custom backend
HTML
#+HTML_HEAD: <link rel="stylesheet" type="text/css" href="styles.css"/>
- Embed CSS on export
LaTeX
- Org - Mode Basics: Exporting your notes (Latex basics)
- https://www.reddit.com/r/orgmode/comments/jykmpt/after_latex_export_oxlatex_the_fourth_level/
- https://github.com/dangom/org-thesis
org-reveal
Header
:REVEAL_PROPERTIES:
#+REVEAL_ROOT: https://cdn.jsdelivr.net/npm/reveal.js
#+REVEAL_THEME: serif
#+REVEAL_TRANS: none
#+REVEAL_INIT_OPTIONS: slideNumber:true, margin:0.20, minScale: 0.001, maxScale: 2.0
#+REVEAL_TITLE_SLIDE: <h2>%t</h2><h4><em>%s</em><h4><br><br><br><p style="font-size: 20pt;">By %a, %e</p><h4>%d</h4>
#+REVEAL_REVEAL_JS_VERSION: 4#+OPTIONS: timestamp:nil toc:1 num:nil
:END:#+TITLE: Journalism 101 Online Breakout
#+SUBTITLE: and some misc catchall
#+AUTHOR: Jacob Boxerman
#+EMAIL: jboxerman@fwparker.org
#+DATE: August 23, 2021
Tables
- Separators: Make new row with first column
/
. Put a<
in each column that should have a separator. - Add solid line:
org-table-insert-hline
Citations/Bibliography
- https://blog.tecosaur.com/tmio/2021-07-31-citations.html
- #+BIBLIOGRAPHY:
- [cite:@thing]
- Footnote action: C-c C-x f
org-columns
- https://emacsconf.org/2021/talks/professional/
- https://raw.githubusercontent.com/falloutphil/Misc/master/cpd.org
- https://orgmode.org/manual/Using-column-view.html
- https://orgmode.org/worg/org-tutorials/org-column-view-tutorial.html
- Sample columns configuration using properties:
:COLUMNS: %50ITEM %TODO %REQUIRES %OUTCOME %NOTES
- Can do the same file-wide with
#+COLUMNS
- Can do the same file-wide with
org-ql
(property "ARCHIVE_ITAGS" "cl")
Clocktables
(setq org-duration-format 'h:mm)
- Today:
#+BEGIN: clocktable :maxlevel 3 :block today :hidefiles t :compact t
- This week:
#+BEGIN: clocktable :maxlevel 3 :block thisweek :hidefiles t :compact t
- All:
#+BEGIN: clocktable :maxlevel 10 :tags t
- Scopes (examples)
:scope ("work.org" "~/Dropbox/org/org-archive/homework-archive.org_archive" "~/Dropbox/org/org-archive/todo-archive.org_archive")
:scope (lambda () (directory-files-recursively (expand-file-name "org-archive" org-directory) "homework"))
My favorite themes
- jake-doom-plain/jake-doom-plain-dark
- doom-old-hope
- doom-dark+
- doom-molokai
- doom-one/doom-one-light
- nano
- kaolin-galaxy
- doom-snazzy
- modus-themes
- doom-miramare
- doom-peacock
- doom-flatwhite
Code
Python
run-python
: begin shell thingC-c C-c
: run the content of the buffer in the opened python shellC-c C-r
: run the selected region in the python shell
ISpell
M-x ispell
Editing commands
*Select a number to auto-correct
SPC
- skip for latera
- accept wrong word for bufferi
- insert word into personal dictionary
Misc
Packages I’ve installed for Emacs:
- aspell (spellchecking)
- chemacs (multiple emacs profiles)
- emacs-plus
- fd (faster find)
- fzf (fuzzy file search)
- gnu coreutils (gls, ggrep, etc)
- ripgrep (faster grep)
Calc
Summing a Column of Numbers in Emacs :: jasani.org
Emacs commands to calculate sum, average, etc. of region - Super User
Links
Elisp
Comparisons & Conditionals
Expressions
Lists
- Cons Cells and Lists
- car and cdr
- Alists
- Accessing elements of lists
- http://ergoemacs.org/emacs/elisp_list.html
Manuals/Guides
People (blogs, configs)
- https://karl-voit.at/apps-I-am-using/
- https://github.com/piercegwang/emacsd/
- https://gitlab.com/dwt1/dotfiles
- https://sachachua.com/dotemacs/
- https://github.com/ogdenwebb/snug-emacs
- https://github.com/mclear-tools/dotemacs
- https://github.com/bcmertz/dotfiles/tree/main/.emacs.d
- https://gitlab.com/public-repositories/emacs-groundup
- https://alhassy.github.io/emacs.d/
- https://github.com/SystemCrafters/crafted-emacs
Forums
Articles/posts/blogs
Packages
- https://www.emacswiki.org/emacs/TypographicalPunctuationMarks
- https://github.com/misohena/phscroll
- https://github.com/bmag/emacs-purpose
- Marginalia - cool stuff in describe variable, function, etc. Same-ish as ivy-rich
- https://github.com/alphapapa/org-bookmark-heading
- https://github.com/osener/emacs-webkit-color-picker
- https://github.com/misohena/el-easydraw
- https://github.com/ioah86/repetition_error_finder/
- https://github.com/bitspook/spookfox
- https://gitlab.com/tygrdev/org-real
- https://github.com/joaotavora/eglot
- https://github.com/Silex/elmacro
- https://github.com/novoid/Memacs
- https://alhassy.github.io/org-special-block-extras/
- https://github.com/minad/org-modern + https://github.com/jdtsmith/org-modern-indent