2017-11-12 19:46:14 +01:00
|
|
|
;;; init.el --- Package bootstrapping. -*- lexical-binding: t; -*-
|
|
|
|
|
2021-11-13 21:46:41 +01:00
|
|
|
;; Disable annoying warnings from native compilation.
|
|
|
|
(setq native-comp-async-report-warnings-errors nil
|
|
|
|
warning-suppress-log-types '((comp)))
|
|
|
|
|
2018-03-04 00:14:13 +01:00
|
|
|
;; Packages are installed via Nix configuration, this file only
|
|
|
|
;; initialises the newly loaded packages.
|
2017-11-12 19:46:14 +01:00
|
|
|
|
2018-06-22 10:29:31 +02:00
|
|
|
(require 'use-package)
|
2017-11-12 19:46:14 +01:00
|
|
|
(require 'seq)
|
2013-07-08 01:15:05 +02:00
|
|
|
|
2017-11-12 20:24:21 +01:00
|
|
|
(package-initialize)
|
2013-07-08 01:15:05 +02:00
|
|
|
|
2018-06-22 10:29:31 +02:00
|
|
|
;; Initialise all packages installed via Nix.
|
|
|
|
|
|
|
|
(use-package ace-window
|
|
|
|
:bind (("C-x o" . ace-window))
|
2019-12-15 23:15:11 +01:00
|
|
|
:config
|
2018-11-13 15:35:37 +01:00
|
|
|
(setq aw-keys '(?f ?j ?d ?k ?s ?l ?a)
|
|
|
|
aw-scope 'frame))
|
2018-06-22 10:29:31 +02:00
|
|
|
|
2019-12-15 23:15:11 +01:00
|
|
|
(use-package auth-source-pass :config (auth-source-pass-enable))
|
2018-06-22 10:29:31 +02:00
|
|
|
|
|
|
|
(use-package avy
|
|
|
|
:bind (("M-j" . avy-goto-char)
|
|
|
|
("M-p" . avy-pop-mark)
|
|
|
|
("M-g g" . avy-goto-line)))
|
|
|
|
|
|
|
|
(use-package browse-kill-ring)
|
|
|
|
|
refactor(tazjin/emacs): ivy,swiper,counsel -> vertico,consult
vertico and consult are more modern versions of interactive narrowing
helpers, as those implemented by ivy and its related packages.
The primary differences (and what I care about here) is that they are
more focused on integration with the core Emacs primitives, rather
than building an ecosystem around them.
For example:
* vertico enhances `completing-read' and friends, but does not attempt
to provide its own ecosystem of functions to *trigger* completions.
* vertico integrates with the default `completion-style' system,
meaning that I can continue to use things like prescient without
extra packages that integrate it with vertico
* consult does not rely on vertico or any other specific completion
framework (such as counsel/swiper do with ivy), and simply
implements its functions using completing-read
This reduces the overall amount of code in the dependency closure and
leads to a less special setup.
Functionality is basically equivalent, except for two things which
counsel came with that I will need to substitute:
* counsel-notmuch (actually this was a separate package, but I didn't
use it much anyways, so just ignoring it for now)
* counsel-linux-app (opening desktop shortcuts, this I will need to make)
As a side note, consult notes "This package is a part of GNU Emacs",
but it doesn't seem to be the case.
Change-Id: Ia046b763bf3d401b505e0f6393cfe1ccd6f41293
Reviewed-on: https://cl.tvl.fyi/c/depot/+/9155
Tested-by: BuildkiteCI
Reviewed-by: tazjin <tazjin@tvl.su>
2023-08-27 00:12:29 +02:00
|
|
|
(use-package consult
|
|
|
|
:bind
|
|
|
|
("C-c r g" . consult-ripgrep)
|
|
|
|
("C-s" . consult-line))
|
2019-12-17 12:46:41 +01:00
|
|
|
|
2018-06-22 10:29:31 +02:00
|
|
|
(use-package dash)
|
|
|
|
(use-package gruber-darker-theme)
|
2020-05-19 15:23:59 +02:00
|
|
|
|
|
|
|
(use-package eglot
|
|
|
|
:custom
|
|
|
|
(eglot-autoshutdown t)
|
|
|
|
(eglot-send-changes-idle-time 0.3))
|
|
|
|
|
2018-06-22 10:29:31 +02:00
|
|
|
(use-package ht)
|
2020-05-26 02:49:19 +02:00
|
|
|
|
2018-06-22 10:29:31 +02:00
|
|
|
(use-package hydra)
|
|
|
|
(use-package idle-highlight-mode :hook ((prog-mode . idle-highlight-mode)))
|
2019-12-17 12:46:41 +01:00
|
|
|
|
|
|
|
(use-package multiple-cursors)
|
|
|
|
|
2019-12-23 16:05:05 +01:00
|
|
|
(use-package notmuch
|
2021-03-19 21:16:24 +01:00
|
|
|
:custom
|
|
|
|
(notmuch-search-oldest-first nil)
|
|
|
|
(notmuch-show-all-tags-list t)
|
|
|
|
(notmuch-hello-tag-list-make-query "tag:unread"))
|
2019-12-23 16:05:05 +01:00
|
|
|
|
2018-06-28 11:01:54 +02:00
|
|
|
(use-package paredit :hook ((lisp-mode . paredit-mode)
|
|
|
|
(emacs-lisp-mode . paredit-mode)))
|
2019-12-17 12:46:41 +01:00
|
|
|
|
2018-06-22 10:29:31 +02:00
|
|
|
(use-package pinentry
|
2019-12-15 23:15:11 +01:00
|
|
|
:config
|
2018-06-22 10:29:31 +02:00
|
|
|
(setq epa-pinentry-mode 'loopback)
|
|
|
|
(pinentry-start))
|
|
|
|
|
2019-12-17 12:46:41 +01:00
|
|
|
(use-package prescient
|
refactor(tazjin/emacs): ivy,swiper,counsel -> vertico,consult
vertico and consult are more modern versions of interactive narrowing
helpers, as those implemented by ivy and its related packages.
The primary differences (and what I care about here) is that they are
more focused on integration with the core Emacs primitives, rather
than building an ecosystem around them.
For example:
* vertico enhances `completing-read' and friends, but does not attempt
to provide its own ecosystem of functions to *trigger* completions.
* vertico integrates with the default `completion-style' system,
meaning that I can continue to use things like prescient without
extra packages that integrate it with vertico
* consult does not rely on vertico or any other specific completion
framework (such as counsel/swiper do with ivy), and simply
implements its functions using completing-read
This reduces the overall amount of code in the dependency closure and
leads to a less special setup.
Functionality is basically equivalent, except for two things which
counsel came with that I will need to substitute:
* counsel-notmuch (actually this was a separate package, but I didn't
use it much anyways, so just ignoring it for now)
* counsel-linux-app (opening desktop shortcuts, this I will need to make)
As a side note, consult notes "This package is a part of GNU Emacs",
but it doesn't seem to be the case.
Change-Id: Ia046b763bf3d401b505e0f6393cfe1ccd6f41293
Reviewed-on: https://cl.tvl.fyi/c/depot/+/9155
Tested-by: BuildkiteCI
Reviewed-by: tazjin <tazjin@tvl.su>
2023-08-27 00:12:29 +02:00
|
|
|
:config
|
|
|
|
(prescient-persist-mode)
|
|
|
|
(setq completion-styles '(basic prescient)))
|
2019-12-17 12:46:41 +01:00
|
|
|
|
2022-03-06 12:53:36 +01:00
|
|
|
(use-package rainbow-delimiters :hook (prog-mode . rainbow-delimiters-mode))
|
2018-06-22 10:29:31 +02:00
|
|
|
(use-package rainbow-mode)
|
|
|
|
(use-package s)
|
2022-11-18 15:01:41 +01:00
|
|
|
(use-package string-edit-at-point)
|
2019-12-15 23:54:40 +01:00
|
|
|
(use-package term-switcher)
|
2022-04-24 14:02:34 +02:00
|
|
|
|
|
|
|
(use-package undo-tree
|
|
|
|
:config (global-undo-tree-mode)
|
|
|
|
:custom (undo-tree-auto-save-history nil))
|
|
|
|
|
2018-06-22 10:29:31 +02:00
|
|
|
(use-package uuidgen)
|
2019-12-15 23:15:11 +01:00
|
|
|
(use-package which-key :config (which-key-mode t))
|
2018-06-22 10:29:31 +02:00
|
|
|
|
|
|
|
;;
|
|
|
|
;; Applications in emacs
|
|
|
|
;;
|
|
|
|
|
|
|
|
(use-package magit
|
|
|
|
:bind ("C-c g" . magit-status)
|
2019-12-16 11:04:46 +01:00
|
|
|
:config (setq magit-repository-directories '(("/home/tazjin/projects" . 2)
|
2019-12-17 12:47:30 +01:00
|
|
|
("/home/tazjin" . 1))))
|
2018-06-22 10:29:31 +02:00
|
|
|
|
|
|
|
(use-package password-store)
|
|
|
|
(use-package restclient)
|
|
|
|
|
2019-12-16 04:49:07 +01:00
|
|
|
(use-package vterm
|
2023-08-26 15:22:08 +02:00
|
|
|
:custom
|
|
|
|
(vterm-shell "fish")
|
|
|
|
(vterm-kill-buffer-on-exit t))
|
2020-08-26 12:47:23 +02:00
|
|
|
|
|
|
|
;; vterm removed the ability to set a custom title generator function
|
|
|
|
;; via the public API, so this overrides its private title generation
|
|
|
|
;; function instead
|
|
|
|
(defun vterm--set-title (title)
|
|
|
|
(rename-buffer
|
|
|
|
(generate-new-buffer-name
|
|
|
|
(format "vterm<%s>"
|
|
|
|
(s-trim-left
|
|
|
|
(s-chop-prefix "fish" title))))))
|
2019-12-16 04:49:07 +01:00
|
|
|
|
2018-06-22 10:29:31 +02:00
|
|
|
;;
|
|
|
|
;; Packages providing language-specific functionality
|
|
|
|
;;
|
|
|
|
|
2018-09-02 18:14:12 +02:00
|
|
|
(use-package cargo
|
|
|
|
:hook ((rust-mode . cargo-minor-mode)
|
|
|
|
(cargo-process-mode . visual-line-mode))
|
2021-10-19 14:58:26 +02:00
|
|
|
:bind (:map cargo-mode-map ("C-c C-c C-l" . ignore)))
|
2018-06-22 10:29:31 +02:00
|
|
|
|
2023-09-12 17:56:57 +02:00
|
|
|
(use-package dockerfile-ts-mode)
|
2018-06-22 10:29:31 +02:00
|
|
|
|
|
|
|
(use-package erlang
|
|
|
|
:hook ((erlang-mode . (lambda ()
|
|
|
|
;; Don't indent after '>' while I'm writing
|
|
|
|
(local-set-key ">" 'self-insert-command)))))
|
|
|
|
|
2019-12-14 14:35:03 +01:00
|
|
|
(use-package f)
|
|
|
|
|
2019-12-14 14:23:20 +01:00
|
|
|
(use-package go-mode
|
2019-12-14 16:59:20 +01:00
|
|
|
:bind (:map go-mode-map ("C-c C-r" . recompile))
|
2019-12-14 14:23:20 +01:00
|
|
|
:hook ((go-mode . (lambda ()
|
|
|
|
(setq tab-width 2)
|
|
|
|
(setq-local compile-command
|
|
|
|
(concat "go build " buffer-file-name))))))
|
|
|
|
|
2018-06-22 10:29:31 +02:00
|
|
|
(use-package haskell-mode)
|
|
|
|
|
2020-01-17 17:52:17 +01:00
|
|
|
(use-package ielm
|
|
|
|
:hook ((inferior-emacs-lisp-mode . (lambda ()
|
2023-11-30 19:20:14 +01:00
|
|
|
(rainbow-delimiters-mode-enable)))))
|
2020-01-17 17:52:17 +01:00
|
|
|
|
2018-06-22 10:29:31 +02:00
|
|
|
(use-package jq-mode
|
2019-12-15 23:15:11 +01:00
|
|
|
:config (add-to-list 'auto-mode-alist '("\\.jq\\'" . jq-mode)))
|
2018-06-22 10:29:31 +02:00
|
|
|
|
2018-10-12 19:11:43 +02:00
|
|
|
(use-package kotlin-mode
|
2019-12-14 16:59:20 +01:00
|
|
|
:hook ((kotlin-mode . (lambda ()
|
|
|
|
(setq indent-line-function #'indent-relative)))))
|
2018-06-22 10:29:31 +02:00
|
|
|
|
|
|
|
(use-package markdown-mode
|
2019-12-15 23:15:11 +01:00
|
|
|
:config
|
2018-06-22 10:29:31 +02:00
|
|
|
(add-to-list 'auto-mode-alist '("\\.markdown\\'" . markdown-mode))
|
|
|
|
(add-to-list 'auto-mode-alist '("\\.md\\'" . markdown-mode)))
|
|
|
|
|
|
|
|
(use-package markdown-toc)
|
2018-10-28 23:39:58 +01:00
|
|
|
|
|
|
|
(use-package nix-mode
|
2019-12-14 16:59:20 +01:00
|
|
|
:hook ((nix-mode . (lambda ()
|
|
|
|
(setq indent-line-function #'nix-indent-line)))))
|
2018-10-28 23:39:58 +01:00
|
|
|
|
2019-12-19 15:22:33 +01:00
|
|
|
(use-package nix-util)
|
2018-06-22 10:29:31 +02:00
|
|
|
(use-package nginx-mode)
|
|
|
|
(use-package rust-mode)
|
2019-12-19 16:19:24 +01:00
|
|
|
|
2020-01-15 11:42:19 +01:00
|
|
|
(use-package sly
|
|
|
|
:hook ((sly-mrepl-mode . (lambda ()
|
|
|
|
(paredit-mode)
|
2023-11-30 19:20:14 +01:00
|
|
|
(rainbow-delimiters-mode-enable))))
|
2020-01-15 11:42:19 +01:00
|
|
|
:config
|
|
|
|
(setq common-lisp-hyperspec-root "file:///home/tazjin/docs/lisp/"))
|
|
|
|
|
2019-12-19 16:19:24 +01:00
|
|
|
(use-package telega
|
2023-11-25 00:29:24 +01:00
|
|
|
:bind (:map global-map ("s-c" . (lambda (p) (interactive "P")
|
2023-09-27 12:53:25 +02:00
|
|
|
(if p (call-interactively #'telega-chat-with)
|
|
|
|
(telega))))
|
2023-08-07 13:33:54 +02:00
|
|
|
:map telega-chat-button-map ("a" . ignore))
|
2023-06-30 15:06:33 +02:00
|
|
|
:config (telega-mode-line-mode 1)
|
2023-09-27 12:35:09 +02:00
|
|
|
:custom
|
|
|
|
(telega-emoji-use-images nil)
|
2023-11-30 19:20:14 +01:00
|
|
|
(telega-completing-read-function #'completing-read))
|
2019-12-19 16:19:24 +01:00
|
|
|
|
2018-06-22 10:29:31 +02:00
|
|
|
(use-package terraform-mode)
|
2023-09-12 17:56:57 +02:00
|
|
|
(use-package toml-ts-mode)
|
2020-06-19 17:57:16 +02:00
|
|
|
|
2024-03-09 12:55:25 +01:00
|
|
|
(use-package treecrumbs
|
|
|
|
:hook ((yaml-ts-mode . treecrumbs-mode)))
|
|
|
|
|
2021-12-09 11:24:06 +01:00
|
|
|
(use-package tvl)
|
2020-06-19 17:57:16 +02:00
|
|
|
|
refactor(tazjin/emacs): ivy,swiper,counsel -> vertico,consult
vertico and consult are more modern versions of interactive narrowing
helpers, as those implemented by ivy and its related packages.
The primary differences (and what I care about here) is that they are
more focused on integration with the core Emacs primitives, rather
than building an ecosystem around them.
For example:
* vertico enhances `completing-read' and friends, but does not attempt
to provide its own ecosystem of functions to *trigger* completions.
* vertico integrates with the default `completion-style' system,
meaning that I can continue to use things like prescient without
extra packages that integrate it with vertico
* consult does not rely on vertico or any other specific completion
framework (such as counsel/swiper do with ivy), and simply
implements its functions using completing-read
This reduces the overall amount of code in the dependency closure and
leads to a less special setup.
Functionality is basically equivalent, except for two things which
counsel came with that I will need to substitute:
* counsel-notmuch (actually this was a separate package, but I didn't
use it much anyways, so just ignoring it for now)
* counsel-linux-app (opening desktop shortcuts, this I will need to make)
As a side note, consult notes "This package is a part of GNU Emacs",
but it doesn't seem to be the case.
Change-Id: Ia046b763bf3d401b505e0f6393cfe1ccd6f41293
Reviewed-on: https://cl.tvl.fyi/c/depot/+/9155
Tested-by: BuildkiteCI
Reviewed-by: tazjin <tazjin@tvl.su>
2023-08-27 00:12:29 +02:00
|
|
|
(use-package vertico
|
|
|
|
:config
|
|
|
|
(vertico-mode))
|
|
|
|
|
2018-06-22 10:29:31 +02:00
|
|
|
(use-package web-mode)
|
2023-09-12 17:56:57 +02:00
|
|
|
(use-package yaml-ts-mode)
|
2021-12-20 09:45:45 +01:00
|
|
|
(use-package zoxide)
|
2018-06-22 10:29:31 +02:00
|
|
|
|
2021-12-06 00:14:35 +01:00
|
|
|
(use-package passively
|
|
|
|
:custom
|
|
|
|
(passively-store-state "/persist/tazjin/known-russian-words.el"))
|
|
|
|
|
2022-05-23 19:49:31 +02:00
|
|
|
;; Note taking configuration for deft.
|
|
|
|
(use-package deft
|
|
|
|
:custom
|
|
|
|
(deft-directory "/persist/tazjin/deft/")
|
|
|
|
(deft-extensions '("md" "org" "txt"))
|
|
|
|
(deft-default-extension "md"))
|
|
|
|
|
|
|
|
(use-package zetteldeft
|
|
|
|
:custom
|
|
|
|
;; Configure for Markdown
|
|
|
|
(zetteldeft-link-indicator "[[")
|
|
|
|
(zetteldeft-link-suffix "]]")
|
|
|
|
(zetteldeft-title-prefix "# ")
|
|
|
|
(zetteldeft-list-prefix "* "))
|
|
|
|
|
2020-11-23 00:21:22 +01:00
|
|
|
;; Initialise midnight.el, which by default automatically cleans up
|
|
|
|
;; unused buffers at midnight.
|
|
|
|
(require 'midnight)
|
|
|
|
|
2020-06-11 19:33:02 +02:00
|
|
|
(defgroup tazjin nil
|
|
|
|
"Settings related to my configuration")
|
|
|
|
|
|
|
|
(defcustom depot-path "/depot"
|
|
|
|
"Local path to the depot checkout"
|
|
|
|
:group 'tazjin)
|
|
|
|
|
2019-12-14 16:38:03 +01:00
|
|
|
;; Configuration changes in `customize` can not actually be persisted
|
|
|
|
;; to the customise file that Emacs is currently using (since it comes
|
|
|
|
;; from the Nix store).
|
|
|
|
;;
|
|
|
|
;; The way this will work for now is that Emacs will *write*
|
|
|
|
;; configuration to the file tracked in my repository, while not
|
|
|
|
;; actually *reading* it from there (unless Emacs is rebuilt).
|
2023-07-14 17:21:46 +02:00
|
|
|
(setq custom-file (f-join depot-path "users" "tazjin" "emacs" "config" "custom.el"))
|
2019-12-14 18:15:18 +01:00
|
|
|
(load-library "custom")
|
2013-07-08 01:15:05 +02:00
|
|
|
|
2018-06-28 11:02:24 +02:00
|
|
|
(defvar home-dir (expand-file-name "~"))
|
2013-08-05 11:54:38 +02:00
|
|
|
|
2013-07-08 01:15:05 +02:00
|
|
|
;; Seed RNG
|
|
|
|
(random t)
|
|
|
|
|
2019-12-14 16:24:53 +01:00
|
|
|
;; Load all other Emacs configuration. These configurations are
|
|
|
|
;; added to `load-path' by Nix.
|
|
|
|
(mapc 'require '(desktop
|
|
|
|
mail-setup
|
|
|
|
look-and-feel
|
|
|
|
functions
|
|
|
|
settings
|
|
|
|
bindings
|
|
|
|
eshell-setup))
|
|
|
|
(ace-window-display-mode)
|
|
|
|
|
2019-12-16 14:33:29 +01:00
|
|
|
;; If a local configuration library exists, it should be loaded.
|
|
|
|
;;
|
|
|
|
;; This can be provided by calling my Emacs derivation with
|
|
|
|
;; `withLocalConfig'.
|
|
|
|
(if-let (local-file (locate-library "local"))
|
|
|
|
(load local-file))
|
2018-11-13 15:35:37 +01:00
|
|
|
|
2020-11-30 17:39:26 +01:00
|
|
|
(require 'dottime)
|
|
|
|
|
2019-12-14 16:24:53 +01:00
|
|
|
(provide 'init)
|