2017-11-12 19:46:14 +01:00
|
|
|
;;; init.el --- Package bootstrapping. -*- lexical-binding: t; -*-
|
|
|
|
|
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
|
|
|
;; Add 'init' folder that contains other settings to load.
|
|
|
|
(add-to-list 'load-path (concat user-emacs-directory "init"))
|
|
|
|
|
|
|
|
;; Initialise all packages installed via Nix.
|
|
|
|
;;
|
|
|
|
;; TODO: Generate this section in Nix for all packages that do not
|
|
|
|
;; require special configuration.
|
|
|
|
|
|
|
|
;;
|
|
|
|
;; Packages providing generic functionality.
|
|
|
|
;;
|
|
|
|
|
|
|
|
(use-package ace-window
|
|
|
|
:bind (("C-x o" . ace-window))
|
|
|
|
:init
|
|
|
|
(progn (setq aw-keys '(?f ?j ?d ?k ?s ?l ?a)
|
|
|
|
aw-scope 'frame)
|
|
|
|
;; Show previews of ace-window numbers in the mode line for each window.
|
|
|
|
(ace-window-display-mode)))
|
|
|
|
|
2018-06-28 11:01:54 +02:00
|
|
|
(use-package adjust-parens :hook ((lisp-mode . adjust-parens-mode)
|
|
|
|
(emacs-lisp-mode . adjust-parens-mode)))
|
2018-06-22 10:29:31 +02:00
|
|
|
(use-package auth-source-pass :init (auth-source-pass-enable))
|
|
|
|
|
|
|
|
(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)
|
|
|
|
|
|
|
|
(use-package company
|
|
|
|
:hook ((prog-mode . company-mode))
|
|
|
|
:bind (:map rust-mode-map ("<tab>" . company-indent-or-complete-common)
|
|
|
|
:map lisp-mode-map ("<tab>" . company-indent-or-complete-common))
|
|
|
|
:init (setq company-tooltip-align-annotations t))
|
|
|
|
|
|
|
|
(use-package dash)
|
|
|
|
(use-package dash-functional)
|
|
|
|
(use-package edit-server :init (edit-server-start))
|
|
|
|
(use-package gruber-darker-theme)
|
|
|
|
(use-package ht)
|
|
|
|
(use-package hydra)
|
|
|
|
(use-package idle-highlight-mode :hook ((prog-mode . idle-highlight-mode)))
|
2018-06-28 11:01:54 +02:00
|
|
|
(use-package paredit :hook ((lisp-mode . paredit-mode)
|
|
|
|
(emacs-lisp-mode . paredit-mode)))
|
2018-06-22 10:29:31 +02:00
|
|
|
(use-package multiple-cursors)
|
|
|
|
(use-package pinentry
|
|
|
|
:init
|
|
|
|
(setq epa-pinentry-mode 'loopback)
|
|
|
|
(pinentry-start))
|
|
|
|
|
|
|
|
(use-package rainbow-delimiters :hook (prog-mode . rainbow-delimiters-mode))
|
|
|
|
(use-package rainbow-mode)
|
|
|
|
(use-package s)
|
|
|
|
(use-package smartparens :init (smartparens-global-mode))
|
|
|
|
(use-package string-edit)
|
2018-06-28 11:02:24 +02:00
|
|
|
(use-package telephone-line) ;; configuration happens outside of use-package
|
2018-06-22 10:29:31 +02:00
|
|
|
(use-package undo-tree :init (global-undo-tree-mode))
|
|
|
|
(use-package uuidgen)
|
|
|
|
(use-package which-key :init (which-key-mode t))
|
|
|
|
|
|
|
|
;;
|
|
|
|
;; Applications in emacs
|
|
|
|
;;
|
|
|
|
|
|
|
|
(use-package magit
|
|
|
|
:bind ("C-c g" . magit-status)
|
|
|
|
:init (setq magit-repository-directories '(("/home/vincent/projects" . 2))))
|
|
|
|
|
2018-06-28 11:02:40 +02:00
|
|
|
;; (use-package multi-term
|
|
|
|
;; :bind ("C-x t" . counsel-switch-to-term)
|
|
|
|
;; :init (progn
|
|
|
|
;; ;; term-mode's attempt to use isearch is not my favourite thing in the
|
|
|
|
;; ;; world.
|
|
|
|
;; (delete '("C-r" . isearch-backward) term-bind-key-alist)
|
|
|
|
;; (delete '("C-s" . isearch-forward) term-bind-key-alist)
|
|
|
|
|
|
|
|
;; (add-to-list 'term-bind-key-alist '("C-r" . term-send-reverse-search-history))
|
|
|
|
;; (add-to-list 'term-bind-key-alist '("C-c C-l" . term-line-mode))
|
|
|
|
;; (add-to-list 'term-bind-key-alist '("C-s" . swiper))
|
|
|
|
;; (add-to-list 'term-bind-key-alist '("C-c C-r" . term-rename))))
|
2018-06-22 10:29:31 +02:00
|
|
|
|
|
|
|
(use-package password-store)
|
|
|
|
(use-package pg)
|
|
|
|
(use-package restclient)
|
|
|
|
|
|
|
|
;;
|
|
|
|
;; 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))
|
|
|
|
:bind (:map cargo-minor-mode-map ("C-c C-c C-l" . ignore)))
|
2018-06-22 10:29:31 +02:00
|
|
|
|
|
|
|
(use-package dockerfile-mode)
|
|
|
|
|
|
|
|
(use-package eglot
|
|
|
|
:init (defvar rust-eglot-initialized nil)
|
|
|
|
:hook ((rust-mode . (lambda ()
|
|
|
|
(unless rust-eglot-initialized
|
|
|
|
(call-interactively #'eglot)
|
|
|
|
(setq rust-eglot-initialized t))))))
|
|
|
|
|
|
|
|
(use-package erlang
|
|
|
|
:hook ((erlang-mode . (lambda ()
|
|
|
|
;; Don't indent after '>' while I'm writing
|
|
|
|
(local-set-key ">" 'self-insert-command)))))
|
|
|
|
|
|
|
|
(use-package go-mode)
|
|
|
|
(use-package haskell-mode)
|
|
|
|
|
|
|
|
(use-package jq-mode
|
|
|
|
:init (add-to-list 'auto-mode-alist '("\\.jq\\'" . jq-mode)))
|
|
|
|
|
2018-10-12 19:11:43 +02:00
|
|
|
(use-package kotlin-mode
|
|
|
|
:bind (:map kotlin-mode-map ("<tab>" . indent-relative)))
|
2018-06-22 10:29:31 +02:00
|
|
|
|
|
|
|
(use-package markdown-mode
|
|
|
|
:init
|
|
|
|
(add-to-list 'auto-mode-alist '("\\.txt\\'" . markdown-mode))
|
|
|
|
(add-to-list 'auto-mode-alist '("\\.markdown\\'" . markdown-mode))
|
|
|
|
(add-to-list 'auto-mode-alist '("\\.md\\'" . markdown-mode)))
|
|
|
|
|
|
|
|
(use-package markdown-toc)
|
|
|
|
(use-package nginx-mode)
|
|
|
|
(use-package rust-mode)
|
|
|
|
(use-package terraform-mode)
|
|
|
|
(use-package toml-mode)
|
|
|
|
(use-package web-mode)
|
|
|
|
(use-package yaml-mode)
|
|
|
|
|
|
|
|
;;
|
|
|
|
;; EXWM / NixOS related packages
|
|
|
|
;;
|
|
|
|
|
2017-11-12 19:46:14 +01:00
|
|
|
;; Configure a few basics before moving on to package-specific initialisation.
|
2014-10-21 19:37:19 +02:00
|
|
|
(setq custom-file (concat user-emacs-directory "init/custom.el"))
|
2013-07-08 01:15:05 +02:00
|
|
|
(load custom-file)
|
|
|
|
|
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)
|
|
|
|
|
2017-11-12 19:46:14 +01:00
|
|
|
(defun load-other-settings ()
|
2017-11-15 17:35:17 +01:00
|
|
|
(mapc 'require '(nixos
|
2018-06-15 01:14:28 +02:00
|
|
|
mail-setup
|
2017-11-15 17:35:17 +01:00
|
|
|
look-and-feel
|
2017-11-12 19:46:14 +01:00
|
|
|
functions
|
|
|
|
settings
|
|
|
|
modes
|
|
|
|
bindings
|
2018-05-09 00:41:48 +02:00
|
|
|
term-setup
|
2017-11-12 19:46:14 +01:00
|
|
|
eshell-setup
|
2018-06-28 11:02:24 +02:00
|
|
|
))
|
|
|
|
(telephone-line-setup)
|
|
|
|
|
|
|
|
(use-package sly
|
|
|
|
:init (setq inferior-lisp-program (concat (nix-store-path "sbcl") "/bin/sbcl"))
|
|
|
|
;;(add-to-list 'company-backends 'sly-company)
|
|
|
|
))
|
|
|
|
|
|
|
|
;; Some packages can only be initialised after the rest of the
|
|
|
|
;; settings has been applied:
|
|
|
|
|
2017-11-12 19:46:14 +01:00
|
|
|
(add-hook 'after-init-hook 'load-other-settings)
|
2018-02-23 10:03:15 +01:00
|
|
|
(put 'narrow-to-region 'disabled nil)
|
2018-05-07 14:02:43 +02:00
|
|
|
(put 'upcase-region 'disabled nil)
|