201 lines
4.5 KiB
EmacsLisp
201 lines
4.5 KiB
EmacsLisp
;; set default font
|
|
(when (member "Fantasque Sans Mono" (font-family-list))
|
|
(set-face-attribute 'default nil :font "Fantasque Sans Mono-16"))
|
|
|
|
;; Always use slant for italic, not underline
|
|
'(italic ((t (:slant italic))))
|
|
|
|
;; Save point
|
|
(save-place-mode 1)
|
|
|
|
;; Set column width to 88 characters
|
|
(setq-default fill-column 88)
|
|
|
|
;;;; Load my packages
|
|
;; Default theme
|
|
;; (use-package zenburn-theme
|
|
;; :demand t
|
|
;; :config
|
|
;; (load-theme 'zenburn t))
|
|
|
|
(load-theme 'modus-vivendi-tinted t)
|
|
|
|
;; QOL packages
|
|
(use-package helpful
|
|
:bind (("C-h f" . #'helpful-callable)
|
|
("C-h v" . #'helpful-variable)
|
|
("C-h k" . #'helpful-key)
|
|
("C-h x" . #'helpful-command)))
|
|
|
|
;; Org
|
|
(use-package org
|
|
:config
|
|
(load "~/.emacs.d/elisp/org-setup.el"))
|
|
(use-package org-ref)
|
|
|
|
;; Writing
|
|
(use-package writeroom-mode)
|
|
|
|
;; modeline
|
|
;; configure the default one
|
|
(load "~/.emacs.d/elisp/modeline-setup.el")
|
|
|
|
(use-package all-the-icons)
|
|
|
|
(use-package dashboard
|
|
:demand t
|
|
:config
|
|
(dashboard-setup-startup-hook))
|
|
|
|
;; Reading
|
|
(use-package nov
|
|
:config
|
|
(setq nov-text-width t)
|
|
(setq visual-fill-column-center-text t)
|
|
(add-hook 'nov-mode-hook 'visual-line-mode)
|
|
(add-hook 'nov-mode-hook 'visual-fill-column-mode)
|
|
(add-hook 'nov-mode-hook 'writeroom-mode)
|
|
(add-to-list 'auto-mode-alist '("\\.epub\\'" . nov-mode)))
|
|
|
|
(use-package pdf-tools
|
|
:config
|
|
(progn
|
|
(pdf-tools-install)
|
|
(setq pdf-view-midnight-colors '("#DCDCCC" . "#3F3F3F"))))
|
|
|
|
(use-package saveplace-pdf-view)
|
|
|
|
;; Read Gopher and Gemini
|
|
(use-package elpher)
|
|
|
|
;; Read feeds
|
|
(use-package elfeed)
|
|
|
|
;; Programming environment
|
|
;; We need colors in eshell
|
|
(use-package xterm-color)
|
|
|
|
;; eat terminal emulator:
|
|
(use-package eat
|
|
:straight (:type git
|
|
:host codeberg
|
|
:repo "akib/emacs-eat"
|
|
:files ("*.el" ("term" "term/*.el") "*.texi"
|
|
"*.ti" ("terminfo/e" "terminfo/e/*")
|
|
("terminfo/65" "terminfo/65/*")
|
|
("integration" "integration/*")
|
|
(:exclude ".dir-locals.el" "*-tests.el"))))
|
|
|
|
;; git
|
|
(use-package magit
|
|
:demand t
|
|
:bind ("C-x g" . 'magit-status))
|
|
|
|
;; code completion
|
|
(use-package company
|
|
:hook (after-init . global-company-mode))
|
|
|
|
(use-package tomlparse)
|
|
|
|
;; TODO I'm only using demand so <f3> is set from the start
|
|
(use-package treemacs
|
|
:demand t
|
|
:bind ("<f3>" . 'treemacs))
|
|
|
|
;; Javascript and React
|
|
(use-package rjsx-mode
|
|
:config
|
|
(add-to-list 'auto-mode-alist '("\\.js\\'" . rjsx-mode)))
|
|
|
|
;; Common Lisp
|
|
(use-package slime
|
|
:config
|
|
(load "~/.emacs.d/elisp/slime-setup.el"))
|
|
|
|
(use-package paredit)
|
|
|
|
;; Clojure
|
|
(use-package cider)
|
|
|
|
;; Rust
|
|
(use-package rust-mode
|
|
:config
|
|
(load "~/.emacs.d/elisp/rust-setup.el"))
|
|
|
|
;; Haskell
|
|
(use-package haskell-mode)
|
|
|
|
;; Racket
|
|
(use-package racket-mode)
|
|
|
|
(use-package envrc
|
|
:hook (after-init . envrc-global-mode))
|
|
|
|
(use-package python-black
|
|
:after python
|
|
:hook (python-mode . python-black-on-save-mode-enable-dwim))
|
|
|
|
(use-package ruff-format)
|
|
|
|
(use-package pydoc)
|
|
|
|
(use-package pet
|
|
:config
|
|
(add-hook 'python-base-mode-hook 'pet-mode -10))
|
|
|
|
;; Ivy related stuff
|
|
(use-package ivy)
|
|
(use-package ivy-bibtex)
|
|
(use-package counsel)
|
|
(use-package swiper)
|
|
(use-package counsel-dash
|
|
:after (counsel))
|
|
(load "~/.emacs.d/elisp/ivy-setup.el")
|
|
|
|
;; View logs
|
|
(use-package log4j-mode)
|
|
|
|
(use-package eglot
|
|
:straight (:type built-in)
|
|
:ensure t
|
|
:defer t
|
|
:hook ((python-base-mode . eglot-ensure))
|
|
)
|
|
|
|
(use-package dape)
|
|
|
|
;; For a more ergonomic Emacs and `dape' experience
|
|
(use-package repeat
|
|
:custom
|
|
(repeat-mode +1))
|
|
|
|
;; Left and right side windows occupy full frame height
|
|
(use-package emacs
|
|
:custom
|
|
(window-sides-vertical t))
|
|
|
|
;; TRAMP
|
|
(load "~/.emacs.d/elisp/tramp-setup.el")
|
|
(load "~/.emacs.d/elisp/outline-keymap.el")
|
|
(load "~/.emacs.d/elisp/bibtex-setup.el")
|
|
(load "~/.emacs.d/elisp/keypad.el")
|
|
|
|
;; from https://www.anghyflawn.net/blog/2014/emacs-give-a-doi-get-a-bibtex-entry/
|
|
(defun get-bibtex-from-doi (doi)
|
|
"Get a BibTeX entry from the DOI"
|
|
(interactive "MDOI: ")
|
|
(let ((url-mime-accept-string "text/bibliography;style=bibtex"))
|
|
(with-current-buffer
|
|
(url-retrieve-synchronously
|
|
(format "http://dx.doi.org/%s"
|
|
(replace-regexp-in-string "http://dx.doi.org/" "" doi)))
|
|
(switch-to-buffer (current-buffer))
|
|
(goto-char (point-max))
|
|
(setq bibtex-entry
|
|
(buffer-substring
|
|
(string-match "@" (buffer-string))
|
|
(point)))
|
|
(kill-buffer (current-buffer))))
|
|
(insert (decode-coding-string bibtex-entry 'utf-8))
|
|
(bibtex-fill-entry))
|