You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 

351 lines
14 KiB

;; Automatically update packages and removes old ones.
(use-package auto-package-update
:ensure t
:config
(setq auto-package-update-delete-old-versions t)
(setq auto-package-update-hide-results t)
(auto-package-update-maybe))
;; Light theme for using laptop outside.
(use-package basic-theme
:ensure t)
;;; Languages
(use-package haskell-mode
:ensure t
:config
(setq haskell-interactive-popup-errors nil)
:init
(add-hook 'haskell-mode-hook 'interactive-haskell-mode))
(use-package geiser
:ensure t
:config
;; Make geiser flash the region being evaluated on C-c C-c, like SLIME does.
(add-hook 'geiser-mode-hook
(lambda ()
(define-key geiser-mode-map (kbd "C-c C-c") nil) ;; remove default C-c C-c binding
(local-set-key (kbd "C-c C-c") (lambda ()
(interactive)
(fez/flash-region)
(geiser-eval-definition)))))
;; geiser requires extra packages for every implementation you want to use
(use-package geiser-guile
:ensure t)
(use-package geiser-mit
:ensure t)
(use-package geiser-chez
:ensure t))
(use-package sly
:ensure t
:config
(use-package ac-sly
:ensure t
:config
(add-hook 'sly-mode-hook 'set-up-sly-ac)
(add-hook 'lisp-mode-hook 'auto-complete-mode)
(eval-after-load 'auto-complete
'(add-to-list 'ac-modes 'sly-mrepl-mode)))
(setq inferior-lisp-program "sbcl")
(add-hook 'sly-mode-hook
(lambda ()
(defun sly-flash-region (start end)
(fez/flash-region))
(defun sly-mrepl-default-prompt (_package
nickname
error-level
entry-idx
_condition)
"SLY REPL prompt."
(concat
(when (cl-plusp error-level)
(concat (sly-make-action-button
(format "[%d]" error-level)
#'sly-db-pop-to-debugger-maybe)
" "))
(propertize
(concat (number-to-string entry-idx) ":" nickname "> ")
'face 'sly-mrepl-prompt-face
'font-lock-face 'sly-mrepl-prompt-face))))))
(use-package racket-mode
:ensure t)
;; Amazing s-expression editing mode.
(use-package lispy
:ensure t
:config
(add-hook 'scheme-mode-hook 'lispy-mode)
(add-hook 'lisp-mode-hook 'lispy-mode)
(add-hook 'emacs-lisp-mode-hook 'lispy-mode)
(add-hook 'racket-mode 'lispy-mode))
;;; Utility packages
;; undo-tree is mainly used for its redo functionality.
(use-package undo-tree
:ensure t
:bind
("C-_" . 'undo-tree-undo)
("M-_" . 'undo-tree-redo)
:config
(global-undo-tree-mode))
;; Nice startup screen.
(use-package dashboard
:ensure t
:config
(setq dashboard-banner-logo-title "")
(setq dashboard-startup-banner 3) ; add own image?
(setq dashboard-center-content t)
(setq dashboard-set-footer nil)
(dashboard-setup-startup-hook))
;; Easier selection for s-expressions and other things.
(use-package expand-region
:ensure t
:bind
("C-=" . er/expand-region)
:config
(pending-delete-mode t)) ; if you start typing while a word is selected, overwrite it
;; Multiple cursors make it easier to refactor stuff.
(use-package multiple-cursors
:ensure t
:config
(global-set-key (kbd "C->") 'mc/mark-next-like-this)
(setq mc/always-run-for-all t))
;; avy - jump around files more easily
;; (use-package avy
;; :ensure t
;; :bind ("M-s" . avy-goto-char))
;; Amazing git porcelain.
(use-package magit
:ensure t)
;; Minibuffer completion. Vertical display and faster than ido.
(use-package selectrum
:ensure t
:config
(selectrum-mode t))
;; better incremental search with minibuffer
(use-package swiper
:ensure t
:bind ("C-s" . 'swiper))
;; Instead of opening windows inside of Emacs, create new frames. This is great
;; for tiling window managers.
;; (use-package frames-only-mode
;; :ensure t
;; :config
;; (frames-only-mode))
;; Mode for browsing gemini/gopher sites.
(use-package elpher
:ensure t)
;; Highlight parentheses for Lisp
(use-package highlight-parentheses
:ensure t
:config
(add-hook 'scheme-mode-hook 'highlight-parentheses-mode)
(add-hook 'lisp-mode-hook 'highlight-parentheses-mode)
(add-hook 'emacs-lisp-mode-hook 'highlight-parentheses-mode))
;; org-mode
(use-package org
:ensure t
:bind
("C-c o c" . org-capture)
:config
;;; org-capture
;; Default location for org-capture is ~/org/notes.org
(setq org-default-notes-file (concat org-directory "/notes.org"))
(setq org-capture-templates
'(("t" "Task" entry (file+headline "~/org/tasks.org" "Tasks")
"* TODO %?\n %i\n %a")
("j" "Journal" entry (file+datetree "~/org/journal.org")
"* %?\nEntered on %U\n %i\n %a")))
(setq org-link-frame-setup '((vm . vm-visit-folder-other-frame)
(vm-imap . vm-visit-imap-folder-other-frame)
(gnus . org-gnus-no-new-news)
(file . find-file)
(wl . wl-other-frame))))
;; Notes
;; (use-package org-roam
;; :ensure t
;; :bind
;; ("C-c o i" . org-roam-jump-to-index)
;; ("C-c o n" . fez/org-roam-new-note)
;; :init
;; (setq org-roam-directory "~/Documents/org-roam"))
;; better shell-command
(use-package shell-command+
:ensure t
:config
(global-set-key (kbd "M-!") 'shell-command+))
;; Jump to definitions without tags
(use-package dumb-jump
:ensure t
:init
(add-hook 'xref-backend-functions 'dumb-jump-xref-activate)
(setq xref-show-definitions-function 'xref-show-definitions-completing-read))
;; Snippets
(use-package yasnippet
:ensure t
:config
(setq yas-snippet-dirs '("~/.emacs.d/snippets"))
(yas-global-mode 1))
(use-package god-mode
:init
(global-set-key (kbd "<escape>") #'god-mode-all)
(setq god-exempt-major-modes nil)
(setq god-exempt-predicates nil)
(setq god-mode-enable-function-key-translation nil))
(use-package exwm
:init
(defun fez/exwm-init-hook ()
(exwm-workspace-switch-create 1))
(require 'exwm-randr)
(setq exwm-randr-workspace-output-plist '(0 "HDMI-0"))
(add-hook 'exwm-randr-screen-change-hook
(lambda ()
(start-process-shell-command
"xrandr" nil "xrandr --output HDMI-0 --left-of DVI-D-0 --auto")))
(exwm-randr-enable)
(defun exwm-config ()
"EXWM configuration."
;; Set the initial workspace number.
(unless (get 'exwm-workspace-number 'saved-value)
(setq exwm-workspace-number 4))
;; Make class name the buffer name
(add-hook 'exwm-update-class-hook
(lambda ()
(exwm-workspace-rename-buffer exwm-class-name)))
;; Global keybindings.
(unless (get 'exwm-input-global-keys 'saved-value)
(setq exwm-input-global-keys
`(
;; 's-r': Reset (to line-mode, fullscreen).
([?\s-r] . exwm-reset)
;; 's-w': Switch workspace.
([?\s-w] . exwm-workspace-switch)
;; 's-&': Launch application.
([?\s-&] . (lambda (command)
(interactive (list (read-shell-command "$ ")))
(start-process-shell-command command nil command)))
;; 's-N': Switch to certain workspace.
(\,@(mapcar (lambda (i)
`(,(kbd (format "s-%d" i)) .
(lambda ()
(interactive)
(exwm-workspace-switch-create ,i))))
(number-sequence 0 9)))
;; 's-a': Toggle X mouse
([?\s-a] . fez/toggle-x-mouse)
;; 's-<space>': Toggle keyboard layouts
([?\s-\ ] . fez/swap-keyboard)
;; 's-l': Toggle line-mode and char-mode for the current window.
([?\s-l] . exwm-input-toggle-keyboard)
;; windmove movement commands
([?\s-u] . windmove-left)
([?\s-i] . windmove-down)
([?\s-o] . windmove-up)
([?\s-p] . windmove-right)))
;; Line-editing shortcuts
(unless (get 'exwm-input-simulation-keys 'saved-value)
(setq exwm-input-simulation-keys
'(([?\C-b] . [left])
([?\C-f] . [right])
([?\C-p] . [up])
([?\C-n] . [down])
([?\C-a] . [home])
([?\C-e] . [end])
([?\M-v] . [prior])
([?\C-v] . [next])
([?\C-d] . [delete])
([?\C-k] . [S-end delete]))))
;; Enable windmove keybinds
(winner-mode t)
;; Enable EXWM
(exwm-enable))))
(use-package elfeed
:ensure t
:config
(setq elfeed-feeds '(("http://tilde.town/~opfez/music_rss.xml" music)
("https://tilde.town/~dzwdz/blog.xml" friend)
("https://m455.casa/feed.rss" friend)
("https://itwont.work/atom.xml" friend)
("http://tilde.town/~archenoth/.weed" friend)
("https://tilde.town/~opfez/rss.xml" friend)
("https://dataswamp.org/~solene/rss.xml" blog)
("http://verisimilitudes.net/rss.xml" blog)
("https://stevelosh.com/rss.xml" blog)
("https://drewdevault.com/blog/index.xml" blog)
("https://ftrv.se/posts.rss" blog)
("https://ambrevar.xyz/atom.xml" blog)
("http://wingolog.org/feed/atom" blog)
("https://nullprogram.com/feed/" blog)
("https://www.brain-dump.org/index.xml" blog)
("https://hyper.dev/feed.xml" blog)
("https://100r.co/links/rss.xml" blog)
("https://weinholt.se/feed.xml" blog)
("https://www.more-magic.net/feed.atom" blog)
("https://planet.scheme.org/atom.xml" blog)
("https://planet.lisp.org/rss20.xml" blog)
("https://git.qorg11.net/kill9.git/rss" blog)
("https://regularflolloping.com/rss.xml" blog)
("https://sigkill.dk/atom.xml" blog)
("https://cosmic.voyage/rss.xml" other)
("https://xkcd.com/rss.xml" other)
("https://nixers.net/syndication.php?limit=15" other)
("http://lambda-the-ultimate.org/node/feed" other)
("https://solar.lowtechmagazine.com/feeds/all-en.atom.xml" news)
("http://n-gate.com/index.rss" news)
("https://suckless.org/atom.xml" news)
("https://www.aftenposten.no/rss/" news)
("https://www.nrk.no/toppsaker.rss" news)
("https://www.youtube.com/feeds/videos.xml?channel_id=UC_QIfHvN9auy2CoOdSfMWDw" youtube)
("https://www.youtube.com/feeds/videos.xml?channel_id=UCD6VugMZKRhSyzWEWA9W2fg" youtube)
("https://www.youtube.com/feeds/videos.xml?channel_id=UClOGLGPOqlAiLmOvXW5lKbw" youtube)
("https://www.youtube.com/feeds/videos.xml?channel_id=UC4nJnJ-HO5vVbGlJ14rf5yg" youtube)
("https://www.youtube.com/feeds/videos.xml?channel_id=UCpFOj1CQMr9a3zaqEfhkTJw" youtube)
("https://www.youtube.com/feeds/videos.xml?channel_id=UCsvn_Po0SmunchJYOWpOxMg" youtube)
("https://www.youtube.com/feeds/videos.xml?channel_id=UCsnGwSIHyoYN0kiINAGUKxg" youtube)
("https://www.youtube.com/feeds/videos.xml?channel_id=UCl_dlV_7ofr4qeP1drJQ-qg" youtube)
("https://www.youtube.com/feeds/videos.xml?channel_id=UC3ts8coMP645hZw9JSD3pqQ" youtube)
("https://www.youtube.com/feeds/videos.xml?channel_id=UCtUbO6rBht0daVIOGML3c8w" youtube)
("https://www.youtube.com/feeds/videos.xml?channel_id=UCJ8V9aiz50m6NVn0ix5v8RQ" youtube)
("https://www.youtube.com/feeds/videos.xml?channel_id=UC9-y-6csu5WGm29I7JiwpnA" youtube)
("https://www.youtube.com/feeds/videos.xml?channel_id=UCEKJKJ3FO-9SFv5x5BzyxhQ" youtube)
("https://www.youtube.com/feeds/videos.xml?channel_id=UCmu9PVIZBk-ZCi-Sk2F2utA" youtube)
("https://www.youtube.com/feeds/videos.xml?channel_id=UCUzQJ3JBuQ9w-po4TXRJHiA" youtube)
("https://www.youtube.com/feeds/videos.xml?channel_id=UCakAg8hC_RFJm4RI3DlD7SA" youtube)
("https://www.youtube.com/feeds/videos.xml?channel_id=UCEbYhDd6c6vngsF5PQpFVWg" youtube)
("https://www.youtube.com/feeds/videos.xml?channel_id=UC3azLjQuz9s5qk76KEXaTvA" youtube)
("https://www.youtube.com/feeds/videos.xml?channel_id=UCk2KE7yg0BwsJfr8Dp9ivUQ" youtube)
("https://www.youtube.com/feeds/videos.xml?channel_id=UCSdma21fnJzgmPodhC9SJ3g" youtube)
("https://www.youtube.com/feeds/videos.xml?channel_id=UCmtyQOKKmrMVaKuRXz02jbQ" youtube)
("https://www.youtube.com/feeds/videos.xml?channel_id=UCUmLRMERmJrmUtgnbFfknAg" youtube)
("https://www.youtube.com/feeds/videos.xml?channel_id=UCah7IyEzRnRdttwDGDdy_gw" youtube)
("https://www.youtube.com/feeds/videos.xml?channel_id=UCUmLRMERmJrmUtgnbFfknAg" youtube)
("https://www.youtube.com/feeds/videos.xml?channel_id=UCD6VugMZKRhSyzWEWA9W2fg" youtube)
("https://www.youtube.com/feeds/videos.xml?channel_id=UCL7DDQWP6x7wy0O6L5ZIgxg" youtube)
("https://www.youtube.com/feeds/videos.xml?channel_id=UCqp1yi_juq5JJuzKY71Hoag" youtube)
("https://www.youtube.com/feeds/videos.xml?channel_id=UC1kBxkk2bcG78YBX7LMl9pQ" youtube))))
(provide 'packages)