2023-01-28 09:26:37 +00:00
|
|
|
;; Basic appearence and behaviour.
|
2022-05-15 21:37:25 +01:00
|
|
|
(setq inhibit-startup-message t)
|
|
|
|
(setq auto-save-default nil)
|
|
|
|
(setq make-backup-files nil)
|
2022-11-23 22:33:43 +00:00
|
|
|
(cond ((find-font (font-spec :name "Jetbrains Mono"))
|
2023-01-18 09:26:14 +00:00
|
|
|
(set-face-attribute 'default nil :font "Jetbrains Mono" :height 120)))
|
2022-05-15 21:37:25 +01:00
|
|
|
(global-set-key (kbd "<escape>") 'keyboard-escape-quit)
|
2021-09-26 23:43:29 +01:00
|
|
|
(scroll-bar-mode -1)
|
|
|
|
(tool-bar-mode -1)
|
|
|
|
(set-fringe-mode 10)
|
2022-11-23 22:33:43 +00:00
|
|
|
(setq column-number-mode t)
|
2021-09-26 23:43:29 +01:00
|
|
|
(menu-bar-mode -1)
|
2023-01-28 09:26:37 +00:00
|
|
|
;; For Emacs >=29.
|
2022-12-21 21:01:18 +00:00
|
|
|
(pixel-scroll-precision-mode t)
|
2023-01-28 09:26:37 +00:00
|
|
|
;; Messes with the Terraform LSP, and I don't really need this myself.
|
2023-01-12 15:19:10 +00:00
|
|
|
(setq create-lockfiles nil)
|
2022-12-21 21:01:18 +00:00
|
|
|
|
2023-01-28 09:26:37 +00:00
|
|
|
;; Orgmode tweaks.
|
2021-09-26 23:43:29 +01:00
|
|
|
(setq org-edit-src-content-indentation 0
|
|
|
|
org-src-tab-acts-natively t
|
|
|
|
org-src-preserve-indentation t)
|
2022-11-01 11:50:57 +00:00
|
|
|
(setq-default tab-width 4)
|
|
|
|
|
2023-01-28 09:26:37 +00:00
|
|
|
;; WSL keybinds to work around some weirdness.
|
2022-05-15 22:12:49 +01:00
|
|
|
(global-set-key (kbd "C-c y") 'clipboard-yank)
|
|
|
|
(global-set-key (kbd "C-c x") 'kill-ring-save)
|
2022-05-15 21:37:25 +01:00
|
|
|
|
|
|
|
;; straight.el bootstrapping
|
|
|
|
(defvar bootstrap-version)
|
|
|
|
(let ((bootstrap-file
|
2023-01-28 09:26:37 +00:00
|
|
|
(expand-file-name "straight/repos/straight.el/bootstrap.el" user-emacs-directory))
|
2022-05-15 21:37:25 +01:00
|
|
|
(bootstrap-version 5))
|
|
|
|
(unless (file-exists-p bootstrap-file)
|
|
|
|
(with-current-buffer
|
2023-01-28 09:26:37 +00:00
|
|
|
(url-retrieve-synchronously
|
2022-05-15 21:37:25 +01:00
|
|
|
"https://raw.githubusercontent.com/raxod502/straight.el/develop/install.el"
|
|
|
|
'silent 'inhibit-cookies)
|
|
|
|
(goto-char (point-max))
|
|
|
|
(eval-print-last-sexp)))
|
|
|
|
(load bootstrap-file nil 'nomessage))
|
|
|
|
|
|
|
|
;; package list we want installed
|
2023-01-28 09:26:37 +00:00
|
|
|
;; first use-package
|
2022-05-15 21:37:25 +01:00
|
|
|
(straight-use-package 'use-package)
|
2023-01-28 09:26:37 +00:00
|
|
|
(use-package vterm :straight t)
|
2022-05-15 21:37:25 +01:00
|
|
|
(use-package el-patch :straight t)
|
2021-09-26 23:43:29 +01:00
|
|
|
(use-package doom-modeline
|
2022-05-15 21:37:25 +01:00
|
|
|
:straight t
|
2021-09-26 23:43:29 +01:00
|
|
|
:init (doom-modeline-mode 1)
|
2022-05-15 21:37:25 +01:00
|
|
|
:custom (doom-mode-line-height 14))
|
|
|
|
(use-package all-the-icons :straight t)
|
2021-09-26 23:43:29 +01:00
|
|
|
(use-package paredit
|
2022-05-15 21:37:25 +01:00
|
|
|
:straight t
|
2021-09-26 23:43:29 +01:00
|
|
|
:config
|
|
|
|
(add-hook 'emacs-lisp-mode-hook #'paredit-mode)
|
|
|
|
(add-hook 'lisp-interaction-mode-hook #'paredit-mode)
|
|
|
|
(add-hook 'ielm-mode-hook #'paredit-mode)
|
|
|
|
(add-hook 'lisp-mode-hook #'paredit-mode)
|
|
|
|
(add-hook 'eval-expression-minibuffer-setup-hook #'paredit-mode))
|
2022-05-15 21:37:25 +01:00
|
|
|
(use-package which-key
|
|
|
|
:straight t
|
|
|
|
:config (which-key-mode))
|
2021-09-26 23:43:29 +01:00
|
|
|
(use-package projectile
|
2022-05-15 21:37:25 +01:00
|
|
|
:straight t
|
|
|
|
:init (projectile-mode +1)
|
2022-11-01 11:50:57 +00:00
|
|
|
:config (setq projectile-project-search-path '("~/Projects"))
|
2021-09-26 23:43:29 +01:00
|
|
|
:bind (:map projectile-mode-map
|
2023-01-28 09:26:37 +00:00
|
|
|
("s-p" . projectile-command-map)
|
|
|
|
("C-c p" . projectile-command-map)))
|
2022-11-01 11:50:57 +00:00
|
|
|
(use-package magit :straight t)
|
2022-12-22 12:00:54 +00:00
|
|
|
(use-package hide-mode-line :straight t)
|
|
|
|
(add-hook 'org-mode-hook #'hide-mode-line-mode)
|
|
|
|
(add-hook 'treemacs-mode-hook #'hide-mode-line-mode)
|
2022-05-15 22:36:15 +01:00
|
|
|
(use-package treemacs
|
|
|
|
:straight t
|
|
|
|
:init (with-eval-after-load 'winum
|
2022-12-22 12:00:54 +00:00
|
|
|
(define-key winum-keymap (kbd "M-0") #'treemacs-select-window))
|
2022-05-15 22:36:15 +01:00
|
|
|
:bind
|
|
|
|
(:map global-map
|
2022-12-22 12:00:54 +00:00
|
|
|
("M-0" . treemacs-select-window)
|
|
|
|
("C-x t t" . treemacs)
|
|
|
|
("C-x t C-t" . treemacs-find-file)))
|
2022-05-15 22:36:15 +01:00
|
|
|
(use-package treemacs-projectile
|
|
|
|
:straight t
|
|
|
|
:after (treemacs projectile))
|
2022-05-15 21:37:25 +01:00
|
|
|
|
2022-05-15 22:12:49 +01:00
|
|
|
;; I hate that I need this, but WSL is /special/.
|
|
|
|
(when (and (eq system-type 'gnu/linux)
|
|
|
|
(getenv "WSLENV"))
|
|
|
|
(use-package exec-path-from-shell :straight t)
|
2022-11-01 11:50:57 +00:00
|
|
|
(exec-path-from-shell-initialize))
|
|
|
|
|
|
|
|
;; Direnv integration
|
|
|
|
(use-package direnv :straight t)
|
|
|
|
(direnv-mode)
|
|
|
|
|
|
|
|
;; Fancy tabs
|
|
|
|
(use-package centaur-tabs :straight t
|
|
|
|
:config
|
2023-01-28 09:26:37 +00:00
|
|
|
(setq centaur-tabs-style "bar"
|
|
|
|
centaur-tabs-height 32
|
|
|
|
centaur-tabs-set-icons t
|
|
|
|
centaur-tabs-set-modified-marker t
|
|
|
|
centaur-tabs-show-navigation-buttons t
|
|
|
|
centaur-tabs-set-bar 'under
|
|
|
|
x-underline-at-descent-line t)
|
|
|
|
(centaur-tabs-headline-match)
|
|
|
|
(setq uniquify-separator "/")
|
|
|
|
(setq uniquify-buffer-name-style 'forward)
|
2022-11-01 11:50:57 +00:00
|
|
|
:bind ("C-<prior>" . centaur-tabs-backward)
|
|
|
|
("C-<next>" . centaur-tabs-forward))
|
2022-05-15 22:12:49 +01:00
|
|
|
|
2022-12-21 21:01:18 +00:00
|
|
|
(use-package org-modern :straight t)
|
|
|
|
(add-hook 'org-mode-hook #'org-modern-mode)
|
|
|
|
(add-hook 'org-agenda-finalize-hook #'org-modern-agenda)
|
|
|
|
|
|
|
|
(setq
|
|
|
|
;; Edit settings
|
|
|
|
;;org-auto-align-tags nil
|
|
|
|
;;org-tags-column 0
|
|
|
|
org-catch-invisible-edits 'show-and-error
|
|
|
|
org-special-ctrl-a/e t
|
|
|
|
org-insert-heading-respect-content t
|
|
|
|
|
|
|
|
;; Org styling, hide markup etc.
|
|
|
|
org-hide-emphasis-markers t
|
|
|
|
org-pretty-entities t
|
2022-12-29 18:31:28 +00:00
|
|
|
org-ellipsis " →"
|
2022-12-21 21:01:18 +00:00
|
|
|
|
|
|
|
;; Agenda styling
|
|
|
|
org-agenda-tags-column 0
|
|
|
|
org-agenda-block-separator ?─
|
|
|
|
org-agenda-time-grid
|
|
|
|
'((daily today require-timed)
|
|
|
|
(800 1000 1200 1400 1600 1800 2000)
|
|
|
|
" ┄┄┄┄┄ " "┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄")
|
|
|
|
org-agenda-current-time-string
|
|
|
|
"⭠ now ─────────────────────────────────────────────────")
|
|
|
|
|
2022-05-15 21:37:25 +01:00
|
|
|
;; lsp-mode stuff
|
|
|
|
(use-package eglot :straight t
|
2023-01-12 15:19:10 +00:00
|
|
|
:config (add-hook 'go-mode-hook 'eglot-ensure)
|
|
|
|
(add-hook 'terraform-mode-hook 'eglot-ensure)
|
|
|
|
(add-to-list 'eglot-server-programs '(terraform-mode . ("terraform-ls" "serve"))))
|
2022-05-15 21:37:25 +01:00
|
|
|
(use-package company :straight t
|
2022-05-15 22:12:49 +01:00
|
|
|
:config
|
|
|
|
(add-hook 'after-init-hook 'global-company-mode)
|
|
|
|
(setq company-idle-delay 0)
|
|
|
|
(setq company-minimum-prefix-length 1))
|
2022-05-15 21:37:25 +01:00
|
|
|
(use-package go-mode :straight t)
|
2022-10-25 09:32:28 +01:00
|
|
|
(use-package nix-mode :straight t
|
|
|
|
:mode "\\.nix\\'")
|
2022-11-01 11:50:57 +00:00
|
|
|
(use-package yaml-mode :straight t)
|
2022-12-29 18:31:28 +00:00
|
|
|
(use-package svelte-mode :straight t)
|
2022-11-01 11:50:57 +00:00
|
|
|
(use-package terraform-mode :straight t)
|
2022-11-06 21:58:50 +00:00
|
|
|
(use-package yasnippet :straight t)
|
|
|
|
(yas-global-mode 1)
|
|
|
|
(use-package k8s-mode
|
|
|
|
:straight t
|
|
|
|
:config
|
|
|
|
(setq k8s-search-documentation-browser-function 'browse-url-firefox)
|
|
|
|
:hook (k8s-mode . yas-minor-mode))
|
|
|
|
(use-package kubernetes :straight t)
|
2022-11-23 12:04:00 +00:00
|
|
|
(use-package rust-mode :straight t)
|
2022-12-21 21:01:18 +00:00
|
|
|
(use-package markdown-mode :straight t)
|
2022-11-23 12:04:00 +00:00
|
|
|
(use-package olivetti :straight t)
|
2022-11-06 21:58:50 +00:00
|
|
|
|
2022-11-23 22:33:43 +00:00
|
|
|
;; Adapted from https://github.com/Slackwise/dotfiles/blob/master/emacs/slackwise.el
|
|
|
|
(setq-default
|
2023-01-28 09:26:37 +00:00
|
|
|
functions-file (concat (or (getenv "XDG_CONFIG_HOME") "~/.emacs.d/") "functions.el"))
|
2022-11-23 22:33:43 +00:00
|
|
|
(when (file-exists-p functions-file)
|
2022-11-24 09:02:47 +00:00
|
|
|
(load functions-file))
|
2022-11-23 22:33:43 +00:00
|
|
|
|
|
|
|
;; Keep the customize system from borking up this file.
|
|
|
|
(setq-default
|
2023-01-28 09:26:37 +00:00
|
|
|
custom-file (concat (or (getenv "XDG_CONFIG_HOME") "~/.emacs.d/") "custom.el"))
|
2022-11-23 22:33:43 +00:00
|
|
|
(when (file-exists-p custom-file)
|
|
|
|
(load custom-file))
|