Emacs Notes

Contents

Install the latest emacs on Ubuntu

Run emacs on Windows

Movement:

Other common controls

Repeat last command

Set font

Set up the package manager

(require 'package)
(let* ((no-ssl (and (memq system-type '(windows-nt ms-dos))
        (not (gnutls-available-p))))
       (proto (if no-ssl "http" "https")))
  (add-to-list 'package-archives (cons "melpa" (concat proto "://melpa.org/packages/")) t))
(package-initialize)

My Emacs packages

Better buffer navigation with ibuffer

Disable the bell

Smooth scrolling

Disable the startup message

Set the mode of the scratch buffer

Set the scratch buffer message to blank

Disable scroll bars

Disable menu bar

Disable tool bar

Show column numbers

Enable display of parentheses

Set up the vscode-dark-plus theme

Projectile notes

Choose which browser emacs uses on a per-website basis

Enable auto-revert of files

Spacemacs Notes

Switch to the emacs editing style

Make spacemacs use fd for projectile indexing:

Remove a project from Projectile

Fix Spacemacs Markdown-mode

Remove current line highlight

Remove the prompt to install layers

Use spacemacs as the git editor

Markdown Mode

Fix Markdown-mode fixed pitch font

(set-face-attribute 'fixed-pitch nil :family 'unspecified)

Markdown toggle checkboxes

Markdown insert new list item

Configure Kotlin mode to use the kotlin language server

Associate markdown with text-mode

Disable the fd escape keyboard shortcut in Evil mode

Fix random hangs

Improve performance with long lines

Spacemacs pomodoro

Copy from terminal

Configure which browser org-mode uses when you select a link

Org-mode notes

Org change list type

Promote/demote heading/list item

Open link

Lists

Disable automatic indentation

Disable blank lines between plain list items

Prevent org-mode from truncating

Set everything to be visible by default

Code blocks

Convert to markdown

Org-markdown (ox-md) exporter issue

Convert to HTML

Convert to PMWiki

Insert structure template

Edit structure template

Add checkboxes to a simple list

Don't fold subtrees when yanking

(setq org-yank-folded-subtrees nil)

Convert a plain list into a heading

Sort headings

Fix org-mode indentation

Better org-mode formatting

Escape formatting marks

Add a newline without indenting

Task Management

Building org-mode

Set the cursor color

Set the background color of highlighted text

Make Cascadia Code Italics work properly on Linux

Disable backup and autosave files

(setq make-backup-files nil)
(setq auto-save-default nil)
(setq create-lockfiles nil)

Magit

Insert spaces instead of tabs

Better Text editing

(add-hook 'text-mode-hook
  '(lambda ()
     (setq indent-tabs-mode nil)
     (setq tab-width 4)
     (setq indent-line-function 'insert-tab)
     (electric-indent-mode -1)))

Windows

Replace string inside hidden variables

Set frame title to buffer title

(setq frame-title-format "%b")

Sensible buffer titles

(setq uniquify-buffer-name-style 'forward)

Disable C-z

Display date and time in the mode line

Prevent the transfer of text properties when yanking

Make emacs work like other text editors when it comes to highlighted test

Delete all lines that match or don't match a regex

Pretty-print XML

Calc

Make auto-fill-mode behave better

Indent to tab stop

Force update of version control info for current buffer

Remove version control info from the mode line

Save all files without prompting

Fringe settings

Find out which keys are bound to a command

Better promotion and demotion keyboard shortcuts

Paredit

Load a file

Reduce GC pauses

Make emacs use UTF-8 by default

Set the home directory correctly

Toggle a buffer as read-only

Lisp Evaluation

List all lines matching a regular expression

URL Decode

Make dired kill buffers associated with deleted files

(with-eval-after-load 'dired
  (require 'dired-x)
  (setq dired-x-hands-off-my-keys nil)
  (setq dired-clean-up-buffers t))

Emacs built-in version control

Emacs built-in project management

Adding and removing projects

Project commands operating on files

Project commands operating on buffers

Language Server

Minimal emacs config for new machines

(global-unset-key (kbd "C-z"))
(global-unset-key (kbd "C-x C-z"))
(prefer-coding-system 'utf-8)
(require 'pacakge)
(let* ((no-ssl (and (memq system-type '(windows-nt ms-dos))
                    (not (gnutls-available-p))))
       (proto (if no-ssl "http" "https")))
  (add-to-list 'package-archives (cons "melpa" (concat proto "://melpa.org/packages/")) t))
(package-initialize)
(setq frame-resize-pixelwise t)
(set-face-attribute 'default nil :font "Cascadia Code PL-12")
(set-face-attribute 'fixed-pitch nil :family 'unspecified)
(setq ring-bell-function 'ignore)
(setq scroll-conservatively 9999)
(setq inhibit-startup-message t)
(setq initial-major-mode 'text-mode)
(setq-default initial-scratch-message "")
(setq-default indent-tabs-mode nil)
(scroll-bar-mode -1)
(menu-bar-mode -1)
(tool-bar-mode -1)
(column-number-mode 1)
(show-paren-mode 1)
(delete-selection-mode 1)
(setq make-backup-files nil)
(setq auto-save-default nil)
(setq create-lockfiles nil)
(global-auto-revert-mode 1)

Magit error