My Emacs setup for Org mode, flyspell, and git
Originally posted June 2, 2018
I do much of my work in SSH shells to remote servers and while I have used Emacs for about 30 years I don’t usually take too much time and effort customizing it. I have recently started using Org mode at work (I am a Master Software Engineer at Capital One and manage a Deep Learning team) and at home. Today after enjoying a Saturday morning gym workout I decided to improve my Emacs setup and this blog article is documentation that I will use in the future for reference. If it saves you some time or gives you useful ideas, even better!
I wanted to enable flyspell (which is installed with any current Emacs distribution) for all text modes, and that includes Org mode files. I added the following to my .emacs file:
(add-hook 'text-mode-hook 'turn-on-visual-line-mode) ;; flyspell (dolist (hook '(text-mode-hook)) (add-hook hook (lambda () (flyspell-mode 1))))
I like to augment the Aspell spelling dictionary with words I commonly use that are not in the default dictionary. As an example, I am going to configure Aspell with a custom dictionary and add the word “Keras” and “TensorFlow: by creating a file ~/.aspell.en.pws that contains:
personal_ws-1.1 en 0 Keras TensorFlow
Now when your local Emacs runs Aspell, flyspell will pick up the words in your custom dictionary.
I love Org mode, especially with SrSpeedBar, to quickly navigate and use Org to organize my day, take project notes, etc.
I like to use SrSpeedbar when in window mode (i.e., when running Emacs locally in its own window) but not inside a terminal or SSH session. I add the following to my .emacs:
(load "~/.emacs.d/sr-speedbar.el") (require 'sr-speedbar) (setq speedbar-use-images nil speedbar-show-unknown-files t sr-speedbar-right-side t) (when window-system (sr-speedbar-open)) (setq sr-speedbar-width 40) ;; doesn't work for me (setq sr-speedbar-max-width 50) ;; doesn't work for me
I usually run package-list-package to find and install Emacs packages but I load sr-speedbar.el from a downloaded source file.
I sometimes use magit for using git inside my Emacs environent but I usually just run git on the command line.
Magit is probably already installed with your Emacs but if not you can use package-list-package (or however else you manage Emacs packages) to instal it.
So far I have not customized my magit setup at all, not even any key bindings. I use M-x magit- followed by the tab character to see possible completions. Usually I just use M-x magit-status to review version histories. Magit is a deep tool and I am getting used to it slowly, learnig features as I need them.