I love Emacs. Emacs is a great text editor, plus much more than that. You might say that anythig text-based can be handled nicely in Emacs.
I first chose Emacs at work as it looked more sophisticated than vi. Decades later, I still use Emacs as I’ve been convinced that it’s one of the best tools and worth the time and effort to keep learning.
Following are my current worklows using Emacs.
Note-taking with org-mode
As with most emacs enthusiasts, I use emacs mainly for org-mode. Very roughly speaking, org-mode is an extended and much more sophisticated Markdown. As with Markdown, org files are plain text files.
I use org-mode for things like:
- Tech memos - org-mode has features that are great for tech memos
- code blocks - If you specify annotations such as
emacs-lispto blocks, Emacs will color-code keywords for you. It will enhance readability. - tables - Emacs is very good at tables. The best thing is that Emacs will automatically adjust column widths as you write. Although I don’t use often, it can be used as a mini spreadsheet with calculations among cells.
- inline images - Emacs can show linked images inline on org files.
- code blocks - If you specify annotations such as
- Memos when reading books
- Paper books, PDFs and web articles
- Why using Emacs for physical books, you might ask? Because Emacs and its org-mode is a good note-taking app with extremely efficient cursor-movement and editing features.
- Personal wiki pages
- If you put org files on github (or gitlab), it will render org files nicely in an eye-pleasing manner. I use a github private repository for my personal wiki pages.
- Random small memos
- org-journal - If I want to write a short memo, for example in a meeting, I open org-journal, write down quickly, then just close it. You can search later what you wrote.
- Planning, scheduling and calendar
- Emacs is surprisingly good at these tasks. Even if you put your to-dos in multiple files in not-so-organized way, Emacs will generate for you a neat, organized view of your schedule.
- org-agenda
- Writing blog articles
- I write blog articles (like this blog) in an org file, convert it to Markdown files with ox-hugo, and publish them with hugo.
- I also have a different blog (in Japanese), written in org-mode. I use pelican for it. But it takes 1-2 minutes to compile.
tramp-mode
tramp is magic. It is part of Emacs infrastructure, and is one of the biggest reasons that I use Emacs. With tramp, you can handle remote files just like they are local. Many Emacs features and packages support tramp, and they just work.
Shell
I use eat (and sometimes Eshell) when I need a terminal emulator within Emacs. With eat, you can use Emacs’s powerful search and copy&paste features.
I found it extremely convenient when I need to do a lot of copy&paste from a cheatsheet to a terminal as I can optimize the number of key strokes (eg, type M-o instead of using mouse to switch apps). Usually, it’s a remote terminal for a development machine. But with tramp, it just works.
Managing files with dired
dired is a very powerful file management tool within Emacs. You can open, copy, rename, delete, change mode, zip/unzip etc. against a single or multiple files/directories. With tramp, you can (magically) move/copy files between local and remote directories. For the copy, you have an option to use rsync in addition to ssh or scp.
Writing emails with notmuch
I use Gmail, and I use its web interface to read emails. But when I write long emails, I will need Emacs’s help as editing on Gmail web interface is horrible.
I use notmuch as the email client. To download emails from Gmail and make available to notmuch, I use mbsync. I wrote a small elisp function to sync with Gmail.
(defun mbsync ()
"Run mbsync -a remotely at remote vm. Will block for some time."
(interactive)
(let ((default-directory (expand-file-name "/ssh:localhost#2222:~/")))
(process-file "mbsync" nil nil nil "-a")))
magit - the git client
Magic is a git client, and is another killer app for Emacs. I’m not a professional programmer, and so I’m not very familiar with it. I usually use git to upload files to my github repositories. Even for these fixed operations, magit is very convenient in that I can minimize key strokes.
Book marking
Bookmarks are very convenient just like in browsers. You can quickly access your favorite files.
I bookmark cheatsheets, memos, password file, etc. It’s convenient especially if target files are in remote machines (you can skip specifying hostname, etc.)
Reading web articles with eww
eww package is a text-based web browser. It can’t be used for daily web browsing because it doesn’t support CSS or JavaScript, but eww is convenient if you only need texts and images.
When I use eww, I maximize emacs frame, and split horizontally (ie, side-by-side) to 2 windows. The left window (pane) is for web articles w/ eww, and right is for org-mode memo.
Reading PDF files with pdf-tools
With pdf-tools, you can read PDF files. You can add comments. Just like when using eww, I maximize emacs frame, and show PDF in left pane and write org memo in right pane.
Programming
Emacs can be a great IDE. As Emacs supports Language Server Protocol (LSP; with packages), Emacs is capable of doing many things that Microsoft VSCode can. I write Python, emacs lisp, JavaScript and Java codes in Emacs (in the order of my proficiency..)
I use eglot as a LSP client, blacken, flycheck, pyvenv, etc.