2021-04-11 23:53:27 +02:00
|
|
|
|
;;; -*- lexical-binding: t; -*-
|
2018-03-30 00:10:07 +02:00
|
|
|
|
|
2018-09-18 16:18:20 +02:00
|
|
|
|
;; I've swapped these keys on my keyboard
|
|
|
|
|
(setq x-super-keysym 'alt
|
|
|
|
|
x-alt-keysym 'meta)
|
|
|
|
|
|
2020-11-25 15:59:11 +01:00
|
|
|
|
(setq user-mail-address "root@gws.fyi"
|
2018-09-18 16:18:20 +02:00
|
|
|
|
user-full-name "Griffin Smith")
|
|
|
|
|
|
2020-11-25 15:59:11 +01:00
|
|
|
|
(let ((font-family (pcase system-type
|
|
|
|
|
('darwin "MesloLGSDZ NF")
|
|
|
|
|
('gnu/linux "Meslo LGSDZ Nerd Font"))))
|
|
|
|
|
(setq doom-font (font-spec :family font-family :size 14)
|
|
|
|
|
doom-big-font (font-spec :family font-family :size 24)
|
|
|
|
|
doom-big-font-increment 5
|
2022-01-18 00:04:43 +01:00
|
|
|
|
doom-variable-pitch-font (font-spec :family font-family)
|
2020-11-25 15:59:11 +01:00
|
|
|
|
doom-unicode-font (font-spec :family font-family)))
|
2018-09-18 16:18:20 +02:00
|
|
|
|
|
2020-08-20 18:30:56 +02:00
|
|
|
|
(require 's)
|
2018-09-18 16:18:20 +02:00
|
|
|
|
|
2020-12-01 18:00:04 +01:00
|
|
|
|
(undefine-key! :keymaps 'doom-leader-map "/")
|
|
|
|
|
|
2019-02-27 20:08:47 +01:00
|
|
|
|
(load! "utils")
|
2019-03-11 03:23:45 +01:00
|
|
|
|
(load! "company-sql")
|
2020-03-26 20:03:25 +01:00
|
|
|
|
(load! "show-matching-paren")
|
2020-05-18 17:34:43 +02:00
|
|
|
|
(load! "irc")
|
2020-05-26 16:22:37 +02:00
|
|
|
|
(load! "github-org")
|
2020-06-15 17:56:12 +02:00
|
|
|
|
(load! "org-gcal")
|
2020-06-15 17:56:45 +02:00
|
|
|
|
(load! "grid")
|
2020-07-02 20:54:28 +02:00
|
|
|
|
(load! "nix")
|
2020-07-06 17:08:03 +02:00
|
|
|
|
(load! "email")
|
2020-07-14 21:34:23 +02:00
|
|
|
|
(load! "cpp")
|
2020-08-17 19:23:54 +02:00
|
|
|
|
(load! "lisp")
|
2020-08-30 17:37:57 +02:00
|
|
|
|
(load! "clojure")
|
2020-12-01 18:01:03 +01:00
|
|
|
|
(load! "rust")
|
2021-03-30 22:34:19 +02:00
|
|
|
|
(load! "terraform")
|
2020-05-18 17:34:43 +02:00
|
|
|
|
|
2020-06-19 20:29:31 +02:00
|
|
|
|
(require 'tvl)
|
2020-05-18 17:34:43 +02:00
|
|
|
|
|
2018-09-18 16:18:20 +02:00
|
|
|
|
(add-hook! elixir-mode
|
|
|
|
|
(require 'flycheck-credo)
|
|
|
|
|
(setq flycheck-elixir-credo-strict t)
|
|
|
|
|
(flycheck-credo-setup)
|
|
|
|
|
|
|
|
|
|
(require 'flycheck-mix) (flycheck-mix-setup)
|
|
|
|
|
|
|
|
|
|
(require 'flycheck-dialyxir) (flycheck-dialyxir-setup)
|
|
|
|
|
|
|
|
|
|
(flycheck-mode))
|
|
|
|
|
|
|
|
|
|
(setq +solarized-s-base03 "#002b36"
|
|
|
|
|
+solarized-s-base02 "#073642"
|
|
|
|
|
;; emphasized content
|
|
|
|
|
+solarized-s-base01 "#586e75"
|
|
|
|
|
;; primary content
|
|
|
|
|
+solarized-s-base00 "#657b83"
|
|
|
|
|
+solarized-s-base0 "#839496"
|
|
|
|
|
;; comments
|
|
|
|
|
+solarized-s-base1 "#93a1a1"
|
|
|
|
|
;; background highlight light
|
|
|
|
|
+solarized-s-base2 "#eee8d5"
|
|
|
|
|
;; background light
|
|
|
|
|
+solarized-s-base3 "#fdf6e3"
|
|
|
|
|
|
|
|
|
|
;; Solarized accented colors
|
|
|
|
|
+solarized-yellow "#b58900"
|
|
|
|
|
+solarized-orange "#cb4b16"
|
|
|
|
|
+solarized-red "#dc322f"
|
|
|
|
|
+solarized-magenta "#d33682"
|
|
|
|
|
+solarized-violet "#6c71c4"
|
|
|
|
|
+solarized-blue "#268bd2"
|
|
|
|
|
+solarized-cyan "#2aa198"
|
|
|
|
|
+solarized-green "#859900"
|
|
|
|
|
|
|
|
|
|
;; Darker and lighter accented colors
|
|
|
|
|
;; Only use these in exceptional circumstances!
|
|
|
|
|
+solarized-yellow-d "#7B6000"
|
|
|
|
|
+solarized-yellow-l "#DEB542"
|
|
|
|
|
+solarized-orange-d "#8B2C02"
|
|
|
|
|
+solarized-orange-l "#F2804F"
|
|
|
|
|
+solarized-red-d "#990A1B"
|
|
|
|
|
+solarized-red-l "#FF6E64"
|
|
|
|
|
+solarized-magenta-d "#93115C"
|
|
|
|
|
+solarized-magenta-l "#F771AC"
|
|
|
|
|
+solarized-violet-d "#3F4D91"
|
|
|
|
|
+solarized-violet-l "#9EA0E5"
|
|
|
|
|
+solarized-blue-d "#00629D"
|
|
|
|
|
+solarized-blue-l "#69B7F0"
|
|
|
|
|
+solarized-cyan-d "#00736F"
|
|
|
|
|
+solarized-cyan-l "#69CABF"
|
|
|
|
|
+solarized-green-d "#546E00"
|
|
|
|
|
+solarized-green-l "#B4C342")
|
|
|
|
|
|
2020-05-18 17:34:24 +02:00
|
|
|
|
(defcustom theme-overrides nil
|
|
|
|
|
"Association list of override faces to set for different custom themes.")
|
|
|
|
|
|
2018-09-18 16:18:20 +02:00
|
|
|
|
(defadvice load-theme (after theme-set-overrides activate)
|
|
|
|
|
(dolist (theme-settings theme-overrides)
|
|
|
|
|
(let ((theme (car theme-settings))
|
|
|
|
|
(faces (cadr theme-settings)))
|
|
|
|
|
(if (member theme custom-enabled-themes)
|
2020-03-26 20:03:25 +01:00
|
|
|
|
(progn
|
|
|
|
|
(dolist (face faces)
|
|
|
|
|
(custom-theme-set-faces theme face)))))))
|
2018-09-18 16:18:20 +02:00
|
|
|
|
|
|
|
|
|
(defun alist-set (alist-symbol key value)
|
|
|
|
|
"Set VALUE of a KEY in ALIST-SYMBOL."
|
|
|
|
|
(set alist-symbol (cons (list key value) (assq-delete-all key (eval alist-symbol)))))
|
|
|
|
|
|
2020-03-26 20:03:25 +01:00
|
|
|
|
(comment
|
|
|
|
|
(custom-theme-set-faces 'grfn-solarized-light
|
|
|
|
|
`(font-lock-doc-face
|
|
|
|
|
((t (:foreground ,+solarized-s-base1)))))
|
|
|
|
|
|
|
|
|
|
+solarized-s-base1
|
|
|
|
|
(custom-theme-)
|
|
|
|
|
(custom-face-get-current-spec 'font-lock-doc-face)
|
|
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
2018-09-18 16:18:20 +02:00
|
|
|
|
(alist-set 'theme-overrides 'grfn-solarized-light
|
|
|
|
|
`((font-lock-doc-face ((t (:foreground ,+solarized-s-base1))))
|
|
|
|
|
(font-lock-preprocessor-face ((t (:foreground ,+solarized-red))))
|
2019-02-27 20:08:47 +01:00
|
|
|
|
(font-lock-keyword-face ((t (:foreground ,+solarized-green :bold nil))))
|
|
|
|
|
(font-lock-builtin-face ((t (:foreground ,+solarized-s-base01
|
2020-03-26 20:03:25 +01:00
|
|
|
|
:bold t))))
|
2018-09-18 16:18:20 +02:00
|
|
|
|
|
|
|
|
|
(elixir-attribute-face ((t (:foreground ,+solarized-blue))))
|
|
|
|
|
(elixir-atom-face ((t (:foreground ,+solarized-cyan))))
|
|
|
|
|
(linum ((t (:background ,+solarized-s-base2 :foreground ,+solarized-s-base1))))
|
|
|
|
|
(line-number ((t (:background ,+solarized-s-base2 :foreground ,+solarized-s-base1))))
|
2021-01-19 16:49:08 +01:00
|
|
|
|
(line-number-current-line ((t (:background ,+solarized-s-base2 :foreground ,+solarized-s-base1))))
|
2018-09-18 16:18:20 +02:00
|
|
|
|
|
|
|
|
|
(haskell-operator-face ((t (:foreground ,+solarized-green))))
|
2020-03-26 20:03:25 +01:00
|
|
|
|
(haskell-keyword-face ((t (:foreground ,+solarized-cyan))))
|
|
|
|
|
|
|
|
|
|
(org-drawer ((t (:foreground ,+solarized-s-base1
|
|
|
|
|
:bold t))))))
|
2018-09-18 16:18:20 +02:00
|
|
|
|
|
|
|
|
|
(setq solarized-use-variable-pitch nil
|
2019-02-27 20:08:47 +01:00
|
|
|
|
solarized-scale-org-headlines nil
|
|
|
|
|
solarized-use-less-bold t)
|
2018-09-18 16:18:20 +02:00
|
|
|
|
|
|
|
|
|
(add-to-list 'custom-theme-load-path "~/.doom.d/themes")
|
|
|
|
|
(load-theme 'grfn-solarized-light t)
|
|
|
|
|
|
|
|
|
|
(defface haskell-import-face `((t (:foreground ,+solarized-magenta))) "")
|
|
|
|
|
|
|
|
|
|
(setq doom-theme 'grfn-solarized-light)
|
|
|
|
|
; (setq doom-theme 'doom-solarized-light)
|
|
|
|
|
|
|
|
|
|
(add-hook! doom-post-init
|
|
|
|
|
(set-face-attribute 'bold nil :weight 'ultra-light)
|
2019-02-27 20:08:47 +01:00
|
|
|
|
(set-face-bold 'bold nil)
|
|
|
|
|
(enable-theme 'grfn-solarized-light))
|
2018-09-18 16:18:20 +02:00
|
|
|
|
|
|
|
|
|
(defun rx-words (&rest words)
|
|
|
|
|
(rx-to-string
|
|
|
|
|
`(and symbol-start (group (or ,@words)) symbol-end)))
|
|
|
|
|
|
|
|
|
|
(font-lock-add-keywords
|
|
|
|
|
'elixir-mode
|
|
|
|
|
`((,(rx-words "def"
|
|
|
|
|
"defp"
|
|
|
|
|
"test"
|
|
|
|
|
"describe"
|
|
|
|
|
"property"
|
|
|
|
|
"defrecord"
|
|
|
|
|
"defmodule"
|
|
|
|
|
"defstruct"
|
|
|
|
|
"defdelegate"
|
|
|
|
|
"defprotocol"
|
|
|
|
|
"defimpl"
|
|
|
|
|
"use"
|
|
|
|
|
"import"
|
|
|
|
|
"alias"
|
|
|
|
|
"require"
|
|
|
|
|
"assert"
|
|
|
|
|
"refute"
|
|
|
|
|
"assert_raise")
|
|
|
|
|
.
|
|
|
|
|
'font-lock-preprocessor-face)))
|
|
|
|
|
|
|
|
|
|
(font-lock-add-keywords
|
|
|
|
|
'elixir-mode
|
|
|
|
|
`((,(rx-words "def"
|
|
|
|
|
"defp"
|
|
|
|
|
"test"
|
|
|
|
|
"describe"
|
|
|
|
|
"property"
|
|
|
|
|
"defrecord"
|
|
|
|
|
"defmodule"
|
|
|
|
|
"defstruct"
|
|
|
|
|
"defdelegate"
|
|
|
|
|
"use"
|
|
|
|
|
"import"
|
|
|
|
|
"alias"
|
|
|
|
|
"require"
|
|
|
|
|
"assert"
|
|
|
|
|
"refute"
|
|
|
|
|
"assert_raise")
|
|
|
|
|
.
|
|
|
|
|
'font-lock-preprocessor-face)))
|
|
|
|
|
|
|
|
|
|
(font-lock-add-keywords
|
|
|
|
|
'haskell-mode
|
|
|
|
|
`((,(rx-words "import") . 'haskell-import-face)))
|
|
|
|
|
|
|
|
|
|
;; (font-lock-add-keywords
|
|
|
|
|
;; 'haskell-mode
|
|
|
|
|
;; `((,(rx "-- |") . 'haskell-keyword-face)))
|
|
|
|
|
|
|
|
|
|
|
2021-01-29 18:14:06 +01:00
|
|
|
|
;; (load-file (let ((coding-system-for-read 'utf-8))
|
|
|
|
|
;; (shell-command-to-string "agda-mode locate")))
|
2018-08-31 19:31:14 +02:00
|
|
|
|
|
2018-03-30 00:10:07 +02:00
|
|
|
|
(defvar +grfn-dir (file-name-directory load-file-name))
|
|
|
|
|
(defvar +grfn-snippets-dir (expand-file-name "snippets/" +grfn-dir))
|
|
|
|
|
|
|
|
|
|
;;
|
2020-03-26 20:03:25 +01:00
|
|
|
|
(load! "+bindings")
|
|
|
|
|
(load! "+commands")
|
2020-09-09 17:59:14 +02:00
|
|
|
|
(load! "cpp")
|
2018-03-30 00:10:07 +02:00
|
|
|
|
|
2021-06-05 17:04:45 +02:00
|
|
|
|
|
|
|
|
|
(add-to-list 'load-path "/home/grfn/code/org-tracker")
|
|
|
|
|
(require 'org-tracker)
|
|
|
|
|
(use-package! org-tracker
|
|
|
|
|
:hook (org-mode . org-tracker-mode)
|
|
|
|
|
:config
|
2021-11-20 21:56:50 +01:00
|
|
|
|
(setq org-tracker-state-alist '(("INBOX" . "Inbox")
|
|
|
|
|
("BACKLOG" . "Backlog")
|
2021-06-16 16:47:26 +02:00
|
|
|
|
("TODO" . "Selected for Development")
|
2021-06-05 17:04:45 +02:00
|
|
|
|
("ACTIVE" . "In Progress")
|
|
|
|
|
("PR" . "Code Review")
|
|
|
|
|
("DONE" . "Done"))
|
|
|
|
|
org-tracker-username "griffin@readyset.io"
|
|
|
|
|
org-tracker-claim-ticket-on-status-update '("ACTIVE" "PR" "DONE")
|
2021-06-16 16:47:35 +02:00
|
|
|
|
org-tracker-create-stories-with-labels 'existing)
|
|
|
|
|
|
|
|
|
|
(defun org-tracker-headlines-from-assigned-to-me (level)
|
|
|
|
|
(interactive "*nLevel: ")
|
2021-06-22 19:30:14 +02:00
|
|
|
|
(funcall-interactively
|
|
|
|
|
#'org-tracker-headlines-from-search
|
2021-06-16 16:47:35 +02:00
|
|
|
|
level
|
|
|
|
|
"assignee = currentUser() and statusCategory = 2")))
|
2021-06-05 17:04:45 +02:00
|
|
|
|
|
2018-08-31 19:31:14 +02:00
|
|
|
|
(load! "+private")
|
2018-03-30 00:10:07 +02:00
|
|
|
|
|
|
|
|
|
(require 'dash)
|
|
|
|
|
|
2020-03-26 20:03:25 +01:00
|
|
|
|
(use-package! predd)
|
2019-03-29 17:10:48 +01:00
|
|
|
|
|
2018-03-30 00:10:07 +02:00
|
|
|
|
|
|
|
|
|
;;
|
|
|
|
|
;; Global config
|
|
|
|
|
;;
|
|
|
|
|
|
2020-05-18 17:34:08 +02:00
|
|
|
|
(setq doom-modeline-buffer-file-name-style 'relative-to-project
|
|
|
|
|
doom-modeline-modal-icon nil
|
|
|
|
|
doom-modeline-github t)
|
2018-03-30 00:10:07 +02:00
|
|
|
|
|
|
|
|
|
;;
|
|
|
|
|
;; Modules
|
|
|
|
|
;;
|
|
|
|
|
|
|
|
|
|
(after! smartparens
|
|
|
|
|
;; Auto-close more conservatively and expand braces on RET
|
|
|
|
|
(let ((unless-list '(sp-point-before-word-p
|
|
|
|
|
sp-point-after-word-p
|
|
|
|
|
sp-point-before-same-p)))
|
|
|
|
|
(sp-pair "'" nil :unless unless-list)
|
|
|
|
|
(sp-pair "\"" nil :unless unless-list))
|
|
|
|
|
(sp-pair "{" nil :post-handlers '(("||\n[i]" "RET") ("| " " "))
|
|
|
|
|
:unless '(sp-point-before-word-p sp-point-before-same-p))
|
|
|
|
|
(sp-pair "(" nil :post-handlers '(("||\n[i]" "RET") ("| " " "))
|
|
|
|
|
:unless '(sp-point-before-word-p sp-point-before-same-p))
|
|
|
|
|
(sp-pair "[" nil :post-handlers '(("| " " "))
|
|
|
|
|
:unless '(sp-point-before-word-p sp-point-before-same-p)))
|
|
|
|
|
|
|
|
|
|
;; feature/snippets
|
|
|
|
|
(after! yasnippet
|
|
|
|
|
;; Don't use default snippets, use mine.
|
|
|
|
|
(setq yas-snippet-dirs
|
|
|
|
|
(append (list '+grfn-snippets-dir)
|
|
|
|
|
(delq 'yas-installed-snippets-dir yas-snippet-dirs))))
|
|
|
|
|
|
|
|
|
|
(after! company
|
|
|
|
|
(setq company-idle-delay 0.2
|
|
|
|
|
company-minimum-prefix-length 1))
|
|
|
|
|
|
2020-03-26 20:03:25 +01:00
|
|
|
|
(setq doom-modeline-height 12)
|
|
|
|
|
|
2020-12-14 18:54:07 +01:00
|
|
|
|
|
2018-03-30 00:10:07 +02:00
|
|
|
|
|
|
|
|
|
;; Should really figure out which of these is correct, eventually
|
|
|
|
|
|
2018-08-31 19:31:14 +02:00
|
|
|
|
(setq +solarized-s-base03 "#002b36"
|
|
|
|
|
+solarized-s-base02 "#073642"
|
|
|
|
|
;; emphasized content
|
|
|
|
|
+solarized-s-base01 "#586e75"
|
|
|
|
|
;; primary content
|
|
|
|
|
+solarized-s-base00 "#657b83"
|
|
|
|
|
+solarized-s-base0 "#839496"
|
|
|
|
|
;; comments
|
|
|
|
|
+solarized-s-base1 "#93a1a1"
|
|
|
|
|
;; background highlight light
|
|
|
|
|
+solarized-s-base2 "#eee8d5"
|
|
|
|
|
;; background light
|
|
|
|
|
+solarized-s-base3 "#fdf6e3"
|
|
|
|
|
|
|
|
|
|
;; Solarized accented colors
|
|
|
|
|
+solarized-yellow "#b58900"
|
|
|
|
|
+solarized-orange "#cb4b16"
|
|
|
|
|
+solarized-red "#dc322f"
|
|
|
|
|
+solarized-magenta "#d33682"
|
|
|
|
|
+solarized-violet "#6c71c4"
|
|
|
|
|
+solarized-blue "#268bd2"
|
|
|
|
|
+solarized-cyan "#2aa198"
|
|
|
|
|
+solarized-green "#859900"
|
|
|
|
|
|
|
|
|
|
;; Darker and lighter accented colors
|
|
|
|
|
;; Only use these in exceptional circumstances!
|
|
|
|
|
+solarized-yellow-d "#7B6000"
|
|
|
|
|
+solarized-yellow-l "#DEB542"
|
|
|
|
|
+solarized-orange-d "#8B2C02"
|
|
|
|
|
+solarized-orange-l "#F2804F"
|
|
|
|
|
+solarized-red-d "#990A1B"
|
|
|
|
|
+solarized-red-l "#FF6E64"
|
|
|
|
|
+solarized-magenta-d "#93115C"
|
|
|
|
|
+solarized-magenta-l "#F771AC"
|
|
|
|
|
+solarized-violet-d "#3F4D91"
|
|
|
|
|
+solarized-violet-l "#9EA0E5"
|
|
|
|
|
+solarized-blue-d "#00629D"
|
|
|
|
|
+solarized-blue-l "#69B7F0"
|
|
|
|
|
+solarized-cyan-d "#00736F"
|
|
|
|
|
+solarized-cyan-l "#69CABF"
|
|
|
|
|
+solarized-green-d "#546E00"
|
|
|
|
|
+solarized-green-l "#B4C342")
|
|
|
|
|
|
|
|
|
|
(set-cursor-color +solarized-s-base02)
|
|
|
|
|
|
2018-03-30 00:10:07 +02:00
|
|
|
|
(after! doom-theme
|
|
|
|
|
(set-face-foreground 'font-lock-doc-face +solarized-s-base1)
|
|
|
|
|
(set-face-foreground 'org-block +solarized-s-base00)
|
|
|
|
|
(set-face-foreground 'slack-message-output-header +solarized-s-base01)
|
|
|
|
|
(set-face-attribute 'slack-message-output-header nil :underline nil)
|
|
|
|
|
(set-face-attribute 'slack-message-output-text nil :height 1.0)
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
(after! solarized-theme
|
|
|
|
|
(set-face-foreground 'font-lock-doc-face +solarized-s-base1)
|
|
|
|
|
(set-face-foreground 'org-block +solarized-s-base00)
|
|
|
|
|
|
|
|
|
|
(set-face-foreground 'slack-message-output-header +solarized-s-base01)
|
|
|
|
|
(set-face-attribute 'slack-message-output-header nil :underline nil)
|
|
|
|
|
(set-face-attribute 'slack-message-output-text nil :height 1.0)
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
(after! evil
|
|
|
|
|
(setq evil-shift-width 2))
|
|
|
|
|
|
|
|
|
|
(after! org
|
2021-07-15 15:00:37 +02:00
|
|
|
|
(load! "org-query")
|
2021-06-05 17:02:23 +02:00
|
|
|
|
(load! "org-config"))
|
2018-03-30 00:10:07 +02:00
|
|
|
|
|
|
|
|
|
(after! magit
|
2019-02-27 20:08:47 +01:00
|
|
|
|
(setq git-commit-summary-max-length 50))
|
|
|
|
|
|
2018-03-30 00:10:07 +02:00
|
|
|
|
(after! ivy
|
2021-11-29 16:52:47 +01:00
|
|
|
|
;; (setq ivy-re-builders-alist
|
|
|
|
|
;; '((t . ivy--regex-fuzzy)))
|
|
|
|
|
)
|
2018-03-30 00:10:07 +02:00
|
|
|
|
|
|
|
|
|
(add-hook 'before-save-hook 'delete-trailing-whitespace)
|
|
|
|
|
|
|
|
|
|
(after! paxedit
|
|
|
|
|
(add-hook! emacs-lisp-mode #'paxedit-mode)
|
2020-08-30 17:37:57 +02:00
|
|
|
|
(add-hook! clojure-mode #'paxedit-mode)
|
|
|
|
|
(add-hook! common-lisp-mode #'paxedit-mode))
|
2018-03-30 00:10:07 +02:00
|
|
|
|
|
|
|
|
|
(require 'haskell)
|
|
|
|
|
|
|
|
|
|
(let ((m-symbols
|
|
|
|
|
'(("`mappend`" . "⊕")
|
2018-08-31 19:31:14 +02:00
|
|
|
|
("<>" . "⊕")
|
|
|
|
|
("`elem`" . "∈")
|
|
|
|
|
("`notElem`" . "∉"))))
|
2018-03-30 00:10:07 +02:00
|
|
|
|
(dolist (item m-symbols) (add-to-list 'haskell-font-lock-symbols-alist item)))
|
|
|
|
|
|
|
|
|
|
(setq haskell-font-lock-symbols t)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(add-hook! haskell-mode
|
2020-03-26 20:03:25 +01:00
|
|
|
|
;; (intero-mode)
|
|
|
|
|
(lsp-mode)
|
|
|
|
|
;; (flycheck-add-next-checker
|
|
|
|
|
;; 'intero
|
|
|
|
|
;; 'haskell-hlint)
|
2018-08-31 19:31:14 +02:00
|
|
|
|
(set-fill-column 80)
|
|
|
|
|
(setq evil-shift-width 2))
|
2018-03-30 00:10:07 +02:00
|
|
|
|
|
|
|
|
|
(auth-source-pass-enable)
|
|
|
|
|
|
|
|
|
|
(require 'fill-column-indicator)
|
|
|
|
|
;;; * Column Marker
|
|
|
|
|
(defun sanityinc/fci-enabled-p () (symbol-value 'fci-mode))
|
|
|
|
|
|
|
|
|
|
(defvar sanityinc/fci-mode-suppressed nil)
|
|
|
|
|
(make-variable-buffer-local 'sanityinc/fci-mode-suppressed)
|
|
|
|
|
|
|
|
|
|
(defadvice popup-create (before suppress-fci-mode activate)
|
|
|
|
|
"Suspend fci-mode while popups are visible"
|
|
|
|
|
(let ((fci-enabled (sanityinc/fci-enabled-p)))
|
|
|
|
|
(when fci-enabled
|
|
|
|
|
(setq sanityinc/fci-mode-suppressed fci-enabled)
|
|
|
|
|
(turn-off-fci-mode))))
|
|
|
|
|
|
|
|
|
|
(defadvice popup-delete (after restore-fci-mode activate)
|
|
|
|
|
"Restore fci-mode when all popups have closed"
|
|
|
|
|
(when (and sanityinc/fci-mode-suppressed
|
|
|
|
|
(null popup-instances))
|
|
|
|
|
(setq sanityinc/fci-mode-suppressed nil)
|
|
|
|
|
(turn-on-fci-mode)))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;;; Javascript
|
|
|
|
|
|
2018-08-31 19:31:14 +02:00
|
|
|
|
(require 'smartparens)
|
|
|
|
|
|
2018-03-30 00:10:07 +02:00
|
|
|
|
(setq js-indent-level 2)
|
|
|
|
|
|
|
|
|
|
(require 'prettier-js)
|
|
|
|
|
(after! prettier-js
|
|
|
|
|
(add-hook! rjsx-mode #'prettier-js-mode)
|
|
|
|
|
(add-hook! js2-mode #'prettier-js-mode)
|
|
|
|
|
(add-hook! json-mode #'prettier-js-mode)
|
|
|
|
|
(add-hook! css-mode #'prettier-js-mode))
|
|
|
|
|
|
2018-08-31 19:31:14 +02:00
|
|
|
|
(remove-hook 'js2-mode-hook 'tide-setup t)
|
|
|
|
|
|
|
|
|
|
;; Set this to the mode you use, I use rjsx-mode
|
|
|
|
|
(add-hook 'rjsx-mode-hook #'flow/set-flow-executable t)
|
|
|
|
|
|
2018-03-30 00:10:07 +02:00
|
|
|
|
|
|
|
|
|
;; Auto-format Haskell on save, with a combination of hindent + brittany
|
|
|
|
|
|
2019-02-27 20:08:47 +01:00
|
|
|
|
; (define-minor-mode brittany-haskell-mode
|
|
|
|
|
; :init-value nil
|
|
|
|
|
; :group 'haskell
|
|
|
|
|
; :lighter "Brittany-Haskell"
|
|
|
|
|
; :keymap '()
|
|
|
|
|
; )
|
2018-03-30 00:10:07 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(require 'alert)
|
|
|
|
|
(setq alert-default-style 'libnotify)
|
|
|
|
|
|
|
|
|
|
;; (setq slack-buffer-function #'switch-to-buffer)
|
|
|
|
|
|
|
|
|
|
(setq projectile-test-suffix-function
|
|
|
|
|
(lambda (project-type)
|
|
|
|
|
(case project-type
|
|
|
|
|
('haskell-stack "Test")
|
|
|
|
|
('npm ".test")
|
|
|
|
|
(otherwise (projectile-test-suffix project-type)))))
|
|
|
|
|
|
2019-01-05 20:15:48 +01:00
|
|
|
|
(setq projectile-create-missing-test-files 't)
|
|
|
|
|
|
2018-08-31 19:31:14 +02:00
|
|
|
|
(after! magit
|
2020-03-26 20:03:25 +01:00
|
|
|
|
(map! :map magit-mode-map
|
|
|
|
|
;; :n "] ]" #'magit-section-forward
|
|
|
|
|
;; :n "[ [" #'magit-section-backward
|
|
|
|
|
)
|
|
|
|
|
|
2019-02-27 20:08:47 +01:00
|
|
|
|
(define-suffix-command magit-commit-wip ()
|
|
|
|
|
(interactive)
|
|
|
|
|
(magit-commit-create '("-m" "wip")))
|
|
|
|
|
|
|
|
|
|
(transient-append-suffix
|
|
|
|
|
#'magit-commit
|
|
|
|
|
["c"]
|
2020-03-26 20:03:25 +01:00
|
|
|
|
(list "W" "Commit WIP" #'magit-commit-wip))
|
|
|
|
|
|
|
|
|
|
(define-suffix-command magit-reset-head-back ()
|
|
|
|
|
(interactive)
|
|
|
|
|
(magit-reset-mixed "HEAD~"))
|
|
|
|
|
|
|
|
|
|
(define-suffix-command magit-reset-head-previous ()
|
|
|
|
|
(interactive)
|
|
|
|
|
(magit-reset-mixed "HEAD@{1}"))
|
|
|
|
|
|
|
|
|
|
(transient-append-suffix
|
|
|
|
|
#'magit-reset
|
|
|
|
|
["f"]
|
|
|
|
|
(list "b" "Reset HEAD~" #'magit-reset-head-back))
|
|
|
|
|
(transient-append-suffix
|
|
|
|
|
#'magit-reset
|
|
|
|
|
["f"]
|
|
|
|
|
(list "o" "Reset HEAD@{1}" #'magit-reset-head-previous))
|
|
|
|
|
|
2021-06-05 17:04:45 +02:00
|
|
|
|
(defun magit-read-org-tracker-branch-name ()
|
|
|
|
|
(when-let ((issue-id (org-tracker-clocked-in-issue-id)))
|
2020-09-09 17:59:14 +02:00
|
|
|
|
(let ((desc
|
|
|
|
|
(magit-read-string-ns
|
2021-06-05 17:04:45 +02:00
|
|
|
|
(format "Issue description (to go after gs/%s/)"
|
|
|
|
|
issue-id))))
|
|
|
|
|
(format "gs/%s/%s" issue-id desc))))
|
2020-09-09 17:59:14 +02:00
|
|
|
|
|
2021-06-05 17:04:45 +02:00
|
|
|
|
(defun magit-read-org-tracker-branch-args ()
|
|
|
|
|
(if-let ((issue-id (org-tracker-clocked-in-issue-id)))
|
2020-03-26 20:03:25 +01:00
|
|
|
|
(let ((start-point (magit-read-starting-point
|
2021-06-05 17:04:45 +02:00
|
|
|
|
"Create and checkout branch for Tracker issue"
|
2020-03-26 20:03:25 +01:00
|
|
|
|
nil
|
|
|
|
|
"origin/master")))
|
|
|
|
|
(if (magit-rev-verify start-point)
|
2021-06-05 17:04:45 +02:00
|
|
|
|
(when-let ((desc (magit-read-org-tracker-branch-name)))
|
2020-09-23 17:13:10 +02:00
|
|
|
|
(list desc start-point))
|
2020-03-26 20:03:25 +01:00
|
|
|
|
(user-error "Not a valid starting point: %s" choice)))
|
2021-06-05 17:04:45 +02:00
|
|
|
|
(user-error "No currently clocked-in tracker issue")))
|
2020-03-26 20:03:25 +01:00
|
|
|
|
|
2021-06-05 17:04:45 +02:00
|
|
|
|
(transient-define-suffix magit-checkout-org-tracker-branch (branch start-point)
|
|
|
|
|
(interactive (magit-read-org-tracker-branch-args))
|
2020-03-26 20:03:25 +01:00
|
|
|
|
(magit-branch-and-checkout branch start-point))
|
|
|
|
|
|
2021-06-05 17:04:45 +02:00
|
|
|
|
(transient-define-suffix magit-rename-org-tracker-branch (old new)
|
2020-09-09 17:59:14 +02:00
|
|
|
|
(interactive
|
|
|
|
|
(let ((branch (magit-read-local-branch "Rename branch")))
|
2021-06-05 17:04:45 +02:00
|
|
|
|
(list branch (magit-read-org-tracker-branch-name))))
|
2020-09-09 17:59:14 +02:00
|
|
|
|
(when (and old new)
|
|
|
|
|
(magit-branch-rename old new)))
|
|
|
|
|
|
2020-03-26 20:03:25 +01:00
|
|
|
|
(transient-append-suffix
|
|
|
|
|
#'magit-branch
|
|
|
|
|
["c"]
|
2021-06-05 17:04:45 +02:00
|
|
|
|
(list "C" "Checkout Tracker branch" #'magit-checkout-org-tracker-branch))
|
2020-09-09 17:59:14 +02:00
|
|
|
|
(transient-append-suffix
|
|
|
|
|
#'magit-branch
|
|
|
|
|
["c"]
|
2021-06-05 17:04:45 +02:00
|
|
|
|
(list "M" "Rename branch to Tracker ticket" #'magit-rename-org-tracker-branch)))
|
2018-03-30 00:10:07 +02:00
|
|
|
|
|
|
|
|
|
;; (defun grfn/split-window-more-sensibly (&optional window)
|
|
|
|
|
;; (let ((window (or window (selected-window))))
|
|
|
|
|
;; (or (and (window-splittable-p window)
|
|
|
|
|
;; ;; Split window vertically.
|
|
|
|
|
;; (with-selected-window window
|
|
|
|
|
;; (split-window-right)))
|
|
|
|
|
;; (and (window-splittable-p window t)
|
|
|
|
|
;; ;; Split window horizontally.
|
|
|
|
|
;; (with-selected-window window
|
|
|
|
|
;; (split-window-right)))
|
|
|
|
|
;; (and (eq window (frame-root-window (window-frame window)))
|
|
|
|
|
;; (not (window-minibuffer-p window))
|
|
|
|
|
;; ;; If WINDOW is the only window on its frame and is not the
|
|
|
|
|
;; ;; minibuffer window, try to split it vertically disregarding
|
|
|
|
|
;; ;; the value of `split-height-threshold'.
|
|
|
|
|
;; (let ((split-height-threshold 0))
|
|
|
|
|
;; (when (window-splittable-p window)
|
|
|
|
|
;; (with-selected-window window
|
|
|
|
|
;; (split-window-below))))))))
|
|
|
|
|
|
2020-03-26 20:03:25 +01:00
|
|
|
|
(use-package! lsp-mode
|
|
|
|
|
:after (:any haskell-mode)
|
|
|
|
|
:config
|
|
|
|
|
(setq lsp-response-timeout 60)
|
|
|
|
|
:hook
|
|
|
|
|
(haskell-mode . lsp-mode))
|
2018-09-18 16:18:20 +02:00
|
|
|
|
|
2020-03-26 20:03:25 +01:00
|
|
|
|
(use-package! lsp-ui
|
|
|
|
|
:after lsp-mode
|
|
|
|
|
:config
|
|
|
|
|
(defun +grfn/lsp-ui-doc-frame-hook (frame window)
|
|
|
|
|
(set-frame-font (if doom-big-font-mode doom-big-font doom-font)
|
|
|
|
|
nil (list frame)))
|
|
|
|
|
(setq lsp-ui-flycheck-enable t
|
|
|
|
|
lsp-ui-doc-header nil
|
|
|
|
|
lsp-ui-doc-position 'top
|
|
|
|
|
lsp-ui-doc-alignment 'window
|
2021-01-13 16:09:03 +01:00
|
|
|
|
lsp-ui-doc-frame-hook '+grfn/lsp-ui-doc-frame-hook
|
|
|
|
|
lsp-ui-doc-max-width 150
|
|
|
|
|
lsp-ui-doc-max-height 13)
|
2020-03-26 20:03:25 +01:00
|
|
|
|
(setq imenu-auto-rescan t)
|
|
|
|
|
(set-face-background 'lsp-ui-doc-background +solarized-s-base2)
|
|
|
|
|
(set-face-background 'lsp-face-highlight-read +solarized-s-base2)
|
|
|
|
|
(set-face-background 'lsp-face-highlight-write +solarized-s-base2)
|
|
|
|
|
:hook
|
|
|
|
|
(lsp-mode . lsp-ui-mode)
|
|
|
|
|
(lsp-ui-mode . flycheck-mode))
|
|
|
|
|
|
|
|
|
|
(use-package! company-lsp
|
|
|
|
|
:after (lsp-mode lsp-ui)
|
|
|
|
|
:config
|
2020-05-18 17:33:27 +02:00
|
|
|
|
(add-to-list #'company-backends #'company-lsp)
|
2020-03-26 20:03:25 +01:00
|
|
|
|
(setq company-lsp-async t))
|
|
|
|
|
|
|
|
|
|
(defun +grfn/haskell-mode-setup ()
|
|
|
|
|
(interactive)
|
|
|
|
|
(flymake-mode -1)
|
2020-07-04 17:28:02 +02:00
|
|
|
|
(add-to-list 'flycheck-disabled-checkers 'haskell-ghc)
|
|
|
|
|
|
|
|
|
|
(flycheck-remove-next-checker 'lsp 'haskell-ghc)
|
|
|
|
|
(flycheck-add-next-checker 'lsp '(warning . haskell-hlint))
|
|
|
|
|
|
2020-03-26 20:03:25 +01:00
|
|
|
|
;; If there’s a 'hie.sh' defined locally by a project
|
|
|
|
|
;; (e.g. to run HIE in a nix-shell), use it…
|
2020-07-03 05:20:21 +02:00
|
|
|
|
(when-let ((project-dir (locate-dominating-file default-directory "hie.sh")))
|
|
|
|
|
(cl-flet
|
|
|
|
|
((which (cmd)
|
|
|
|
|
(s-trim
|
|
|
|
|
(shell-command-to-string
|
|
|
|
|
(concat
|
|
|
|
|
"nix-shell "
|
|
|
|
|
(expand-file-name "shell.nix" project-dir)
|
|
|
|
|
" --run \"which " cmd "\" 2>/dev/null")))))
|
2020-03-26 20:03:25 +01:00
|
|
|
|
(setq-local
|
2020-07-03 05:20:21 +02:00
|
|
|
|
lsp-haskell-process-path-hie (expand-file-name "hie.sh" project-dir)
|
|
|
|
|
haskell-hoogle-command (which "hoogle"))))
|
2020-03-26 20:03:25 +01:00
|
|
|
|
;; … and only then setup the LSP.
|
|
|
|
|
(lsp))
|
|
|
|
|
|
|
|
|
|
(defun never-flymake-mode (orig &rest args)
|
|
|
|
|
(when (and (bound-and-true-p flymake-mode))
|
|
|
|
|
(funcall orig 0)
|
|
|
|
|
(message "disabled flymake-mode")))
|
|
|
|
|
(advice-add #'flymake-mode :around #'never-flymake-mode)
|
|
|
|
|
|
2020-07-03 23:38:40 +02:00
|
|
|
|
(defun +grfn/wrap-lsp-haskell-process (argv)
|
|
|
|
|
(let* ((project-dir (locate-dominating-file
|
|
|
|
|
(buffer-file-name)
|
|
|
|
|
"hie.yaml"))
|
|
|
|
|
(shell-dot-nix (expand-file-name "shell.nix" project-dir)))
|
|
|
|
|
;; (when (string-equal default-directory "/home/grfn/code/depot")
|
|
|
|
|
;; (debug))
|
|
|
|
|
(message "%s %s %s %s"
|
|
|
|
|
(buffer-file-name)
|
|
|
|
|
default-directory
|
|
|
|
|
project-dir
|
|
|
|
|
shell-dot-nix)
|
|
|
|
|
(if (file-exists-p shell-dot-nix)
|
|
|
|
|
`("bash" "-c"
|
|
|
|
|
,(format "cd %s && nix-shell %s --run '%s'"
|
|
|
|
|
project-dir
|
|
|
|
|
shell-dot-nix
|
|
|
|
|
(s-join " " argv)))
|
|
|
|
|
argv)))
|
|
|
|
|
|
2020-03-26 20:03:25 +01:00
|
|
|
|
(use-package! lsp-haskell
|
|
|
|
|
:after (lsp-mode lsp-ui haskell-mode)
|
|
|
|
|
;; :hook
|
|
|
|
|
;; (haskell-mode . lsp-haskell-enable)
|
|
|
|
|
:config
|
2020-07-03 19:46:29 +02:00
|
|
|
|
(setq lsp-haskell-process-path-hie "haskell-language-server-wrapper"
|
|
|
|
|
lsp-haskell-process-args-hie
|
2020-07-03 23:38:40 +02:00
|
|
|
|
'("-d" "-l" "/tmp/hie.log" "+RTS" "-M4G" "-H1G" "-K4G" "-A16M" "-RTS")
|
|
|
|
|
lsp-haskell-process-wrapper-function
|
|
|
|
|
#'+grfn/wrap-lsp-haskell-process)
|
2020-07-03 19:46:29 +02:00
|
|
|
|
(add-hook 'haskell-mode-hook #'+grfn/haskell-mode-setup 't))
|
2018-09-18 16:18:20 +02:00
|
|
|
|
|
2020-03-26 20:03:25 +01:00
|
|
|
|
(use-package! lsp-imenu
|
|
|
|
|
:after (lsp-mode lsp-ui)
|
|
|
|
|
:hook
|
|
|
|
|
(lsp-after-open . lsp-enable-imenu))
|
|
|
|
|
|
|
|
|
|
;; (use-package! counsel-etags
|
|
|
|
|
;; :ensure t
|
|
|
|
|
;; :init
|
|
|
|
|
;; (add-hook 'haskell-mode-hook
|
|
|
|
|
;; (lambda ()
|
|
|
|
|
;; (add-hook 'after-save-hook
|
|
|
|
|
;; 'counsel-etags-virtual-update-tags 'append 'local)))
|
|
|
|
|
;; :config
|
|
|
|
|
;; (setq counsel-etags-update-interval 60)
|
|
|
|
|
;; ;; (push "build" counsel-etags-ignore-directories)
|
|
|
|
|
;; )
|
2018-03-30 00:10:07 +02:00
|
|
|
|
|
2020-12-14 18:53:02 +01:00
|
|
|
|
;; (use-package! evil-magit
|
|
|
|
|
;; :after (magit))
|
2018-03-30 00:10:07 +02:00
|
|
|
|
|
2020-03-26 20:03:25 +01:00
|
|
|
|
(use-package! writeroom-mode)
|
2018-08-31 19:31:14 +02:00
|
|
|
|
|
2020-03-26 20:03:25 +01:00
|
|
|
|
(use-package! graphql-mode)
|
2018-08-31 19:31:14 +02:00
|
|
|
|
|
2021-07-15 15:00:37 +02:00
|
|
|
|
|
2018-08-31 19:31:14 +02:00
|
|
|
|
(require 'whitespace)
|
|
|
|
|
(setq whitespace-style '(face lines-tail))
|
|
|
|
|
(global-whitespace-mode t)
|
2019-01-05 20:15:48 +01:00
|
|
|
|
(add-hook 'org-mode-hook (lambda () (whitespace-mode -1)) t)
|
2018-08-31 19:31:14 +02:00
|
|
|
|
|
|
|
|
|
(set-face-foreground 'whitespace-line +solarized-red)
|
|
|
|
|
(set-face-attribute 'whitespace-line nil :underline 't)
|
|
|
|
|
|
|
|
|
|
;; (set-face-background 'ivy-posframe +solarized-s-base3)
|
|
|
|
|
;; (set-face-foreground 'ivy-posframe +solarized-s-base01)
|
|
|
|
|
|
|
|
|
|
(let ((base03 "#002b36")
|
|
|
|
|
(base02 "#073642")
|
|
|
|
|
(base01 "#586e75")
|
|
|
|
|
(base00 "#657b83")
|
|
|
|
|
(base0 "#839496")
|
|
|
|
|
(base1 "#93a1a1")
|
|
|
|
|
(base2 "#eee8d5")
|
|
|
|
|
(base3 "#fdf6e3")
|
|
|
|
|
(yellow "#b58900")
|
|
|
|
|
(orange "#cb4b16")
|
|
|
|
|
(red "#dc322f")
|
|
|
|
|
(magenta "#d33682")
|
|
|
|
|
(violet "#6c71c4")
|
|
|
|
|
(blue "#268bd2")
|
|
|
|
|
(cyan "#2aa198")
|
|
|
|
|
(green "#859900"))
|
|
|
|
|
(custom-set-faces
|
|
|
|
|
`(agda2-highlight-keyword-face ((t (:foreground ,green))))
|
|
|
|
|
`(agda2-highlight-string-face ((t (:foreground ,cyan))))
|
|
|
|
|
`(agda2-highlight-number-face ((t (:foreground ,violet))))
|
|
|
|
|
`(agda2-highlight-symbol-face ((((background ,base3)) (:foreground ,base01))))
|
|
|
|
|
`(agda2-highlight-primitive-type-face ((t (:foreground ,blue))))
|
|
|
|
|
`(agda2-highlight-bound-variable-face ((t nil)))
|
|
|
|
|
`(agda2-highlight-inductive-constructor-face ((t (:foreground ,green))))
|
|
|
|
|
`(agda2-highlight-coinductive-constructor-face ((t (:foreground ,yellow))))
|
|
|
|
|
`(agda2-highlight-datatype-face ((t (:foreground ,blue))))
|
|
|
|
|
`(agda2-highlight-field-face ((t (:foreground ,red))))
|
|
|
|
|
`(agda2-highlight-function-face ((t (:foreground ,blue))))
|
|
|
|
|
`(agda2-highlight-module-face ((t (:foreground ,yellow))))
|
|
|
|
|
`(agda2-highlight-postulate-face ((t (:foreground ,blue))))
|
|
|
|
|
`(agda2-highlight-primitive-face ((t (:foreground ,blue))))
|
|
|
|
|
`(agda2-highlight-record-face ((t (:foreground ,blue))))
|
|
|
|
|
`(agda2-highlight-dotted-face ((t nil)))
|
|
|
|
|
`(agda2-highlight-operator-face ((t nil)))
|
|
|
|
|
`(agda2-highlight-error-face ((t (:foreground ,red :underline t))))
|
|
|
|
|
`(agda2-highlight-unsolved-meta-face ((t (:background ,base2))))
|
|
|
|
|
`(agda2-highlight-unsolved-constraint-face ((t (:background ,base2))))
|
|
|
|
|
`(agda2-highlight-termination-problem-face ((t (:background ,orange :foreground ,base03))))
|
|
|
|
|
`(agda2-highlight-incomplete-pattern-face ((t (:background ,orange :foreground ,base03))))
|
|
|
|
|
`(agda2-highlight-typechecks-face ((t (:background ,cyan :foreground ,base03))))))
|
2018-11-21 18:45:05 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(after! cider
|
|
|
|
|
(setq cider-prompt-for-symbol nil
|
|
|
|
|
cider-font-lock-dynamically 't
|
|
|
|
|
cider-save-file-on-load 't)
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
(defun +org-clocked-in-element ()
|
|
|
|
|
(when-let ((item (car org-clock-history)))
|
|
|
|
|
(save-mark-and-excursion
|
|
|
|
|
(with-current-buffer (marker-buffer item)
|
|
|
|
|
(goto-char (marker-position item))
|
|
|
|
|
(org-element-at-point)))))
|
|
|
|
|
|
|
|
|
|
(comment
|
|
|
|
|
(setq elt (+org-clocked-in-item))
|
|
|
|
|
|
|
|
|
|
(eq 'headline (car elt))
|
|
|
|
|
(plist-get (cadr elt) :raw-value)
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
(defun +org-headline-title (headline)
|
|
|
|
|
(when (eq 'headline (car elt))
|
|
|
|
|
(plist-get (cadr elt) :raw-value)))
|
|
|
|
|
|
2022-01-18 00:04:43 +01:00
|
|
|
|
;; (setq +ligatures-extra-symbols
|
|
|
|
|
;; (append +ligatures-extra-symbols
|
|
|
|
|
;; '(:equal "≡"
|
|
|
|
|
;; :not-equal "≠"
|
|
|
|
|
;; :is "≣"
|
|
|
|
|
;; :isnt "≢"
|
|
|
|
|
;; :lte "≤"
|
|
|
|
|
;; :gte "≥"
|
|
|
|
|
;; :subseteq "⊆"
|
|
|
|
|
;; )))
|
|
|
|
|
|
|
|
|
|
;; (after! python
|
|
|
|
|
;; (set-pretty-symbols! 'python-mode :merge t
|
|
|
|
|
;; :equal "=="
|
|
|
|
|
;; :not-equal "!="
|
|
|
|
|
;; :lte "<="
|
|
|
|
|
;; :gte ">="
|
|
|
|
|
;; :is "is"
|
|
|
|
|
;; :isnt "is not"
|
|
|
|
|
;; :subseteq "issubset"
|
|
|
|
|
|
|
|
|
|
;; ;; doom builtins
|
|
|
|
|
|
|
|
|
|
;; ;; Functional
|
|
|
|
|
;; :def "def"
|
|
|
|
|
;; :lambda "lambda"
|
|
|
|
|
;; ;; Types
|
|
|
|
|
;; :null "None"
|
|
|
|
|
;; :true "True" :false "False"
|
|
|
|
|
;; :int "int" :str "str"
|
|
|
|
|
;; :float "float"
|
|
|
|
|
;; :bool "bool"
|
|
|
|
|
;; :tuple "tuple"
|
|
|
|
|
;; ;; Flow
|
|
|
|
|
;; :not "not"
|
|
|
|
|
;; :in "in" :not-in "not in"
|
|
|
|
|
;; :and "and" :or "or"
|
|
|
|
|
;; :for "for"
|
|
|
|
|
;; :return "return" :yield "yield"))
|
2018-11-21 18:45:05 +01:00
|
|
|
|
|
2020-03-26 20:03:25 +01:00
|
|
|
|
(use-package! sqlup-mode
|
2018-11-21 18:45:05 +01:00
|
|
|
|
:hook
|
|
|
|
|
(sql-mode-hook . sqlup-mode)
|
|
|
|
|
(sql-interactive-mode-hook . sqlup-mode))
|
2019-01-05 20:15:48 +01:00
|
|
|
|
|
2020-03-26 20:03:25 +01:00
|
|
|
|
(use-package! emacsql)
|
|
|
|
|
(use-package! emacsql-psql
|
2019-03-11 03:23:45 +01:00
|
|
|
|
:after (emacsql))
|
|
|
|
|
|
2020-03-26 20:03:25 +01:00
|
|
|
|
(use-package! pyimport
|
|
|
|
|
:after (python))
|
2019-01-05 20:15:48 +01:00
|
|
|
|
|
2020-05-18 17:32:51 +02:00
|
|
|
|
(use-package! blacken
|
2020-03-26 20:03:25 +01:00
|
|
|
|
:after (python)
|
|
|
|
|
:init
|
2020-05-18 17:32:51 +02:00
|
|
|
|
(add-hook #'python-mode-hook #'blacken-mode)
|
2020-03-26 20:03:25 +01:00
|
|
|
|
:config
|
2020-05-18 17:32:51 +02:00
|
|
|
|
(setq blacken-only-if-project-is-blackened t
|
|
|
|
|
blacken-allow-py36 t
|
|
|
|
|
blacken-line-length 100))
|
|
|
|
|
|
|
|
|
|
(after! python
|
|
|
|
|
(defun +python-setup ()
|
|
|
|
|
(setq-local fill-column 100
|
|
|
|
|
whitespace-line-column 100
|
|
|
|
|
flycheck-disabled-checkers '(python-flake8)
|
|
|
|
|
flycheck-checker 'python-pylint))
|
|
|
|
|
|
|
|
|
|
(add-hook #'python-mode-hook #'+python-setup)
|
|
|
|
|
(add-hook #'python-mode-hook #'lsp)
|
|
|
|
|
(remove-hook #'python-mode-hook #'pipenv-mode))
|
|
|
|
|
|
|
|
|
|
; (use-package! w3m
|
|
|
|
|
; :config
|
|
|
|
|
; (setq browse-url-browser-function
|
|
|
|
|
; `(("^https://app.clubhouse.io.*" . browse-url-firefox)
|
|
|
|
|
; ("^https://github.com.*" . browse-url-firefox)
|
|
|
|
|
; (".*" . browse-url-firefox))))
|
2020-03-26 20:03:25 +01:00
|
|
|
|
|
|
|
|
|
(use-package! ob-http
|
2019-01-05 20:15:48 +01:00
|
|
|
|
:config
|
|
|
|
|
(add-to-list 'org-babel-load-languages '(http . t)))
|
|
|
|
|
|
2020-05-18 17:32:51 +02:00
|
|
|
|
;; (use-package! ob-ipython
|
|
|
|
|
;; :after (pyimport)
|
|
|
|
|
;; :config
|
|
|
|
|
;; (add-to-list 'org-babel-load-languages '(ipython . t))
|
|
|
|
|
;; (setq ob-ipython-command
|
|
|
|
|
;; "/home/griffin/code/urb/ciml-video-classifier/bin/jupyter"))
|
2019-02-27 20:08:47 +01:00
|
|
|
|
|
2020-03-26 20:03:25 +01:00
|
|
|
|
(use-package! counsel-spotify)
|
|
|
|
|
|
|
|
|
|
(after! counsel
|
|
|
|
|
(map! [remap counsel-org-capture] #'org-capture
|
|
|
|
|
[remap org-capture] #'org-capture))
|
2019-02-27 20:08:47 +01:00
|
|
|
|
|
2020-03-26 20:03:25 +01:00
|
|
|
|
(use-package! evil-snipe :disabled t)
|
2019-02-27 20:08:47 +01:00
|
|
|
|
(evil-snipe-mode -1)
|
|
|
|
|
|
2020-03-26 20:03:25 +01:00
|
|
|
|
(use-package! rainbow-mode)
|
2019-02-27 20:08:47 +01:00
|
|
|
|
|
2020-03-26 20:03:25 +01:00
|
|
|
|
(use-package! org-alert
|
|
|
|
|
:disabled t
|
2019-02-27 20:08:47 +01:00
|
|
|
|
:config
|
|
|
|
|
(org-alert-enable)
|
|
|
|
|
(setq alert-default-style 'libnotify
|
|
|
|
|
org-alert-headline-title "org"))
|
|
|
|
|
|
2020-03-26 20:03:25 +01:00
|
|
|
|
(use-package! ob-async)
|
2019-02-27 20:08:47 +01:00
|
|
|
|
|
2020-03-26 20:03:25 +01:00
|
|
|
|
(use-package! org-recent-headings
|
2019-03-25 01:52:35 +01:00
|
|
|
|
:config
|
|
|
|
|
(map! :n "SPC n r" #'org-recent-headings-ivy))
|
|
|
|
|
|
2020-03-26 20:03:25 +01:00
|
|
|
|
(use-package! org-sticky-header
|
2019-03-25 01:52:35 +01:00
|
|
|
|
:after (org)
|
|
|
|
|
:hook (org-mode-hook . org-sticky-header-mode)
|
|
|
|
|
:config
|
|
|
|
|
(setq-default org-sticky-header-heading-star "●"))
|
|
|
|
|
|
2019-02-27 20:08:47 +01:00
|
|
|
|
(enable-theme 'grfn-solarized-light)
|
2019-03-25 01:52:35 +01:00
|
|
|
|
|
2021-07-15 15:00:37 +02:00
|
|
|
|
;;; this needs to be *after the theme*, or else I get no agenda items.
|
|
|
|
|
;;; whuuu??
|
|
|
|
|
(load! "org-config")
|
|
|
|
|
|
|
|
|
|
|
2019-03-25 01:52:35 +01:00
|
|
|
|
;;; word-char
|
|
|
|
|
(add-hook! prog-mode
|
|
|
|
|
(modify-syntax-entry ?_ "w"))
|
|
|
|
|
|
|
|
|
|
(add-hook! lisp-mode
|
|
|
|
|
(modify-syntax-entry ?- "w"))
|
|
|
|
|
|
|
|
|
|
(after! flycheck
|
2021-07-06 20:18:03 +02:00
|
|
|
|
(put 'flycheck-python-pylint-executable 'safe-local-variable (lambda (_) t))
|
|
|
|
|
(setq flycheck-error-list-minimum-level 'warn
|
|
|
|
|
flycheck-navigation-minimum-level 'warn))
|
2019-03-25 01:52:35 +01:00
|
|
|
|
|
|
|
|
|
(defvar alembic-command "alembic"
|
|
|
|
|
"Command to execute when running alembic")
|
|
|
|
|
|
|
|
|
|
(defvar alembic-dir-fun (lambda () default-directory)
|
|
|
|
|
"Reference to a function whose return value will be used as the directory to
|
|
|
|
|
run Alembic in")
|
|
|
|
|
|
2020-03-26 20:03:25 +01:00
|
|
|
|
(put 'alembic-command 'safe-local-variable (lambda (_) t))
|
|
|
|
|
(put 'alembic-dir-fun 'safe-local-variable (lambda (_) t))
|
|
|
|
|
|
|
|
|
|
(defun make-alembic-command (args)
|
|
|
|
|
(if (functionp alembic-command)
|
|
|
|
|
(funcall alembic-command args)
|
|
|
|
|
(concat alembic-command " " args)))
|
2019-03-25 01:52:35 +01:00
|
|
|
|
|
|
|
|
|
(defun +grfn/extract-alembic-migration-name (output)
|
2020-05-18 17:33:34 +02:00
|
|
|
|
(unless (string-match (rx (0+ anything) "Generating "
|
|
|
|
|
(group (one-or-more (not (syntax whitespace))))
|
|
|
|
|
" ..." (one-or-more (syntax whitespace)) "done"
|
|
|
|
|
(0+ anything))
|
|
|
|
|
output)
|
|
|
|
|
(user-error "Error: %s" output))
|
2019-03-25 01:52:35 +01:00
|
|
|
|
(match-string-no-properties 1 output))
|
|
|
|
|
|
2020-03-26 20:03:25 +01:00
|
|
|
|
(defun -run-alembic (args)
|
2019-03-25 01:52:35 +01:00
|
|
|
|
(let* ((default-directory (funcall alembic-dir-fun))
|
2020-03-26 20:03:25 +01:00
|
|
|
|
(command (make-alembic-command args))
|
|
|
|
|
;; (format "nix-shell --run 'alembic %s'" args)
|
|
|
|
|
;; (format "%s %s" alembic-command args)
|
|
|
|
|
(res
|
|
|
|
|
(with-temp-buffer
|
|
|
|
|
(cons
|
|
|
|
|
(shell-command command t)
|
|
|
|
|
(s-replace-regexp
|
|
|
|
|
"^.*Nix search path entry.*$" ""
|
|
|
|
|
(buffer-string)))))
|
|
|
|
|
(exit-code (car res))
|
|
|
|
|
(out (cdr res)))
|
|
|
|
|
;; (if (= 0 exit-code)
|
|
|
|
|
;; out
|
|
|
|
|
;; (error "Error running %s: %s" command out))
|
|
|
|
|
out
|
|
|
|
|
))
|
|
|
|
|
|
|
|
|
|
(comment
|
|
|
|
|
--exit-code
|
|
|
|
|
--bs
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
(defun run-alembic (args)
|
|
|
|
|
(interactive "sAlembic command: ")
|
|
|
|
|
(message "%s" (-run-alembic args)))
|
|
|
|
|
|
|
|
|
|
(defun generate-alembic-migration (msg &rest args)
|
|
|
|
|
(interactive "sMessage: ")
|
|
|
|
|
(->
|
|
|
|
|
(format "revision %s -m \"%s\""
|
|
|
|
|
(s-join " " args)
|
|
|
|
|
msg)
|
|
|
|
|
(-run-alembic)
|
|
|
|
|
(+grfn/extract-alembic-migration-name)
|
|
|
|
|
(find-file-other-window)))
|
|
|
|
|
|
|
|
|
|
(cl-defun alembic-upgrade (&optional revision &key namespace)
|
|
|
|
|
(interactive "sRevision: ")
|
2019-03-25 01:52:35 +01:00
|
|
|
|
(let ((default-directory (funcall alembic-dir-fun)))
|
2020-03-26 20:03:25 +01:00
|
|
|
|
(run-alembic (format "%s upgrade %s"
|
|
|
|
|
(if namespace (concat "-n " namespace) "")
|
|
|
|
|
(or revision "head")))))
|
|
|
|
|
|
|
|
|
|
(defun alembic-downgrade (revision)
|
|
|
|
|
(interactive "sRevision: ")
|
|
|
|
|
(let ((default-directory (funcall alembic-dir-fun)))
|
|
|
|
|
(run-alembic (format "downgrade %s" (or revision "head")))))
|
|
|
|
|
|
|
|
|
|
(use-package! gnuplot)
|
|
|
|
|
(use-package! gnuplot-mode :after gnuplot)
|
|
|
|
|
(use-package! string-inflection)
|
|
|
|
|
|
|
|
|
|
(after! anaconda-mode
|
2020-05-18 17:32:51 +02:00
|
|
|
|
;; (set-company-backend! 'anaconda-mode #'company-yasnippet)
|
|
|
|
|
)
|
2020-03-26 20:03:25 +01:00
|
|
|
|
|
|
|
|
|
;; (add-hook! python-mode
|
|
|
|
|
;; (capf))
|
|
|
|
|
|
|
|
|
|
(cl-defstruct pull-request url number title author repository)
|
|
|
|
|
|
|
|
|
|
(defun grfn/num-inbox-items ()
|
|
|
|
|
(length (org-elements-agenda-match "inbox" t)))
|
|
|
|
|
|
|
|
|
|
(use-package! dhall-mode
|
|
|
|
|
:mode "\\.dhall\\'")
|
|
|
|
|
|
|
|
|
|
(use-package! github-review
|
|
|
|
|
:after forge)
|
|
|
|
|
|
2020-08-20 19:37:53 +02:00
|
|
|
|
(after! forge
|
|
|
|
|
(set-popup-rule!
|
|
|
|
|
"^\\*forge"
|
|
|
|
|
:size 0.75))
|
|
|
|
|
|
2020-03-26 20:03:25 +01:00
|
|
|
|
(defun grfn/org-add-db-connection-params ()
|
|
|
|
|
(interactive)
|
|
|
|
|
(ivy-read
|
|
|
|
|
"DB to connect to: "
|
|
|
|
|
(-map (lambda (opts)
|
|
|
|
|
(propertize (symbol-name (car opts))
|
|
|
|
|
'header-args (cdr opts)))
|
|
|
|
|
db-connection-param-options)
|
|
|
|
|
:require-match t
|
|
|
|
|
:action
|
|
|
|
|
(lambda (opt)
|
|
|
|
|
(let ((header-args (get-text-property 0 'header-args opt)))
|
|
|
|
|
(org-set-property "header-args" header-args)))))
|
|
|
|
|
|
|
|
|
|
(use-package! kubernetes
|
|
|
|
|
:commands (kubernetes-overview))
|
|
|
|
|
|
|
|
|
|
(use-package! k8s-mode
|
|
|
|
|
:hook (k8s-mode . yas-minor-mode))
|
|
|
|
|
|
|
|
|
|
(use-package! sx)
|
|
|
|
|
|
|
|
|
|
;; (use-package! nix-update
|
|
|
|
|
;; :config
|
|
|
|
|
;; (map! (:map nix-mode-map
|
|
|
|
|
;; (:leader
|
|
|
|
|
;; :desc "Update fetcher" :nv #'nix-update-fetch))))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(after! lsp-haskell
|
|
|
|
|
(lsp-register-client
|
|
|
|
|
(make-lsp--client
|
|
|
|
|
:new-connection (lsp-stdio-connection (lambda () (lsp-haskell--hie-command)))
|
|
|
|
|
:major-modes '(haskell-mode)
|
|
|
|
|
:server-id 'hie
|
|
|
|
|
;; :multi-root t
|
|
|
|
|
;; :initialization-options 'lsp-haskell--make-init-options
|
|
|
|
|
)
|
|
|
|
|
)
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
(solaire-global-mode -1)
|
|
|
|
|
|
|
|
|
|
(use-package! wsd-mode)
|
|
|
|
|
|
|
|
|
|
(use-package! metal-mercury-mode)
|
|
|
|
|
(use-package! flycheck-mercury
|
|
|
|
|
:after (metal-mercury-mode flycheck-mercury))
|
2020-05-18 17:32:51 +02:00
|
|
|
|
|
|
|
|
|
(use-package! direnv
|
|
|
|
|
:config (direnv-mode))
|
|
|
|
|
|
|
|
|
|
(after! erc
|
|
|
|
|
;; (setq erc-autojoin-channels-alist '(("freenode.net" "#nixos" "#haskell" "##tvl")))
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
(defun evil-disable-insert-state-bindings ()
|
|
|
|
|
evil-disable-insert-state-bindings)
|
|
|
|
|
|
|
|
|
|
;; (use-package! terraform-mode)
|
|
|
|
|
;; (use-package! company-terraform
|
|
|
|
|
;; :after terraform-mode
|
|
|
|
|
;; :config (company-terraform-init))
|
|
|
|
|
|
|
|
|
|
(use-package! znc
|
|
|
|
|
:config
|
|
|
|
|
(setq znc-servers
|
|
|
|
|
'(("znc.gws.fyi" 5000 t
|
|
|
|
|
((freenode "glittershark" "Ompquy"))))))
|
2020-06-23 18:43:00 +02:00
|
|
|
|
|
|
|
|
|
(use-package! jsonnet-mode
|
2020-07-03 05:27:40 +02:00
|
|
|
|
:config
|
|
|
|
|
(map!
|
|
|
|
|
(:map jsonnet-mode-map
|
|
|
|
|
(:n "g SPC" #'jsonnet-eval-buffer))))
|
2020-07-20 17:14:59 +02:00
|
|
|
|
|
|
|
|
|
(add-to-list 'safe-local-variable-values
|
|
|
|
|
'(truncate-lines . t))
|
2021-08-07 20:07:34 +02:00
|
|
|
|
|
|
|
|
|
(set-popup-rule!
|
|
|
|
|
"^\\*gud-"
|
|
|
|
|
:quit nil)
|