The problem with non-fuzzy ivy searches is that you lose the ability to type the first two or three letters of a directory and file to jump quickly to it. There may be some other way to accomplish that goal, but I've yet to find it.
199 lines
6.3 KiB
EmacsLisp
199 lines
6.3 KiB
EmacsLisp
;;; ~/.config/doom/config.el -*- lexical-binding: t; -*-
|
|
|
|
;; (defvar xdg-data (getenv "XDG_DATA_HOME"))
|
|
;; (defvar xdg-bin (getenv "XDG_BIN_HOME"))
|
|
;; (defvar xdg-cache (getenv "XDG_CACHE_HOME"))
|
|
;; (defvar xdg-config (getenv "XDG_CONFIG_HOME"))
|
|
|
|
(add-to-list 'default-frame-alist '(inhibit-double-buffering . t))
|
|
|
|
(setq user-full-name "Colin Powell"
|
|
user-mail-address "colin@onec.me")
|
|
|
|
(setq doom-theme 'wombat)
|
|
|
|
(if (display-graphic-p)
|
|
(setq doom-theme 'doom-vibrant))
|
|
|
|
|
|
;; Fonts
|
|
(setq doom-font (font-spec :family "IBM Plex Mono" :size 14))
|
|
(setq doom-big-font (font-spec :family "IBM Plex Mono" :size 21))
|
|
|
|
;; Host-specific config
|
|
|
|
(pcase (system-name)
|
|
("prometheus"
|
|
(font-put doom-font :size 14)
|
|
(font-put doom-big-font :size 20)) ; smaller display
|
|
("triton"
|
|
;; I've swapped these keys on my keyboard
|
|
(setq x-super-keysym 'meta
|
|
x-meta-keysym 'super)))
|
|
|
|
(set-frame-parameter nil 'internal-border-width 12)
|
|
|
|
;;
|
|
;; Keybinds
|
|
|
|
;;:m "M-j" '+hlissner:multi-next-line
|
|
;;:m "M-k" '+hlissner:multi-previous-line
|
|
(map! ;; Easier window movement
|
|
:n "C-h" 'evil-window-left
|
|
:n "C-j" 'evil-window-down
|
|
:n "C-k" 'evil-window-up
|
|
:n "C-l" 'evil-window-right
|
|
|
|
(:map evil-treemacs-state-map
|
|
"C-h" 'evil-window-left
|
|
"C-l" 'evil-window-right)
|
|
|
|
(:when IS-LINUX
|
|
"s-x" #'execute-extended-command
|
|
"s-;" #'eval-expression
|
|
;; use super for window/frame navigation/manipulation
|
|
"s-w" #'delete-window
|
|
"s-W" #'delete-frame
|
|
"s-n" #'+default/new-buffer
|
|
"s-j" #'org-move-subtree-down
|
|
"s-k" #'org-move-subtree-up
|
|
"s-N" #'make-frame
|
|
"s-q" (if (daemonp) #'delete-frame #'evil-quit-all)
|
|
;; Restore OS undo, save, copy, & paste keys (without cua-mode, because
|
|
;; it imposes some other functionality and overhead we don't need)
|
|
"s-z" #'undo
|
|
"s-c" (if (featurep 'evil) #'evil-yank #'copy-region-as-kill)
|
|
"s-v" #'yank
|
|
"s-s" #'save-buffer
|
|
;; Buffer-local font scaling
|
|
"s-+" (λ! (text-scale-set 0))
|
|
"s-=" #'text-scale-increase
|
|
"s--" #'text-scale-decrease
|
|
;; Conventional text-editing keys
|
|
"s-a" #'mark-whole-buffer
|
|
:gi [s-return] #'+default/newline-below
|
|
:gi [s-S-return] #'+default/newline-above
|
|
:gi [s-backspace] #'doom/backward-kill-to-bol-and-indent)
|
|
|
|
:leader
|
|
(:prefix "j"
|
|
:desc "Dumb jump to def" "g" #'dumb-jump-go
|
|
:desc "Dumb jump back" "b" #'dumb-jump-back)
|
|
(:prefix "f"
|
|
:desc "Find file in dotfiles" "t" #'+hlissner/find-in-dotfiles
|
|
:desc "Browse dotfiles" "T" #'+hlissner/browse-dotfiles)
|
|
(:prefix "t"
|
|
:desc "Switch themes" "t" #'load-theme)
|
|
(:prefix "o"
|
|
:desc "Open imenu" "i" #'lsp-ui-imenu
|
|
:desc "Elfeed feed reader" "f" #'elfeed
|
|
:desc "Lobste.rs" "l" #'ivy-lobsters
|
|
:desc "w3m goto URL" "g" #'w3m-goto-url
|
|
:desc "w3m search" "s" #'w3m-search
|
|
:desc "Compose an email" "c" #'notmuch-mua-new-mail)
|
|
(:prefix "l"
|
|
:desc "MPD Open playlist" "o" #'mpdel-playlist-open
|
|
:desc "MPD Remove at point" "d" #'mpdel-playlist-delete
|
|
:desc "MPD Start at point" "s" #'mpdel-playlist-play
|
|
:desc "MPD Next track" "n" #'libmpdel-playback-next
|
|
:desc "MPD Previous track" "p" #'libmpdel-playback-previous)
|
|
(:prefix "b"
|
|
:desc "Black format buffer" "f" #'blacken-buffer
|
|
:desc "Links in buffer" "l" #'ace-link-org)
|
|
(:prefix "/"
|
|
:desc "Search project TODOs" "t" #'+ivy/tasks
|
|
:desc "Search the web" "w" #'web-search
|
|
:desc "Search all the things" "g" #'deadgrep)
|
|
(:prefix "y"
|
|
:desc "Yank pop!" "p" #'counsel-yank-pop
|
|
:desc "Git yank link" "g" #'git-link))
|
|
|
|
;; app/search
|
|
(after! web-search
|
|
(push '("Searx" "http://search.unbl.ink/?q=%s")
|
|
web-search-providers)
|
|
(setq web-search-default-provider "Searx"))
|
|
|
|
(def-package! org-alert
|
|
:commands (org-alert-enable))
|
|
|
|
(after! org-alert-mode
|
|
(setq alert-default-style 'libnotify))
|
|
|
|
;;
|
|
;; Modules
|
|
|
|
(setq +workspaces-switch-project-function #'ignore
|
|
+format-on-save-enabled-modes '(python-mode)
|
|
+pretty-code-enabled-modes '(emacs-lisp-mode org-mode))
|
|
|
|
;; app/mpdel
|
|
;;
|
|
(setq libmpdel-hostname "play.unbl.ink")
|
|
|
|
;; app/rss
|
|
(add-hook! 'elfeed-show-mode-hook (text-scale-set 1.5))
|
|
|
|
(setq rmh-elfeed-org-files (list "~/org/elfeed.org")
|
|
elfeed-search-filter "@1-week-ago +unread ")
|
|
|
|
;; emacs/eshell
|
|
(after! eshell
|
|
(set-eshell-alias!
|
|
"f" "(other-window 1) && find-file $1"
|
|
"l" "ls -lh"
|
|
"d" "dired $1"
|
|
"gl" "(call-interactively 'magit-log-current)"
|
|
"gs" "magit-status"
|
|
"gc" "magit-commit"))
|
|
|
|
(add-hook 'prog-mode-hook #'goto-address-mode) ;; Linkify links!
|
|
|
|
;; tools/deft
|
|
(setq deft-extensions '("org"))
|
|
(setq deft-directory "~/org")
|
|
|
|
;; tools/magit
|
|
(setq magit-repository-directories '(("~/work" . 2))
|
|
magit-save-repository-buffers nil)
|
|
|
|
;;; Setup sending email with msmtp
|
|
(setq send-mail-function 'sendmail-send-it
|
|
sendmail-program "/usr/local/bin/msmtp"
|
|
mail-specify-envelope-from t
|
|
message-sendmail-f-is-evil t
|
|
message-sendmail-envelope-from 'header
|
|
message-sendmail-extra-arguments '("--read-envelope-from")
|
|
mail-envelope-from 'header)
|
|
|
|
;;; It is the opposite of fill-paragraph
|
|
(defun unfill-paragraph ()
|
|
"Takes a multi-line paragraph and makes it into a single line of text."
|
|
(interactive)
|
|
(let ((fill-column (point-max)))
|
|
(fill-paragraph nil)))
|
|
;; Handy key definition
|
|
(define-key global-map "\M-z" 'unfill-paragraph)
|
|
|
|
(achievements-mode)
|
|
(nyan-mode)
|
|
|
|
(add-to-list 'auto-mode-alist '("\\.plantuml\\'" . planetuml-mode))
|
|
|
|
(load! "+ui.el")
|
|
(load! "+org") ;; Org mode stuff like todos and rebindings
|
|
(load! "+org-cal")
|
|
;(load! "+elfeed")
|
|
(load! "+mail") ;; Mail stuff
|
|
(load! "+ranger")
|
|
(load! "+wttrin") ;; Weather config
|
|
|
|
(defun mpdel-playlist-play ()
|
|
"Start playing the song at point."
|
|
(interactive)
|
|
(if (derived-mode-p 'mpdel-playlist-current-playlist-mode)
|
|
(libmpdel-play-song (navigel-entity-at-point))
|
|
(mpdel-core-insert-current-playlist)))
|
|
|
|
(add-to-list 'auto-mode-alist '("\\.epub\\'" . nov-mode))
|