
This isn’t the first time I’ve pulled up Emacs and dusted it off, to dive back in again as a daily driver for code writing. The last time I did this was back around the middle of 2020 when I was trying to find a relatively powerful code editor for Raspbian on an Raspberry Pi. This time I’m writing lots of Python and C++ for embedded work as well as general application programming. I’m even working to add syntax highlighting support for Go Lang and Rust. Right now the syntax highlighting for C++ is just dandy.
Why have I flopped back to Emacs Yet Again? Because I got tired of Visual Studio Code. I have a small, modest development box built around the Minus Forum UM250 with an AMD Ryzen 2500U. It’s a modest machine with a tiny hardware footprint, more than adequate for my uses as long as I’m careful what I run on the system. Most of the time when I’m working the system fan is totally quiet. But recently I started the hear the fan running slowly in the background. I run btop in a terminal, so I started to look at how the system was running, and sure enough, something was constantly pushing the CPU enough that the fan was running slowly. I did a little bit of investigative work and I discovered that if I had the latest version of Visual Studio Code up on the desktop with a project open, the fan would run as if there was a bit of a load on it. As soon as I closed VSCode, the fan stopped turning and btop showed that the CPU usage dropped down to a minimal level. Start up VSCode again, and the load ticked up as did the fan running. VSCode didn’t use to do that.
While there are some plugins I now use for embedded work in VSCode, there’s an awful lot I can do with Emacs. I downloaded the latest source tarball from the Savannah Emacs site, unpacked it, configured it, built it, and installed it. Afterwards I tinkered together an Emacs initialization file (see the listing that follows) to give me a minimal look and functionality that I found satisfying and then away I went. I find it interesting I still have the Emacs keyboard muscle memory, in spite of drifting away from it a number of times over the years. But it’s been a good 30 years since I was first introduced to Emacs, so that counts for something, I suppose.
(setq inhibit-startup-message t)(setq inhibit-startup-screen t)(setq global-display-line-numbers-mode t)(setq gc-cons-threshold 50000000)(setq large-file-warning-threshold 100000000)(prefer-coding-system 'utf-8)(set-default-coding-systems 'utf-8)(set-terminal-coding-system 'utf-8)(set-keyboard-coding-system 'utf-8)(require 'package)(setq package-enable-at-startup nil)(add-to-list 'package-archives '("melpa" . "http://melpa.org/packages/"))(add-to-list 'package-archives '("gnu" . "http://elpa.gnu.org/packages/"))(package-initialize)(unless (package-installed-p 'use-package) (package-refresh-contents) (package-install 'use-package))(eval-when-compile (require 'use-package))(setq frame-title-format '((:eval (if (buffer-file-name) (abbreviate-file-name (buffer-file-name)) "%b"))))(setq scroll-margin 0 scroll-conservatively 100000 scroll-preserve-screen-position 1)(set-frame-font "Hack 13" nil t)(use-package doom-themes :ensure t :config (load-theme 'doom-material-dark t) (doom-themes-visual-bell-config))(setq-default tab-width 4 indent-tabs-mode nil)(global-set-key (kbd "C-x k") 'kill-this-buffer)(add-hook 'before-save-hook 'whitespace-cleanup)(use-package diminish :ensure t)(add-hook 'prog-mode-hook #'display-fill-column-indicator-mode)(custom-set-variables ;; custom-set-variables was added by Custom. ;; If you edit it by hand, you could mess it up, so be careful. ;; Your init file should contain only one such instance. ;; If there is more than one, they won't work right. '(cua-mode t) '(custom-safe-themes '("84d2f9eeb3f82d619ca4bfffe5f157282f4779732f48a5ac1484d94d5ff5b279" default)) '(font-use-system-font t) '(global-display-line-numbers-mode t) '(package-selected-packages '(use-package)) '(save-place-mode t))(custom-set-faces ;; custom-set-faces was added by Custom. ;; If you edit it by hand, you could mess it up, so be careful. ;; Your init file should contain only one such instance. ;; If there is more than one, they won't work right. )
My Emacs initialization file is located in ~/.emacs.d/init.el
. I’m sure there are other features that I could add, or better plugins for the theme, but right now Emacs is fast and useful, and has a much lesser resource footprint that VSCode. I’m glad I’m back to using it again.
You must be logged in to post a comment.