Some code should be executing before tangling and evaluating this file. So, look at init.el
(setq use-package-compute-statistics 't)
(use-package files
:custom
(backup-directory-alist `(("." . "~/.emacs.d/backups")))
(backup-by-copying t))
Add 4 main package archives
(require 'package)
(add-to-list 'package-archives '("gnu" . "https://elpa.gnu.org/packages/") t)
(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/") t)
(add-to-list 'package-archives '("nongnu" . "https://elpa.nongnu.org/nongnu/") t)
Set priorites for package-archives
(setq package-archive-priorities
'(("gnu" . 40)
("nongnu" . 30)
("melpa" . 20)))
See layout.org file – link
(use-package reverse-im
:ensure t
:custom
(reverse-im-input-methods '("cyrillic-colemak"))
(reverse-im-cache-file "~/.emacs.d/reverse-im-cache.el")
:pin melpa)
If frame is devided by top and bottom, change it to left and right. Transpose operation like with matrices and tables.
(use-package transpose-frame :ensure t)
Enable tab-bar-mode
(tab-bar-mode)
Press C-M-i to activate emacs autocomplete.
Frankly speaking, I copy this snippet from the official vertico docs:
https://github.com/minad/vertico?tab=readme-ov-file#completion-at-point-and-completion-in-region
This configuration give my ability to perform fuzzy search. Like with dmenu, rofi or fzf, but in emacs.
(use-package vertico
:init (vertico-mode)
(setq completion-in-region-function
(lambda (&rest args)
(apply (if vertico-mode
#'consult-completion-in-region
#'completion--in-region)
args)))
:ensure t)
(use-package consult :ensure t)
(use-package consult-eglot :commands (eglot) :ensure t)
This should be executed before loading this file, so this forms also present in init.el.
(defvar *fs-encoding* 'utf-8)
(prefer-coding-system 'utf-8-unix)
Load both in graphical and terminal mode.
(use-package modus-themes :ensure t)
(load-theme 'modus-operandi)
(enable-theme 'modus-operandi)
(setopt icon-map-list nil)
(reverse-im-mode)
(which-key-mode)
I structured my config by use cases I apply emacs in.
I use build in dired for now.
Copy, move, rename files across panes, like two-panel file manager
(setq dired-dwim-target t)
(use-package magit :commands (magit) :ensure t)
(use-package git-modes :ensure t)
(use-package howm
:custom
(howm-search-other-dir t)
:ensure t)
(when (not (eq system-type 'windows-nt))
(setq howm-view-use-grep t))
Function to add prop-line, so I can use howm with any other major mode, with org-mode for examlpe
(defun howm-insert-prop-line (mode)
"Activate major mode and modify the file so that this mode is activated
automatically the next time it is opened"
(interactive (list (intern-soft
(completing-read "Choose major mode: "
(mapcar #'cdr auto-mode-alist)))))
(howm-mode)
(unless (or (null mode)
(eq mode major-mode))
(funcall mode)
(howm-mode)
(add-file-local-variable-prop-line
'mode (intern (string-trim-right (symbol-name mode) "-mode\\'")))))
(use-package ispell
:commands (ispell ispell-region ispell-word)
:config
(ispell-set-spellchecker-params)
(ispell-hunspell-add-multi-dic "en_US,ru_RU,be_BY")
:custom
(ispell-program-name "hunspell")
(ispell-dictionary "en_US,ru_RU,be_BY")
(ispell-personal-dictionary "~/howm/.hunspell_personal"))
(org-babel-do-load-languages
'org-babel-load-languages
'((C . t)
(shell . t)
(lisp . t)
(emacs-lisp . t)
(python . t)
(dot . t)
(plantuml . t)))
Installed plantuml from openSUSE package manager.
(setq org-plantuml-exec-mode 'plantuml)
Even with all of org-drill bugs I like it much more than Anki -[2024-12-12]
(use-package org-drill
:pin melpa
:ensure t)
(defun my-org-drill-file-names-in-howm ()
"Return list of absolute filenames of org-drill files in howm"
(delete-dups
(mapcar #'car (howm-grep "\:drill\:"
(howm-files-in-directory howm-directory)))))
(defun my-org-drill-set-scope ()
(interactive)
(let ((scope-var
(completing-read "Choose scope for org-drill: " (list
"howm"
"file"
"tree"
"file-no-restriction"
"agenda"
"agenda-with-archives"
"directory"))))
(if (equal scope-var "howm")
(setq org-drill-scope (my-org-drill-file-names-in-howm))
(setq org-drill-scope (intern scope-var)))))
(define-advice org-drill (:before (&rest _args))
(my-org-drill-set-scope))
(define-advice org-drill-cram (:before (&rest _args))
(my-org-drill-set-scope))
(defun org-drill-time-to-inactive-org-timestamp (time)
"Convert TIME into org-mode timestamp."
(format-time-string
(concat "[" (cdr org-time-stamp-formats) "]")
time))
NGMI is «not gonna make it», but not in the sense of a meme. Here, it means that I have one reason or another for not doing this task.
(setq org-todo-keywords
'((sequence "TODO" "|" "DONE" "FAIL" "NGMI" )))
[2025-06-04] I decided to stick to university-like schedule.
(use-package org-pomodoro
:custom
(org-pomodoro-keep-killed-pomodoro-time 't)
(org-pomodoro-length 80)
(org-pomodoro-short-break-length 15)
(org-pomodoro-long-break-length 35)
:ensure t)
(use-package org-pomodoro-third-time
:vc (:url "[email protected]:telotortium/org-pomodoro-third-time.git")
:ensure t)
Use C locale for time. Needed for org-pomodoro on windows.
(setq system-time-locale "C")
(use-package auctex :ensure t)
I write my coursework in xelatex.
(setq-default TeX-engine 'xetex)
From auctex info:
(setq TeX-auto-save t)
(setq TeX-parse-self t)
(setq-default TeX-master nil)
Quick and dirty way to make emacs use right python executable:
https://fredrikmeyer.net/2020/08/26/emacs-python-venv.html
(use-package pyvenv
:ensure t
:commands (pyvenv-activate pyvenv-workon)
:config
;; Set correct Python interpreter on Windows
(when (eq system-type 'windows-nt)
(setq pyvenv-post-activate-hooks
(list (lambda ()
(setq python-shell-interpreter (concat pyvenv-virtual-env "Scripts/python.exe")))))
(setq pyvenv-post-deactivate-hooks
(list (lambda ()
(setq python-shell-interpreter "python.exe"))))))
(use-package pydoc :ensure t)
(use-package slime :commands (slime) :ensure t)
(setq inferior-lisp-program "sbcl")
(use-package editorconfig :ensure t)
Compiler explorer
(use-package rmsbolt :ensure t)
Assembly
(use-package nasm-mode :ensure t)
Systemd units
(use-package systemd :ensure t)
Comma separated values
(use-package csv :ensure t)
(use-package yaml-mode :ensure t)
(use-package docker-compose-mode :ensure t)
Ansible differs from just YAML in the fact that it uses jinja style substituion for variables.
(use-package ansible :ensure t)
(use-package prometheus-mode :ensure t)
(use-package nginx-mode :ensure t)
(use-package terraform-mode :ensure t
:config
(defun my-terraform-mode-init ()
(outline-minor-mode 1))
(add-hook 'terraform-mode-hook 'my-terraform-mode-init))
(use-package dockerfile-mode :ensure t)
(use-package eat
:config
(setq eat-kill-buffer-on-exit t)
(setq eat-enable-mouse t)
:ensure t)
Elfeed in my config is interconneted with howm.
(use-package elfeed
:ensure t
:config
(setq elfeed-db-directory "~/howm/.elfeed")
(setq elfeed-curl-program-name "curl"))
(use-package elfeed-protocol)
(use-package elfeed-org
:ensure t
:config
(elfeed-org)
:after howm)
(defun my-elfeed-file-names-in-howm ()
"Return list of absolute filenames of org-elfeed files in howm"
(delete-dups
(mapcar #'car (howm-grep "\:elfeed\:"
(howm-files-in-directory howm-directory)))))
(define-advice elfeed (:before (&rest _args))
(setq rmh-elfeed-org-files (my-elfeed-file-names-in-howm)))
(define-advice elfeed-update (:before (&rest _args))
(setq rmh-elfeed-org-files (my-elfeed-file-names-in-howm)))
(use-package rfc-mode
:custom (rfc-mode-directory
(expand-file-name "~/Downloads/RFC-all"))
:ensure t)