summaryrefslogtreecommitdiff
path: root/emacs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--emacs897
-rw-r--r--emacs.d/custom.el0
2 files changed, 897 insertions, 0 deletions
diff --git a/emacs b/emacs
new file mode 100644
index 0000000..331c58c
--- /dev/null
+++ b/emacs
@@ -0,0 +1,897 @@
+(menu-bar-mode -1)
+(tool-bar-mode -1)
+(scroll-bar-mode -1)
+(pixel-scroll-mode)
+
+(require 'package)
+(setq frame-title-format
+ `((buffer-file-name "%f" "%b")
+ ,(format " - Emacs" )))
+
+(with-eval-after-load 'package
+ (add-to-list 'package-archives '("nongnu" . "https://elpa.nongnu.org/nongnu/")))
+(with-eval-after-load 'package
+ (add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/")))
+(package-initialize t)
+(setq url-http-attempt-keepalives nil)
+(when (not package-archive-contents)
+ (package-refresh-contents))
+
+(setq kill-whole-line t)
+
+;; wl-copy
+(setq wl-copy-process nil)
+(defun wl-copy (text)
+ (setq wl-copy-process (make-process :name "wl-copy"
+ :buffer nil
+ :command '("wl-copy")
+ :connection-type 'pipe
+ :noquery t))
+ (process-send-string wl-copy-process text)
+ (process-send-eof wl-copy-process))
+
+(defun wl-paste ()
+ (if (and wl-copy-process (process-live-p wl-copy-process))
+ nil
+ (shell-command-to-string "wl-paste -n | tr -d \r")))
+
+(setq interprogram-cut-function 'wl-copy
+ interprogram-paste-function 'wl-paste)
+
+;; God mode
+(unless (package-installed-p 'god-mode)
+ (package-install 'god-mode))
+
+(require 'god-mode)
+(god-mode-all)
+(global-set-key (kbd "<escape>") #'god-local-mode)
+(define-key god-local-mode-map (kbd "i") #'god-local-mode)
+(define-key god-local-mode-map (kbd ".") #'repeat)
+(global-set-key (kbd "C-x C-1") #'delete-other-windows)
+(define-key god-local-mode-map (kbd "[") #'next-buffer)
+(define-key god-local-mode-map (kbd "]") #'previous-buffer)
+
+;; Expand-region
+(unless (package-installed-p 'expand-region)
+ (package-install 'expand-region))
+(require 'expand-region)
+
+(global-set-key (kbd "C-,") 'er/expand-region)
+;; Keybindings
+(global-set-key (kbd "C-c C-k") #'eldoc)
+(define-key god-local-mode-map (kbd "C-c d [") #'flymake-goto-prev-error)
+(define-key god-local-mode-map (kbd "C-c d ]") #'flymake-goto-next-error)
+(define-key god-local-mode-map (kbd "C-c v ]") #'diff-hl-next-hunk)
+(define-key god-local-mode-map (kbd "C-c v [") #'diff-hl-prev-hunk)
+
+
+(defun m/newline-insert-above ()
+ "Create line above, exit god mode"
+ (interactive)
+ (beginning-of-line)
+ (newline-and-indent)
+ (previous-line)
+ (god-local-mode -1))
+
+(define-key god-local-mode-map (kbd "C-S-O") #'m/newline-insert-above)
+
+(defun m/newline-insert-below ()
+ "Create line below, exit god mode"
+ (interactive)
+ (end-of-line)
+ (newline-and-indent)
+ (god-local-mode -1))
+
+(define-key god-local-mode-map (kbd "C-o") #'m/newline-insert-below)
+
+(add-hook 'god-local-mode-hook
+ (lambda () (if (bound-and-true-p god-local-mode)
+ (setq cursor-type 'box)
+ (setq cursor-type 'bar))))
+
+(defun m/update-cursor-type ()
+ (setq cursor-type (if (or god-local-mode buffer-read-only) 'box 'bar)))
+(add-hook 'post-command-hook #'m/update-cursor-type)
+
+(defun m/quit ()
+ "Quit current window or buffer. Taken from meow-quit"
+ (interactive)
+ (if (> (seq-length (window-list (selected-frame))) 1)
+ (quit-window)
+ (previous-buffer)))
+
+(define-key god-local-mode-map (kbd "C-q") #'m/quit)
+
+(require 'god-mode-isearch)
+(define-key isearch-mode-map (kbd "<escape>") #'god-mode-isearch-activate)
+(define-key god-mode-isearch-map (kbd "<escape>") #'god-mode-isearch-disable)
+
+(delete-selection-mode 1)
+
+(unless (package-installed-p 'avy)
+ (package-install 'avy))
+
+(keymap-global-set "C-'" 'avy-goto-char)
+
+;; Setup custom keys for avy
+(custom-set-variables '(avy-keys '(97 114 115 116 100 104 110 101 105 111)))
+
+
+(unless (package-installed-p 'hyperbole)
+ (package-install 'hyperbole))
+(require 'hyperbole)
+(hyperb:init)
+
+
+;; Direnv
+(unless (package-installed-p 'direnv)
+ (package-install 'direnv))
+
+(use-package direnv
+ :config
+ (direnv-mode))
+
+(setq direnv-show-paths-in-summary nil)
+(setq direnv-always-show-summary nil)
+
+;; Prompt
+(add-hook 'eshell-mode-hook
+ (defun my-eshell-mode-hook ()
+ (require 'eshell-z)))
+
+(defun marcc/eshell-prompt ()
+ (setq eshell-prompt-regexp "^-- ")
+ (format "%s\n-- " (abbreviate-file-name (eshell/pwd))))
+(setq eshell-prompt-function #'marcc/eshell-prompt)
+
+;; Print git branch in dired et.c.
+(unless (package-installed-p 'git-ps1-mode)
+ (package-install 'git-ps1-mode))
+
+(require 'git-ps1-mode)
+
+
+;;Theme
+(unless (package-installed-p 'almost-mono-themes)
+ (package-install 'almost-mono-themes))
+(use-package almost-mono-themes
+ :config
+ (load-theme 'almost-mono-white t))
+
+(set-face-attribute 'default nil :font "Iosevka Term Curly" :height 100)
+(set-face-attribute 'variable-pitch nil :font "Iosevka Etoile" :height 90)
+(setq-default line-spacing 0.5)
+(setq display-time-format "%a, %d/%m, %H:%M")
+(display-time-mode)
+(display-battery-mode)
+(tab-bar-mode)
+
+(add-hook 'Info-mode-hook 'variable-pitch-mode)
+(add-hook 'woman-mode-hook 'variable-pitch-mode)
+
+
+
+(setq
+ flymake-fringe-indicator-position 'left-fringe
+ diff-hl-side 'right)
+
+(custom-set-variables '(fringe-mode '(5 . 5) nil (fringe)))
+(set-face-attribute 'fringe nil :background "#FFF")
+(add-to-list 'default-frame-alist '(internal-border-width . 4))
+
+
+;; Disable splash screen
+(setq inhibit-startup-screen t)
+
+;; Ripgrep
+(unless (package-installed-p 'rg)
+ (package-install 'rg))
+(require 'rg)
+
+;; Slime
+(unless (package-installed-p 'slime)
+ (package-install 'slime))
+
+
+;; Hyperbole
+(unless (package-installed-p 'hyperbole)
+ (package-install 'hyperbole))
+
+(hyperbole-mode 1)
+
+;;; Git client
+(unless (package-installed-p 'magit)
+ (package-install 'magit))
+
+;; Tempel
+(unless (package-installed-p 'tempel)
+ (package-install 'tempel))
+
+(use-package tempel
+ ;; Require trigger prefix before template name when completing.
+ ;; :custom
+ ;; (tempel-trigger-prefix "<")
+ :bind (("M-+" . tempel-complete) ;; Alternative tempel-expand
+ ("M-*" . tempel-insert))
+
+ :init
+
+ ;; Setup completion at point
+ (defun tempel-setup-capf ()
+ ;; Add the Tempel Capf to `completion-at-point-functions'.
+ ;; `tempel-expand' only triggers on exact matches. Alternatively use
+ ;; `tempel-complete' if you want to see all matches, but then you
+ ;; should also configure `tempel-trigger-prefix', such that Tempel
+ ;; does not trigger too often when you don't expect it. NOTE: We add
+ ;; `tempel-expand' *before* the main programming mode Capf, such
+ ;; that it will be tried first.
+ (setq-local completion-at-point-functions
+ (cons #'tempel-expand
+ completion-at-point-functions)))
+
+ (add-hook 'conf-mode-hook 'tempel-setup-capf)
+ (add-hook 'prog-mode-hook 'tempel-setup-capf)
+ (add-hook 'text-mode-hook 'tempel-setup-capf)
+
+ ;; Optionally make the Tempel templates available to Abbrev,
+ ;; either locally or globally. `expand-abbrev' is bound to C-x '.
+ ;; (add-hook 'prog-mode-hook #'tempel-abbrev-mode)
+ ;; (global-tempel-abbrev-mode)
+ )
+
+;; Eat - terminal emulator
+(unless (package-installed-p 'eat)
+ (package-install 'eat))
+
+
+;; Vundo
+(unless (package-installed-p 'vundo)
+ (package-install 'vundo))
+
+;; Backups
+
+(setq backup-directory-alist
+ `((".*" . ,temporary-file-directory))
+ auto-save-file-name-transforms
+ `((".*" ,temporary-file-directory t)))
+
+;; Indication of local VCS changes
+(unless (package-installed-p 'diff-hl)
+ (package-install 'diff-hl))
+
+;; Enable `diff-hl' support by default in programming buffers
+(add-hook 'prog-mode-hook #'diff-hl-mode)
+
+;; Devdocs
+(unless (package-installed-p 'devdocs)
+ (package-install 'devdocs))
+
+(global-set-key (kbd "C-h D") 'devdocs-lookup)
+(add-hook 'terraform-mode-hook
+ (lambda () (setq-local devdocs-current-docs '("terraform"))))
+
+;; LSP
+(unless (package-installed-p 'tuareg)
+ (package-install 'tuareg))
+(use-package tree-sitter-langs
+ :ensure t
+ :defer t)
+
+(use-package treesit
+ :init
+ (setq treesit-extra-load-path '("~/.guix-home/profile/lib/tree-sitter")))
+
+;; Project
+(bind-key "C-x p s" 'eat-project)
+
+(use-package eglot
+ :ensure t)
+
+;; Allegedly speeds up eglot
+(fset #'jsonrpc--log-event #'ignore)
+
+(add-hook 'tuareg-mode-hook 'eglot-ensure)
+
+;; When tuareg is loaded, autoformat on save
+(add-hook 'tuareg-mode-hook
+ (lambda ()
+ (add-hook 'before-save-hook 'eglot-format nil t)))
+
+(add-hook 'typescript-ts-mode-hook 'eglot-ensure)
+(setq-default indent-tabs-mode nil
+ tab-stop-list ()
+ tab-width 2)
+
+(cl-defmethod project-root ((project (head eglot-project)))
+ (cdr project))
+
+(defun my-project-try-tsconfig-json (dir)
+ (when-let* ((found (locate-dominating-file dir "tsconfig.json")))
+ (cons 'eglot-project found)))
+
+(add-hook 'project-find-functions
+ 'my-project-try-tsconfig-json nil nil)
+
+(unless (package-installed-p 'terraform-mode)
+ (package-install 'terraform-mode))
+
+(use-package terraform-mode
+ ;; if using straight
+ ;; :straight t
+
+ ;; if using package.el
+ ;; :ensure t
+ :custom (terraform-indent-level 2)
+ :config
+ (defun my-terraform-mode-init ()
+ ;; if you want to use outline-minor-mode
+ ;; (outline-minor-mode 1)
+ )
+
+ (add-hook 'terraform-mode-hook 'my-terraform-mode-init))
+
+(add-hook 'terraform-mode-hook 'eglot-ensure)
+
+(add-to-list 'auto-mode-alist '("\\.ts\\'" . typescript-ts-mode))
+(add-to-list 'auto-mode-alist '("\\.tsx\\'" . tsx-ts-mode))
+(add-to-list 'auto-mode-alist '("\\.tf\\'" . terraform-mode))
+(add-to-list 'auto-mode-alist '("\\.json\\'" . json-ts-mode))
+(add-to-list 'auto-mode-alist '("\\.ml\\'" . tuareg-mode))
+(add-to-list 'auto-mode-alist '("\\.mli\\'" . tuareg-mode))
+
+'(eglot-extend-to-xref t)
+'(eglot-autoreconnect t)
+(add-hook 'eglot-managed-mode-hook
+ (lambda ()
+ "Make sure Eldoc will show us all of the feedback at point."
+ (setq-local eldoc-documentation-strategy
+ #'eldoc-documentation-compose)))
+
+;; Commands
+
+(defun ocaml-print-rapper-type ()
+ (interactive)
+ (insert (shell-command-to-string "ocaml-rapper-helper")))
+
+;; HTML + Liquid
+(add-to-list 'auto-mode-alist '("\\.liquid\\'" . html-mode))
+(with-eval-after-load 'eglot
+ (add-to-list 'eglot-server-programs
+ '(html-mode . ("vscode-html-language-server" "--stdio"))
+ '(css-mode . ("vscode-css-language-server" "--stdio"))))
+
+
+(unless (package-installed-p 'prettier-js)
+ (package-install 'prettier-js))
+(unless (package-installed-p 'add-node-modules-path)
+ (package-install 'add-node-modules-path))
+(unless (package-installed-p 'smartparens)
+ (package-install 'smartparens))
+
+(add-hook 'typescript-ts-mode-hook 'prettier-js-mode)
+(add-hook 'tsx-ts-mode 'prettier-js-mode)
+(add-hook 'typescript-ts-mode-hook #'smartparens-mode)
+(add-hook 'json-ts-mode-hook #'smartparens-mode)
+(add-hook 'tuareg-mode-hook #'smartparens-mode)
+(add-hook 'terraform-mode-hook #'smartparens-mode)
+
+(setq eglot-prefer-plaintext 1
+ eldoc-echo-area-use-multiline-p t
+ eldoc-echo-area-prefer-doc-buffer t
+ eglot-events-buffer-size 0
+ eglot-autoshutdown t)
+
+
+(add-hook 'eglot-managed-mode-hook (lambda () (eglot-inlay-hints-mode 0)))
+(add-hook 'eglot-managed-mode-hook (lambda () (global-eldoc-mode -1)))
+(add-hook 'eglot-managed-mode-hook (lambda () (keymap-local-set "C-c C-x C-a" 'eglot-code-actions)))
+(add-hook 'eglot-managed-mode-hook (lambda () (keymap-local-set "C-c C-x C-r" 'eglot-rename)))
+
+(global-eldoc-mode -1)
+
+;; Disable copilot warning logs
+(setq warning-minimum-level :error)
+
+;; Markdown mode to correctly show markdown
+(unless (package-installed-p 'markdown-mode)
+ (package-install 'markdown-mode))
+(use-package markdown-mode)
+
+(setq markdown-enable-highlighting-syntax t)
+(setq markdown-hide-urls t)
+(setq markdown-hide-markup t)
+
+
+(unless (package-installed-p 'consult)
+ (package-install 'consult))
+(global-set-key [rebind switch-to-buffer] #'consult-buffer)
+(global-set-key (kbd "C-x C-r") #'consult-ripgrep)
+(global-set-key (kbd "C-x C-f") #'consult-fd)
+
+(setq consult-async-refresh-delay 0.0)
+(setq consult-async-input-throttle 0.0)
+(setq consult-async-input-debounce 0.02)
+
+;; Vertico + Marginalia + Orderless auto complete
+(unless (package-installed-p 'vertico)
+ (package-install 'vertico))
+(use-package vertico
+ :init
+ (vertico-mode)
+ (use-package savehist
+ :init
+ (savehist-mode))
+ )
+(vertico-reverse-mode)
+(setq vertico-resize nil)
+;; Completion
+(setq completion-in-region-function
+ (lambda (&rest args)
+ (apply (if vertico-mode
+ #'consult-completion-in-region
+ #'completion--in-region)
+ args)))
+(unless (package-installed-p 'orderless)
+ (package-install 'orderless))
+
+(unless (package-installed-p 'marginalia)
+ (package-install 'marginalia))
+
+(use-package marginalia
+ :init
+ (marginalia-mode))
+
+(use-package orderless
+ :ensure t
+ :custom
+ (completion-styles '(orderless basic))
+ (completion-category-overrides '((file (styles basic partial-completion)))))
+
+;; Miscellaneous options
+(setq-default major-mode
+ (lambda () ; guess major mode from file name
+ (unless buffer-file-name
+ (let ((buffer-file-name (buffer-name)))
+ (set-auto-mode)))))
+(setq confirm-kill-emacs #'yes-or-no-p)
+(setq window-resize-pixelwise t
+ frame-resize-pixelwise t)
+(save-place-mode t)
+(savehist-mode t)
+(recentf-mode t)
+(defalias 'yes-or-no #'y-or-n-p)
+
+;; Store automatic customisation options elsewhere
+(setq custom-file (locate-user-emacs-file "custom.el"))
+(when (file-exists-p custom-file)
+ (load custom-file))
+
+;; Pairs
+(bind-key "M-{" 'insert-pair)
+(bind-key "M-}" 'insert-pair)
+(bind-key "M-]" 'insert-pair)
+(bind-key "M-[" 'insert-pair)
+(bind-key "M-]" 'insert-pair)
+(bind-key "M-`" 'insert-pair)
+(bind-key "M-\"" 'insert-pair)
+(bind-key "M-'" 'insert-pair)
+(bind-key "M-<" 'insert-pair)
+
+;; Guix integration
+(unless (package-installed-p 'geiser-mit)
+ (package-install 'geiser-mit))
+(unless (package-installed-p 'geiser-guile)
+ (package-install 'geiser-guile))
+(unless (package-installed-p 'ac-geiser)
+ (package-install 'ac-geiser))
+(unless (package-installed-p 'macrostep-geiser)
+ (package-install 'macrostep-geiser))
+(unless (package-installed-p 'guix)
+ (package-install 'guix))
+
+;; Utils
+(defun marc/close-all-buffers-except-current ()
+ (interactive)
+ (mapc 'kill-buffer (delete (current-buffer) (buffer-list))))
+
+;; which-key
+(unless (package-installed-p 'which-key)
+ (package-install 'which-key))
+(require 'which-key)
+(which-key-mode)
+(which-key-enable-god-mode-support)
+
+;; Fossil
+(unless (package-installed-p 'vc-fossil)
+ (package-install 'vc-fossil))
+
+;; Dired
+(add-hook 'dired-after-readin-hook 'dired-hide-details-mode 'append)
+(eval-after-load "dired" '(define-key dired-mode-map (kbd "b") 'dired-up-directory))
+(eval-after-load "dired" '(define-key dired-mode-map (kbd "N") 'dired-create-empty-file))
+(eval-after-load "dired" '(define-key dired-mode-map (kbd "+") 'dired-create-directory))
+(put 'dired-find-alternate-file 'disabled nil)
+
+
+;; Copilot
+(unless (package-installed-p 'quelpa)
+ (package-install 'quelpa))
+(unless (package-installed-p 'quelpa-use-package)
+ (package-install 'quelpa-use-package))
+
+(require 'quelpa)
+(require 'quelpa-use-package)
+
+(use-package copilot
+ :quelpa (copilot :fetcher github
+ :repo "zerolfx/copilot.el"
+ :branch "main"
+ :files ("dist" "*.el")))
+
+
+(define-key copilot-completion-map (kbd "<tab>") 'copilot-accept-completion)
+(define-key copilot-completion-map (kbd "TAB") 'copilot-accept-completion)
+
+;; Org
+(require 'org)
+(transient-mark-mode 1)
+(add-hook 'org-mode-hook 'variable-pitch-mode)
+(add-hook 'org-mode-hook 'flyspell-mode)
+(add-hook 'org-mode-hook 'visual-line-mode)
+
+
+(setq org-directory "~/marcvault")
+
+(defun marcc/get-journal-file-today ()
+ "Get journal path"
+ (let ((fpath (concat org-directory "/Journal/" (format-time-string "%Y-%m-%d.org"))))
+ (expand-file-name fpath)))
+
+(defun journal-file-today ()
+ "Create and load a journal file based on today's date."
+ (interactive)
+ (find-file (marcc/get-journal-file-today)))
+
+(defun marcc/search-notes ()
+ "Get journal path"
+ (let ((fpath (concat org-directory "/Journal/" (format-time-string "%Y-%m-%d.org"))))
+ (expand-file-name fpath)))
+
+(setq org-capture-templates
+ `(("t" "Todo" entry (file+headline "~/marcvault/todo.org" "Tasks")
+ "* TODO %?\n %i\n %a")
+ ("u" "Usage" entry (file "~/marcvault/usage-tips.org")
+ "* %?\n"
+ :empty-lines 1)
+ ("j" "Journal"
+ entry (file ,(concat org-directory "/Journal/" (format-time-string "%Y-%m-%d.org")))
+ "* %?\n[%(format-time-string \"%Y-%m-%d %H:%M\")]\n%i\n%a"
+ :empty-lines 1)))
+
+(add-hook 'marc-minor-mode-hook 'smartparens-mode)
+(add-hook 'flyspell-mode-hook (lambda () (define-key flyspell-mode-map (kbd "C-,") nil)))
+(setq org-adapt-indentation t
+ org-hide-leading-stars t
+ org-startup-indented t
+ org-startup-truncated nil
+ org-hide-emphasis-markers t
+ org-agenda-files (directory-files-recursively "~/marcvault/" "\\.org$")
+ org-log-done 'time
+ org-todo-keywords '((sequence "TODO" "IDEA" "|" "DONE"))
+ org-todo-keyword-faces '(("TODO" . org-todo)
+ ("IDEA" . "blue")
+ ("DONE" . "green"))
+ org-odd-levels-only t)
+
+
+
+;; Auto dim buffers
+(unless (package-installed-p 'auto-dim-other-buffers)
+ (package-install 'auto-dim-other-buffers))
+
+(auto-dim-other-buffers-mode)
+
+;; Keybindings
+(defvar marc-minor-mode-map (make-keymap) "marc-minor-mode keymap.")
+(define-key marc-minor-mode-map (kbd "C-c C-k") 'eldoc)
+(define-key marc-minor-mode-map (kbd "C-c , .") 'journal-file-today)
+(define-key marc-minor-mode-map (kbd "C-c , c") 'org-capture)
+(define-key marc-minor-mode-map (kbd "C-c , a") 'org-agenda)
+(define-key marc-minor-mode-map (kbd "C-c , s") 'consult-org-agenda)
+(define-key marc-minor-mode-map (kbd "C-c , /") 'consult-org-heading)
+(define-key marc-minor-mode-map (kbd "C-,") 'er/expand-region)
+(define-key marc-minor-mode-map (kbd "C-'") 'avy-goto-char)
+(define-minor-mode marc-minor-mode
+ "A minor mode so that my key settings aren't shadowed by other major/minor modes"
+ t " marc" marc-minor-mode-map)
+
+;; Isearch
+;; Case insensitive
+(setq case-fold-search t)
+
+;; Ligatures
+(unless (package-installed-p 'ligature)
+ (package-install 'ligature))
+
+(use-package ligature
+ :config
+ ;; Enable the "www" ligature in every possible major mode
+ (ligature-set-ligatures 't '("www"))
+ ;; Enable traditional ligature support in eww-mode, if the
+ ;; `variable-pitch' face supports it
+ (ligature-set-ligatures 'eww-mode '("ff" "fi" "ffi"))
+ ;; Enable all Pragmata Pro in programming modes
+ (ligature-set-ligatures 'prog-mode '( "<|||" "<==>" "<!--" "~~>" "||=" "||>"
+ "===" "==>" "=!=" "=>>" "=<<" "=/=" "!=="
+ ">=>" ">>=" ">>>" ">>-" ">->" "->>" "-->" "---" "-<<"
+ "<~~" "<~>" "<*>" "<||" "<|>" "<$>" "<==" "<=>" "<=<" "<->"
+ "<--" "<-<" "<<=" "<<-" "<<<" "<+>" "</>" "#_("
+ "+++" "/==" "_|_" "&&" "^=" "~="
+ "~>" "*>" "*/" "||" "|}" "|]" "|=" "|>" "|-" "[[" "]]"
+ "[|" "]#" "::" ":=" ":>" ":<" "$>" "==" "=>" "!=" "|==>" "|>-"
+ ">=" ">>" ">-" "-~" "-|" "->" "--" "-<" "<~" "<*" "<|" "~>>" "\\=>"
+ "<$" "<="
+ "##" "#(" "#?" "#_" ".." "+>" "++"
+ "?=" "/="
+ "|<<" "\\==" "^>>" "^>>" "|+|" "|->" "|-->" "\\-:" "[FIXME]"
+ "[TODO]" "[WARN]" "!=" "&&&"))
+ ;; Enables ligature checks globally in all buffers. You can also do it
+ ;; per mode with `ligature-mode'.
+ (global-ligature-mode t))
+
+;; RSS - Elfeed
+(unless (package-installed-p 'elfeed)
+ (package-install 'elfeed))
+(unless (package-installed-p 'elfeed-protocol)
+ (package-install 'elfeed-protocol))
+(unless (package-installed-p 'password-store)
+ (package-install 'password-store))
+
+(elfeed-protocol-enable)
+;;(setq elfeed-use-curl t)
+(setq elfeed-set-timeout 36000
+ elfeed-curl-extra-arguments '("--insecure") ;necessary for https without a trust certificate
+ elfeed-protocol-fever-fetch-category-as-tag t
+ elfeed-protocol-feeds '(("fever+https://freshrss@rss.mccd.space"
+ :api-url "https://rss.mccd.space/api/fever.php"
+ :password (password-store-get "mccd/freshrss")
+ )))
+
+(defun marc/elfeed-refresh ()
+ (interactive)
+ (mark-whole-buffer)
+ (cl-loop for entry in (elfeed-search-selected)
+ do (elfeed-untag-1 entry 'unread))
+ (elfeed-search-update--force)
+ (elfeed-protocol-fever-reinit "fever+https://freshrss@rss.mccd.spaceD"))
+
+(let* ((proto-id "fever+https://freshrss@rss.mccd.space")
+ (last-id (elfeed-protocol-fever-get-update-mark proto-id 'update)))
+ (elfeed-protocol-fever-set-update-mark proto-id 'update (- last-id 1000)))
+
+;; Elfeed
+(setq elfeed-sort-order 'ascending
+ elfeed-protocol-enabled-protocols '(fever)
+ elfeed-protocol-fever-update-unread-only t)
+
+;; Web browser
+(unless (package-installed-p 'w3m)
+ (package-install 'w3m))
+
+(setq w3m-search-default-engine "duckduckgo")
+
+;; Gemini and Gopher
+(unless (package-installed-p 'elpher)
+ (package-install 'elpher))
+
+
+(setq message-kill-buffer-on-exit t)
+(setq message-sendmail-envelope-from 'header)
+
+;; pinentry
+(setq epa-pinentry-mode 'loopback)
+(defun pinentry-emacs (desc prompt ok error)
+ (let ((str (read-passwd (concat (replace-regexp-in-string "%22" "\"" (replace-regexp-in-string "%0A" "\n" desc)) prompt ": "))))
+ str))
+
+
+;; ERC
+(require 'erc-join)
+(erc-autojoin-mode 1)
+(setq erc-autojoin-channels-alist
+ '(("irc.libera.chat" "#emacs" "#guix" "#nyxt")))
+(setq erc-nick "mccd")
+
+
+(custom-set-variables
+ ;; custom-set-variables was added by Custom.
+ ;; If you edit it by hand, you could mess it up, so be careful.
+ ;; Your init file should contain only one such instance.
+ ;; If there is more than one, they won't work right.
+ '(avy-keys '(97 114 115 116 100 104 110 101 105 111))
+ '(blink-cursor-mode nil)
+ '(compile-command " ")
+ '(confirm-nonexistent-file-or-buffer nil)
+ '(consult-fd-args
+ '((if
+ (executable-find "fdfind" 'remote)
+ "fdfind" "fd")
+ "--full-path --color=never --hidden"))
+ '(diff-hl-side 'right)
+ '(display-line-numbers-major-tick 0)
+ '(display-line-numbers-minor-tick 0)
+ '(display-line-numbers-width nil)
+ '(eglot-extend-to-xref t)
+ '(eldoc-echo-area-use-multiline-p t)
+ '(erc-autojoin-mode t)
+ '(erc-button-mode t)
+ '(erc-fill-mode t)
+ '(erc-hide-timestamps nil)
+ '(erc-irccontrols-mode t)
+ '(erc-list-mode t)
+ '(erc-match-mode t)
+ '(erc-menu-mode t)
+ '(erc-move-to-prompt-mode t)
+ '(erc-netsplit-mode t)
+ '(erc-networks-mode t)
+ '(erc-nick "mccd")
+ '(erc-noncommands-mode t)
+ '(erc-pcomplete-mode t)
+ '(erc-readonly-mode t)
+ '(erc-ring-mode t)
+ '(erc-stamp-mode t)
+ '(erc-timestamp-format-left "%a %H:%M\12")
+ '(erc-timestamp-format-right " ")
+ '(erc-track-minor-mode t)
+ '(erc-track-mode t)
+ '(flymake-fringe-indicator-position 'left-fringe)
+ '(flymake-mode-line-format '(" " flymake-mode-line-counters))
+ '(fringe-mode '(5 . 5) nil (fringe))
+ '(god-mode-lighter-string "God")
+ '(grep-command "ugrep")
+ '(markdown-code-block-braces t)
+ '(markdown-enable-highlighting-syntax t)
+ '(markdown-enable-wiki-links t)
+ '(markdown-fontify-code-block-default-mode nil)
+ '(markdown-fontify-code-blocks-natively t)
+ '(markdown-hide-urls t)
+ '(markdown-link-space-sub-char "-")
+ '(markdown-max-image-size '(300 . 300))
+ '(markdown-wiki-link-search-type '(sub-directories parent-directories project))
+ '(meow-esc-mode t)
+ '(meow-global-mode t)
+ '(mode-line-compact 'long)
+ '(mode-line-percent-position nil)
+ '(mode-line-position-line-format '(" "))
+ '(mu4e-modeline-mode nil)
+ '(org-babel-load-languages '((emacs-lisp . t) (lisp . t) (shell . t)))
+ '(org-fold-core-style 'overlays)
+ '(package-selected-packages
+ '(slime eat avy monotropic-theme tempel vundo add-node-modules-path prettier password-store vc-fossil eldoc-box mu4e direnv elpher w3m elfeed-protocol elfeed ligature copilot f editorconfig s quelpa-use-package quelpa org-mime org-journal which-key consult orderless vertico markdown-mode smartparens tree-sitter-langs diff-hl magit corfu rg almost-mono-themes git-ps1-mode meow))
+ '(project-switch-commands
+ '((project-find-file "Find file" nil)
+ (project-find-regexp "Find regexp" nil)
+ (project-find-dir "Find directory" nil)
+ (project-vc-dir "VC-Dir" nil)
+ (consult-project-buffer "Find buffer" "b")
+ (eat-project "Eat terminal" 101)))
+ '(resize-mini-frames nil)
+ '(resize-mini-windows t)
+ '(rg-align-line-number-field-length 2)
+ '(safe-local-variable-values
+ '((eval progn
+ (require 'lisp-mode)
+ (defun emacs27-lisp-fill-paragraph
+ (&optional justify)
+ (interactive "P")
+ (or
+ (fill-comment-paragraph justify)
+ (let
+ ((paragraph-start
+ (concat paragraph-start "\\|\\s-*\\([(;\"]\\|\\s-:\\|`(\\|#'(\\)"))
+ (paragraph-separate
+ (concat paragraph-separate "\\|\\s-*\".*[,\\.]$"))
+ (fill-column
+ (if
+ (and
+ (integerp emacs-lisp-docstring-fill-column)
+ (derived-mode-p 'emacs-lisp-mode))
+ emacs-lisp-docstring-fill-column fill-column)))
+ (fill-paragraph justify))
+ t))
+ (setq-local fill-paragraph-function #'emacs27-lisp-fill-paragraph))
+ (eval modify-syntax-entry 43 "'")
+ (eval modify-syntax-entry 36 "'")
+ (eval modify-syntax-entry 126 "'")
+ (geiser-repl-per-project-p . t)
+ (eval with-eval-after-load 'yasnippet
+ (let
+ ((guix-yasnippets
+ (expand-file-name "etc/snippets/yas"
+ (locate-dominating-file default-directory ".dir-locals.el"))))
+ (unless
+ (member guix-yasnippets yas-snippet-dirs)
+ (add-to-list 'yas-snippet-dirs guix-yasnippets)
+ (yas-reload-all))))
+ (eval setq-local guix-directory
+ (locate-dominating-file default-directory ".dir-locals.el"))
+ (eval add-to-list 'completion-ignored-extensions ".go")))
+ '(tab-bar-format '(tab-bar-format-align-right tab-bar-format-global))
+ '(tab-bar-show t)
+ '(vc-handled-backends '(Git Fossil))
+ '(vertico-flat-annotate t)
+ '(vertico-flat-format
+ '(:multiple
+ #("{%s}" 0 1
+ (face minibuffer-prompt)
+ 3 4
+ (face minibuffer-prompt))
+ :single
+ #("[%s]" 0 1
+ (face minibuffer-prompt)
+ 1 3
+ (face success)
+ 3 4
+ (face minibuffer-prompt))
+ :prompt
+ #("(%s)" 0 1
+ (face minibuffer-prompt)
+ 3 4
+ (face minibuffer-prompt))
+ :separator
+ #(" | " 0 3
+ (face minibuffer-prompt))
+ :ellipsis
+ #("…" 0 1
+ (face minibuffer-prompt))
+ :no-match "[No match]"))
+ '(vertico-flat-mode nil)
+ '(vertico-resize nil)
+ '(window-resize-pixelwise t))
+(custom-set-faces
+ ;; custom-set-faces was added by Custom.
+ ;; If you edit it by hand, you could mess it up, so be careful.
+ ;; Your init file should contain only one such instance.
+ ;; If there is more than one, they won't work right.
+ '(diff-hl-insert ((t (:background "green" :foreground "green"))))
+ '(dired-directory ((t (:inherit font-lock-function-name-face :weight bold))))
+ '(elfeed-search-feed-face ((t (:foreground "dim gray"))))
+ '(elfeed-search-tag-face ((t (:slant italic))))
+ '(elpher-gemini-heading1 ((t (:inherit bold :height 1.2 :family "Iosevka Etoile"))))
+ '(elpher-gemini-preformatted ((t (:inherit variable-pitch))))
+ '(erc-action-face ((t (:inherit erc-default-face :weight bold))))
+ '(erc-default-face ((t (:family "Iosevka Etoile"))))
+ '(erc-input-face ((t (:foreground "green"))))
+ '(erc-my-nick-face ((t (:foreground "green" :weight bold))))
+ '(erc-nick-default-face ((t (:inherit erc-default-face :weight bold))))
+ '(erc-nick-msg-face ((t (:foreground "medium blue" :weight bold))))
+ '(erc-notice-face ((t (:inherit erc-default-face :foreground "SlateBlue" :weight bold))))
+ '(erc-prompt-face ((t (:foreground "Black" :weight bold))))
+ '(erc-timestamp-face ((t (:inherit erc-default-face :foreground "gray" :weight bold))))
+ '(eww-form-file ((t (:background "#808080" :foreground "white" :box (:line-width (2 . 2) :style released-button)))))
+ '(eww-form-submit ((t (:background "#808080" :foreground "white" :box (:line-width (2 . 2) :style released-button)))))
+ '(eww-valid-certificate ((t (:foreground "black" :weight bold))))
+ '(font-lock-function-name-face ((t (:weight normal))))
+ '(font-lock-preprocessor-face ((t (:slant normal))))
+ '(font-lock-string-face ((t (:foreground "#5A5DA5"))))
+ '(font-lock-type-face ((t (:slant normal :weight normal))))
+ '(gnus-header-content ((t (:inherit gnus-header :slant italic))))
+ '(gnus-header-from ((t (:inherit gnus-header))))
+ '(gnus-header-name ((t (:inherit gnus-header))))
+ '(gnus-header-subject ((t (:inherit gnus-header))))
+ '(god-mode-lighter ((t (:inherit error))))
+ '(highlight ((t (:background "azure2"))))
+ '(line-number ((t (:foreground "#999999"))))
+ '(markdown-code-face ((t nil)))
+ '(markdown-fontify-code-block-natively t)
+ '(markdown-pre-face ((t (:inherit markdown-code-face))))
+ '(meow-position-highlight-number ((t (:inherit default :background "grey80" :foreground "white"))))
+ '(show-paren-match ((t (:background "gainsboro" :foreground "green" :slant oblique :weight bold))))
+ '(tab-bar ((t (:family "Iosevka Aile" :background "#FFF" :foreground "black" :box (:line-width (4 . 4) :color "#FFF") :height 0.90))))
+ '(tab-bar-tab ((t (:inherit tab-bar :box nil))))
+ '(tuareg-font-lock-operator-face ((t nil)))
+ '(variable-pitch ((t (:family "Iosevka Etoile"))))
+ '(variable-pitch-text ((t (:inherit variable-pitch :height 1.0)))))
+
+
+
diff --git a/emacs.d/custom.el b/emacs.d/custom.el
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/emacs.d/custom.el