Emacs Version Control

Magit Magit is a complete text-based user interface to Git. It fills the glaring gap between the Git command-line interface and various GUIs, letting you perform trivial as well as elaborate version control tasks with just a couple of mnemonic key presses. Magit looks like a prettified version of what you get after running a few Git commands but in Magit every bit of visible information is also actionable to an extent that goes far beyond what any Git GUI provides and it takes care of automatically refreshing this output when it becomes outdated. In the background Magit just runs Git commands and if you wish you can see what exactly is being run, making it possible for you to learn the git command-line by using Magit1. ...

February 29, 2024 · (updated April 23, 2025) · 7 min · 1396 words · Kristian Alexander P

Emacs shell

Eshell It is a shell written in Emacs Lisp. Eshell is both a command shell and an Emacs Lisp REPL (Read Eval Print Loop), as a result, you can invoke commands in two different ways: command form or in Lisp form. As always, the official documentation provides you with more than enough information on Eshell. Figure 1: Eshell Command form Command form looks much the same as in other shells. A command consists of arguments separated by spaces; the first argument is the command to run, with any subsequent arguments being passed to that command. ...

February 28, 2024 · (updated April 23, 2025) · 2 min · 241 words · Kristian Alexander P

Theming Emacs

Why? Figure 1: Default Emacs UI For those who prefer a universal theme in their destop, the default Emacs interface is kind of ugly. Though there are built-in themes included, to be fair the options are limited. Figure 2: emacs wombat theme, one of the better ones Doom When I first tried Emacs, Doomemacs was my first choice. It’s kind of a “curated default configurations”. ...

February 27, 2024 · (updated April 23, 2025) · 2 min · 268 words · Kristian Alexander P

Emacs Evil

Evil is an extensible vi layer for Emacs. It emulates the main features of Vim, and provides facilities for writing custom extensions. Installing Add Melpa 1 2 (add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/")) Code Snippet 1: melpa with use-package 1 2 3 4 5 6 7 8 9 10 11 12 13 14 (use-package evil :ensure :preface (customize-set-variable 'evil-want-keybinding nil) ;; if using `evil-collection' (customize-set-variable 'evil-want-integration t) ;; if using `evil-collection' (customize-set-variable 'evil-undo-system 'undo-redo) (customize-set-variable 'evil-want-C-u-scroll t) ;; move universal arg to <leader> u (customize-set-variable 'evil-want-C-u-delete t) ;; delete back to indentation in insert state (customize-set-variable 'evil-want-C-g-bindings t) :config (evil-mode 1) ;; disable this when using `general.el' (evil-set-leader '(normal visual) (kbd "SPC")) (evil-set-leader '(normal visual) (kbd "C-c SPC") t)) Code Snippet 2: use-package without use-package 1 2 3 4 5 6 7 8 9 10 11 12 13 14 ;; Set up package.el to work with MELPA (require 'package) (add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/")) (package-initialize) (package-refresh-contents) ;; Download Evil (unless (package-installed-p 'evil) (package-install 'evil)) ;; Enable Evil (require 'evil) (evil-mode 1) Code Snippet 3: without use-package Configuration Leader and Localleader key This is inherited from vim1, So this isn’t really required, but as someone who use both vim and Emacs it certainly easier to memorize. ...

February 25, 2024 · (updated April 23, 2025) · 3 min · 500 words · Kristian Alexander P

Emacs general.el

About general.el provides a more convenient method for binding keys in emacs (for both evil and non-evil users). Like use-package, which provides a convenient, unified interface for managing packages, general.el is intended to provide a convenient, unified interface for key definitions. While this package does implement some completely new functionality (such as the ability to make vim-style keybindings under non-prefix keys with an optional timeout), its primary purpose is to build on existing functionality to make key definition more clear and concise. general-define-key is user-extensible and supports defining multiple keys in multiple keymaps at once, implicitly wrapping key strings with (kbd ...), using named prefix key sequences (like the leader key in vim), and much more1. ...

February 24, 2024 · (updated April 23, 2025) · 3 min · 612 words · Kristian Alexander P

Emacs sane defaults

Figure 1: Default Emacs The default Emacs is kinda boring and unintuitive, if you’re looking for a simple text editor, I really suggest other editors like nano, vim, or other graphical editors like gedit. The main advantage of using Emacs is that in can be more than just a text editor. Figure 2: Tetris inside Emacs I don’t think anybody ever want to play tetris inside Emacs, but it’s there! ...

February 23, 2024 · (updated April 23, 2025) · 5 min · 941 words · Kristian Alexander P

Emacs vertico

Vertico provides a performant and minimalistic vertical completion UI based on the default completion system. The focus of Vertico is to provide a UI which behaves correctly under all circumstances. By reusing the built-in facilities system, Vertico achieves full compatibility with built-in Emacs completion commands and completion tables. Vertico only provides the completion UI but aims to be highly flexible, extendable and modular. Additional enhancements are available as extensions or complementary packages. The code base is small and maintainable. The main vertico.el package is only about 600 lines of code without white space and comments1. ...

February 23, 2024 · (updated April 23, 2025) · 13 min · 2735 words · Kristian Alexander P

Emacs avy

This is a series of post about external Emacs packages that I use. Avy avy is a GNU Emacs package for jumping to visible text using a char-based decision tree. installing with use-package 1 2 3 4 5 6 7 (use-package avy :ensure ;; when `use-package-always-ensure' is nil :bind (("C-:" . avy-goto-char) ("C-'" . avy-goto-char2) ("M-g f" . avy-goto-line) ("M-g w" . avy-goto-word-1) ("M-g e" . avy-goto-word-0))) Notes: for evil user, theres a command evil-avy-goto*. for evil user 1 2 3 4 5 6 7 (use-package avy :after evil :ensure ;; when `use-package-always-ensure' is nil :bind (([remap goto-char] . evil-avy-goto-char) ([remap goto-line] . evil-avy-goto-line) ("M-g l" . evil-avy-goto-line)))

February 22, 2024 · (updated April 23, 2025) · 1 min · 108 words · Kristian Alexander P

Emacs package management with use-package

What is use-package anyway? Simply put, it’s a macro for easier package management within Emacs. I’ve used this for a while, and for me this is much more manageable than the default package declaration. How to use it? First we’ll need to activate it, from your Emacs init.el file: 1 (require 'use-package) And since we’ll mostly use this for external package, also add: 1 (setq use-package-always-ensure t) After that, use-package is ready to use. For example, installing which-key is simply by: ...

February 22, 2024 · (updated April 23, 2025) · 2 min · 265 words · Kristian Alexander P