/home/eto/blog/emacs-for-nvchads.html
blog
extreme privacy, or stay like everyone else?
emacs for nvchads
projects
homelab
thoughts
Emacs for NvChads
2026.08.07
Acknowledgments
Before I get started with the article I'd like to mention that I am just getting<br>started with everything written in this article. If you have any suggesting consider<br>emailing me. I am very grateful to deci (codeberg / telegram / disroot) for the revisions and editing. I plan to expand this topic with some time. Good time reading!
This article was originally written in Org Mode. Get it here if you want to: qlain.online/emacs.org
No AI was used here.
A program is free software if the program’s users have the four essential<br>freedoms:
The freedom to run the program as you wish, for any purpose (freedom 0).
The freedom to study how the program works, and change it so it does your<br>computing as you wish (freedom 1). Access to the source code is a precondition<br>for this.
The freedom to redistribute copies so you can help your neighbor (freedom 2).
The freedom to distribute copies of your modified versions to others (freedom<br>3).
By doing this you can give the whole community a chance to<br>benefit from your changes. Access to the source code is a precondition for<br>this.
--- Free Software, Free Society: The Selected Essays of Richard M. Stallman
Chapter 1: Motivation
Hello internet. I have to admit, I am a NVim user, and relied on this text<br>editor for more than two and a half years. My old config was written from<br>scratch by me. I was writing lua plugins by myself. Did everything.
However, almost on a daily basis I watch YouTube. And almost every tech blogger<br>that I follow uses Emacs: Valentin Ignatev , Tsoding , DistroTube ,<br>Jonathan Blow . Still I follow a pretty big amount of Vim/NVim content creators, yet they<br>are not as often on my feed as Mister Zozin with his godly quality streams.
Bloggers are nice, but I wasn't ready for a change. I was quite used to vim<br>motions, lightweight tui text editor, lua programming language, and nice<br>community. I was quite fond of the FOSS philosophy and what power it gives. One<br>would say communism, but well designed communism :). It was in the March of this<br>year when I discovered Free Software, Free Society: The Selected Essays of Richard M. Stallman. Reading through it changed my views on software world so<br>much. This read would be my personal recommendation. Still, I wasn't ready and<br>continued to heavily rely on NVim for everyday tasks and projects. Until I had a<br>need to reinstall my Arch Linux system.
You see, my first ever Linux distro was Arch that I installed back in 2021. And<br>I had a mistake of using an ext4 filesystem, and with my root being only 40gb of<br>space, while the home was over 400gb. I constantly needed to uninstall some<br>packages just to do small updates. Bad, right? I then decided that I am tired of<br>this bullshit, and reinstalled my system with backing up everything<br>beforehand. However, I forgot about my ~/.config/nvim directory... Imagine my<br>horror when I discovered that all of my old work was wiped. Sad, but what do I<br>do? I then wrote this small config for configuring stuff while still in tty
Lua
~/.config/nvim/init.lua
local opt = vim.opt<br>opt.tabstop = 4<br>opt.number = true<br>opt.relativenumber = true
local keymap = vim.keymap.set<br>keymap("n", "", ":edit ./")
keymap("n", 'sv', 'v', {desc = "Split window vertically."})<br>keymap("n", 'sh', 'e', {desc = "Split window horizontally."})<br>keymap("n", 'se', '=', {desc = "Make splits equal size."})<br>keymap("n", 'sx', 'close', {desc = "Close current split."})
keymap("n", 'th', 'tabnew', {desc = "Open a new tab."})<br>keymap("n", 'tx', 'tabclose', {desc = "Close current tab."})<br>keymap("n", 'tn', 'tabn', {desc = "Go to next tab."})<br>keymap("n", 'tp', 'tabp', {desc = "Go to previous tab."})<br>keymap("n", 'tf', 'tabnew %', {desc = "Open current buffer in a new tab."})
It is basic but enough for a tty.
Then, after installing and configuring everything on the system, I had this<br>choice of reconfiguring everything in NVim from scratch. But, hell, I<br>didn't want to deal with lazy.nvim installation systems. It was a pain for me,<br>and I didn't like having a C++ LSP eating over 4gb of RAM. That was when I<br>finally decided that it is time to change. I installed Emacs.
Chapter 2: ELisp
Emacs is a highly customizable text editor that uses a custom interpreted config<br>language written in C called Emacs Lisp (Elisp). It is a well made language<br>with one of the best documentations I have seen so far (beside Rust :3). The<br>language is primarly used for configuring Emacs and changing/extending its<br>functionality, but can also be used as a general-purpose language.
For example for scripts:<br>#!/usr/bin/env -S emacs --script
Or to call Emacs directly with either -Q , --batch and/or --eval to evaluate<br>Elisp code from shell.
Before starting with the configuration I wanted to firstly teach the reader<br>basics of Elisp and its usage. Of course you are expected to know...