Emacs Indentation

One of the darker corners of Emacs that always seems to cause problems for n00bs and old-timers alike is indentation, tabs, and spaces. When I started, I somehow stumbled onto a configuration that worked for me and I haven’t touched it since. I mostly treat it as a magic spell.

Fortunately, Doug Beney has a post that sheds some light on the matter and that can help you set up your own configuration whether you worship in the Church of Tabs or the Tabernacle of Spaces. Beney prefers tabs and show a complete configuration that enables them for certain types of files but his post explains how to use spaces if you prefer.

He also explains things like how to get backspace to delete whole tabs instead of doing it a space at a time, how to get electric indent to behave sanely, and even getting tabs to behave correctly in Python. Another interesting feature that he implements is displaying a tab as a low-light pipe symbol. Not everyone will like that, of course, but if you think it could be useful, Beney shows you how to do it for both light and dark themes.

Beney’s post is from 2018 but somehow just popped up in my feed. The advice is still good and if you’re looking for a way to finally get indentation the way you want it, take a look at his post.

This entry was posted in General and tagged . Bookmark the permalink.