862 lines
25 KiB
EmacsLisp
862 lines
25 KiB
EmacsLisp
;;; init --- Summary
|
||
|
||
;;; Commentary:
|
||
|
||
;;; Code:
|
||
|
||
(setq custom-file (concat user-emacs-directory "customizations.el"))
|
||
(load custom-file)
|
||
|
||
;; Initialize the package system and use-package
|
||
(setq load-prefer-newer t)
|
||
|
||
;; Add my own, version controlled ~lisp~ directory to ~load-path~
|
||
|
||
(add-to-list 'load-path (expand-file-name
|
||
(convert-standard-filename "lisp/")
|
||
user-emacs-directory))
|
||
|
||
;; Do the same with the local ~site-lisp~ if it’s there
|
||
|
||
(let ((site-lisp-dir "/usr/local/share/emacs/site-lisp"))
|
||
(when (file-directory-p site-lisp-dir)
|
||
(dolist (elt (directory-files site-lisp-dir))
|
||
(unless (or (string= elt ".") (string= elt ".."))
|
||
(add-to-list 'load-path (expand-file-name elt site-lisp-dir))))))
|
||
|
||
;; I prefer using freedesktop’s desktop specification everywhere
|
||
(load "xdg-paths")
|
||
|
||
;; Set up the package manager
|
||
|
||
;; Package archives
|
||
|
||
(require 'package)
|
||
|
||
;; GNU ELPA
|
||
(add-to-list 'package-archives '("gnu" . "https://elpa.gnu.org/packages/"))
|
||
;; MELPA Stable
|
||
(add-to-list 'package-archives '("melpa-stable" . "https://stable.melpa.org/packages/") t)
|
||
;; MELPA
|
||
(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/") t)
|
||
|
||
;; Finally, initialise the package manager
|
||
(package-initialize)
|
||
|
||
;; use-package is a really convenient way to install packages. It’s installed in 30.1, but let’s stay on the safe side.
|
||
(unless (package-installed-p 'use-package)
|
||
(package-refresh-contents)
|
||
(package-install 'use-package))
|
||
(require 'use-package)
|
||
|
||
(use-package use-package
|
||
:custom
|
||
(use-package-always-ensure t)
|
||
(use-package-verbose nil))
|
||
|
||
(use-package bind-key)
|
||
|
||
;; Custom functions and commands
|
||
(load "gpolonkai/utilities")
|
||
(load "gpolonkai/windows")
|
||
(load "gpolonkai/org-utils")
|
||
(load "gpolonkai/text-utils")
|
||
(load "gpolonkai/nav-utils")
|
||
(load "gpolonkai/file-utils")
|
||
(load "gpolonkai/magit-utils")
|
||
|
||
(defun crm-indicator (args)
|
||
"Generate a prompt for `completing-read-multiple'.
|
||
|
||
ARGS is a cons cell of two strings, which will be used in the prompt in reverse
|
||
order."
|
||
(cons (format "[CRM%s] %s"
|
||
(replace-regexp-in-string
|
||
"\\`\\[.*?]\\*\\|\\[.*?]\\*\\'"
|
||
""
|
||
crm-separator)
|
||
(car args))
|
||
(cdr args)))
|
||
|
||
(use-package emacs
|
||
:ensure nil
|
||
:init
|
||
;; Required for Consult/Vertico
|
||
(advice-add #'completing-read-multiple :filter-args #'crm-indicator)
|
||
(setq frame-title-format
|
||
'((:eval (concat system-name
|
||
": "
|
||
(if (buffer-file-name)
|
||
(abbreviate-file-name (buffer-file-name))
|
||
"%b")))))
|
||
:custom
|
||
(user-full-name "Gergely Polonkai")
|
||
(user-mail-address "gergely@polonkai.eu")
|
||
(kill-read-only-ok t)
|
||
(use-dialog-box nil)
|
||
(cursor-type 'bar)
|
||
(echo-keystrokes .01)
|
||
(fill-column 120)
|
||
(initial-scratch-message "")
|
||
(minibuffer-prompt-properties '(read-only t cursor-intangible t face minibuffer-prompt))
|
||
(enable-recursive-minibuffers t)
|
||
(completion-cycle-threshold 3)
|
||
(tab-always-indent 'complete)
|
||
:hook
|
||
(minibuffer-setup . cursor-intangible-mode))
|
||
|
||
;; Basic settings
|
||
;;
|
||
;; Now that we have package management configured we can set up defaults more
|
||
;; easily. This includes every builtin packages, font faces, and the like.
|
||
|
||
;; Set Org’s main directory
|
||
;;
|
||
;; Since a lot of packages (org-projectile, org-caldav, etc.) rely on it, it
|
||
;; needs to be set as early as possible.
|
||
|
||
(setq org-directory (expand-file-name "~/Nextcloud/orgmode"))
|
||
|
||
;; Set up my personal keymap
|
||
|
||
(defvar gpolonkai/pers-map (make-sparse-keymap)
|
||
"My own, personal, keymap!")
|
||
(define-prefix-command 'gpolonkai/pers-map)
|
||
(define-key ctl-x-map "t" 'gpolonkai/pers-map)
|
||
(define-key global-map (kbd "C-t") 'gpolonkai/pers-map)
|
||
|
||
;; Set up some faces
|
||
|
||
(use-package faces
|
||
:ensure nil
|
||
:custom-face
|
||
(default ((t (:family "Fira Code Retina" :foundry "simp" :slant normal :weight normal :height 100 :width normal))))
|
||
(trailing-whitespace ((t (:inherit nil :background "red3")))))
|
||
|
||
;; Fira Code comes with nice ligatures, let’s use them!
|
||
|
||
(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 Cascadia and Fira Code ligatures in programming modes
|
||
(ligature-set-ligatures 'prog-mode
|
||
'(;; == === ==== => =| =>>=>=|=>==>> ==< =/=//=// =~
|
||
;; =:= =!=
|
||
("=" (rx (+ (or ">" "<" "|" "/" "~" ":" "!" "="))))
|
||
;; ;; ;;;
|
||
(";" (rx (+ ";")))
|
||
;; && &&&
|
||
("&" (rx (+ "&")))
|
||
;; !! !!! !. !: !!. != !== !~
|
||
("!" (rx (+ (or "=" "!" "\." ":" "~"))))
|
||
;; ?? ??? ?: ?= ?.
|
||
("?" (rx (or ":" "=" "\." (+ "?"))))
|
||
;; %% %%%
|
||
("%" (rx (+ "%")))
|
||
;; |> ||> |||> ||||> |] |} || ||| |-> ||-||
|
||
;; |->>-||-<<-| |- |== ||=||
|
||
;; |==>>==<<==<=>==//==/=!==:===>
|
||
("|" (rx (+ (or ">" "<" "|" "/" ":" "!" "}" "\]"
|
||
"-" "=" ))))
|
||
;; \\ \\\ \/
|
||
("\\" (rx (or "/" (+ "\\"))))
|
||
;; ++ +++ ++++ +>
|
||
("+" (rx (or ">" (+ "+"))))
|
||
;; :: ::: :::: :> :< := :// ::=
|
||
(":" (rx (or ">" "<" "=" "//" ":=" (+ ":"))))
|
||
;; // /// //// /\ /* /> /===:===!=//===>>==>==/
|
||
("/" (rx (+ (or ">" "<" "|" "/" "\\" "\*" ":" "!"
|
||
"="))))
|
||
;; .. ... .... .= .- .? ..= ..<
|
||
("\." (rx (or "=" "-" "\?" "\.=" "\.<" (+ "\."))))
|
||
;; -- --- ---- -~ -> ->> -| -|->-->>->--<<-|
|
||
("-" (rx (+ (or ">" "<" "|" "~" "-"))))
|
||
;; *> */ *) ** *** ****
|
||
("*" (rx (or ">" "/" ")" (+ "*"))))
|
||
;; www wwww
|
||
("w" (rx (+ "w")))
|
||
;; <> <!-- <|> <: <~ <~> <~~ <+ <* <$ </ <+> <*>
|
||
;; <$> </> <| <|| <||| <|||| <- <-| <-<<-|-> <->>
|
||
;; <<-> <= <=> <<==<<==>=|=>==/==//=!==:=>
|
||
;; << <<< <<<<
|
||
("<" (rx (+ (or "\+" "\*" "\$" "<" ">" ":" "~" "!"
|
||
"-" "/" "|" "="))))
|
||
;; >: >- >>- >--|-> >>-|-> >= >== >>== >=|=:=>>
|
||
;; >> >>> >>>>
|
||
(">" (rx (+ (or ">" "<" "|" "/" ":" "=" "-"))))
|
||
;; #: #= #! #( #? #[ #{ #_ #_( ## ### #####
|
||
("#" (rx (or ":" "=" "!" "(" "\?" "\[" "{" "_(" "_"
|
||
(+ "#"))))
|
||
;; ~~ ~~~ ~= ~- ~@ ~> ~~>
|
||
("~" (rx (or ">" "=" "-" "@" "~>" (+ "~"))))
|
||
;; __ ___ ____ _|_ __|____|_
|
||
("_" (rx (+ (or "_" "|"))))
|
||
;; Fira code: 0xFF 0x12
|
||
("0" (rx (and "x" (+ (in "A-F" "a-f" "0-9")))))
|
||
;; Fira code:
|
||
"Fl" "Tl" "fi" "fj" "fl" "ft"
|
||
;; The few not covered by the regexps.
|
||
"{|" "[|" "]#" "(*" "}#" "$>" "^="))
|
||
;; Enables ligature checks globally in all buffers. You can also do it
|
||
;; per mode with `ligature-mode'.
|
||
(global-ligature-mode t))
|
||
|
||
;; Set the default font and configure font resizing
|
||
|
||
;; Before this can be used, make sure the Symbola font
|
||
;; (https://zhm.github.io/symbola/) font is installed.
|
||
|
||
(defun gpolonkai/set-font-size (frame)
|
||
"Set default fonts and font sizes in FRAME."
|
||
(when (display-graphic-p frame)
|
||
(set-face-attribute 'default frame :font "Fira Code Retina-10")
|
||
(set-frame-font "Fira Code Retina-10" t (list frame))))
|
||
|
||
(defun --set-emoji-font (frame)
|
||
"Adjust the font setting of FRAME so Emacs can display Emoji properly."
|
||
(when (display-graphic-p frame)
|
||
(set-fontset-font t 'symbol
|
||
(font-spec :family "Symbola")
|
||
frame 'prepend)
|
||
(set-fontset-font t 'unicode
|
||
"Noto Emoji"
|
||
nil 'append)))
|
||
|
||
(add-hook 'after-make-frame-functions 'gpolonkai/set-font-size)
|
||
(add-hook 'after-make-frame-functions '--set-emoji-font)
|
||
|
||
(gpolonkai/set-font-size nil)
|
||
(--set-emoji-font nil)
|
||
|
||
;; Set UTF-8 as the default encoding
|
||
(set-language-environment "UTF-8")
|
||
(set-default-coding-systems 'utf-8)
|
||
|
||
(use-package frame
|
||
:ensure nil
|
||
:custom
|
||
(blink-cursor-mode t))
|
||
|
||
;; I really don’t want to type more than i really must…
|
||
|
||
(defalias 'yes-or-no-p 'y-or-n-p)
|
||
|
||
;; Tweak window chrome, AKA let’s set up the UI!
|
||
|
||
;; Turn off the toolbar
|
||
(tool-bar-mode 0)
|
||
;; Turn off the menu bar
|
||
(menu-bar-mode 0)
|
||
|
||
;; If we are running in a graphical environment, turn off the scroll bar
|
||
;;
|
||
;; TODO: This is not done for every new frame!
|
||
(when window-system
|
||
(scroll-bar-mode -1))
|
||
|
||
;; Maximise newly created frames (AKA DE windows)
|
||
(set-frame-parameter nil 'fullscreen 'maximized)
|
||
|
||
;; Enable all the commands! These are disabled for a reason, but i’m a rockstar,
|
||
;; so who cares‽
|
||
;;
|
||
;; TODO: There must be a way to do it programatically
|
||
(put 'downcase-region 'disabled nil)
|
||
(put 'upcase-region 'disabled nil)
|
||
(put 'erase-buffer 'disabled nil)
|
||
(put 'narrow-to-region 'disabled nil)
|
||
(put 'narrow-to-page 'disabled nil)
|
||
(put 'set-goal-column 'disabled nil)
|
||
(put 'scroll-left 'disabled nil)
|
||
(put 'dired-find-alternate-file 'disabled nil)
|
||
(put 'Info-edit 'disabled nil)
|
||
(put 'list-timers 'disabled nil)
|
||
|
||
;; simple to always show the current column, and using visual lines in text
|
||
;; modes
|
||
|
||
(use-package simple
|
||
:ensure nil
|
||
:custom
|
||
(column-number-mode t)
|
||
:hook
|
||
(text-mode . (lambda () (visual-line-mode t))))
|
||
|
||
(use-package prog-mode
|
||
:ensure nil
|
||
:init
|
||
(setq prettify-symbols-alist
|
||
'(("lambda" . ?λ)
|
||
("function" . ?ƒ)
|
||
("map" . ?↦)
|
||
("not" . ?¬)
|
||
("and" . ?∧)
|
||
("or" . ?∨)))
|
||
:config
|
||
(global-prettify-symbols-mode t))
|
||
|
||
(use-package thingatpt
|
||
:ensure nil)
|
||
|
||
(use-package nxml-mode
|
||
:ensure nil
|
||
:custom
|
||
(nxml-attribute-indent 4)
|
||
(nxml-child-indent 4)
|
||
(nxml-outline-child-indent 4))
|
||
|
||
(use-package recentf
|
||
:ensure nil
|
||
:config
|
||
(run-at-time nil (* 5 60) 'recentf-save-list)
|
||
(add-to-list 'recentf-exclude (expand-file-name "elpa" user-emacs-directory)))
|
||
|
||
(use-package files
|
||
:ensure nil
|
||
:custom
|
||
(make-backup-file-name-function 'xah/backup-file-name))
|
||
|
||
(defun prevent-whitespace-mode-for-some ()
|
||
"Prevent `whitespace-mode' from running in some modes."
|
||
(and
|
||
(not (derived-mode-p 'magit-mode))
|
||
(not (derived-mode-p 'org-mode))))
|
||
|
||
(use-package whitespace
|
||
:demand
|
||
:config
|
||
(add-function :before-while whitespace-enable-predicate 'prevent-whitespace-mode-for-some)
|
||
(global-whitespace-mode 1)
|
||
:custom
|
||
(whitespace-line-column 120)
|
||
:bind
|
||
(([f10] . whitespace-mode)
|
||
([(shift f10)] . global-whitespace-mode)
|
||
:map gpolonkai/pers-map
|
||
("w" . whitespace-cleanup))
|
||
:custom-face
|
||
(whitespace-line ((t (:inherit nil :background "orange4")))))
|
||
|
||
;; Taken from https://ryuslash.org/posts/C-d-to-close-eshell.html
|
||
|
||
(defun eshell-C-d ()
|
||
"Either call `delete-char' interactively or quit."
|
||
(interactive)
|
||
|
||
(condition-case err
|
||
(call-interactively #'delete-char)
|
||
(error (if (and (eq (car err) 'end-of-buffer)
|
||
(looking-back eshell-prompt-regexp nil))
|
||
(kill-buffer)
|
||
(signal (car err) (cdr err))))))
|
||
|
||
(defun gpolonkai/eshell-set-c-d-locally ()
|
||
"Bind my `eshell-C-d' function locally."
|
||
(local-set-key (kbd "C-d") #'eshell-C-d))
|
||
|
||
;; Taken from https://blog.hoetzel.info/post/eshell-notifications/
|
||
|
||
(defun eshell-command-alert (process status)
|
||
"Send `alert' with severity based on STATUS when PROCESS finished."
|
||
(let* ((cmd (process-command process))
|
||
(buffer (process-buffer process))
|
||
(msg (format "%s: %s" (mapconcat 'identity cmd " ") status)))
|
||
(if (string-prefix-p "finished" status)
|
||
(alert msg :buffer buffer :severity 'normal)
|
||
(alert msg :buffer buffer :severity 'urgent))))
|
||
|
||
(use-package eshell
|
||
:bind
|
||
(:map gpolonkai/pers-map
|
||
("e" . eshell))
|
||
:hook
|
||
(eshell-mode . gpolonkai/eshell-set-c-d-locally)
|
||
(eshell-kill . eshell-command-alert))
|
||
|
||
(use-package calendar
|
||
:ensure nil
|
||
:custom
|
||
(calendar-week-start-day 1))
|
||
|
||
(use-package cal-dst
|
||
:ensure nil
|
||
:custom
|
||
(calendar-time-zone 60)
|
||
(calendar-standard-time-zone-name "CET")
|
||
(calendar-daylight-time-zone-name "CEST"))
|
||
|
||
(use-package solar
|
||
:ensure nil
|
||
:custom
|
||
(calendar-latitude 47.4)
|
||
(calendar-longitude 19.0)
|
||
(calendar-location-name "Budapest, Hungary"))
|
||
|
||
;; TODO: This :config call can be omitted if i add it to the calendar-load-hook
|
||
(use-package hungarian-holidays
|
||
:config
|
||
(hungarian-holidays-add))
|
||
|
||
(add-to-list 'holiday-other-holidays '(holiday-float 7 5 -1 "SysAdmin Day") t)
|
||
(add-to-list 'holiday-other-holidays '(holiday-fixed 10 21 "Reptile Awareness Day") t)
|
||
|
||
(use-package saveplace
|
||
:ensure nil
|
||
:config
|
||
(save-place-mode 1)
|
||
:custom
|
||
(save-place-file (expand-file-name ".places" user-emacs-directory)))
|
||
|
||
(use-package ediff
|
||
:ensure nil
|
||
:custom
|
||
(ediff-merge-split-window-function 'split-window-horizontally)
|
||
(ediff-split-window-function 'split-window-vertically)
|
||
(ediff-window-setup-function 'ediff-setup-windows-plain))
|
||
|
||
(use-package autorevert
|
||
:ensure nil
|
||
:config
|
||
(global-auto-revert-mode 1))
|
||
|
||
(use-package eww
|
||
:custom
|
||
(eww-search-prefix "https://duckduckgo.com/html/?q="))
|
||
|
||
;; TODO: This :config call can be omitted if i add it to prog-mode-hook
|
||
(use-package electric
|
||
:config
|
||
;; This seems to be the default, but let’s make sure…
|
||
(electric-indent-mode 1))
|
||
|
||
(use-package savehist
|
||
:config
|
||
(savehist-mode 1))
|
||
|
||
(use-package webjump
|
||
:bind
|
||
(:map gpolonkai/pers-map
|
||
("j" . webjump)))
|
||
|
||
(defun gpolonkai/activate-which-func-mode ()
|
||
"Activate `which-func-mode' if it exists."
|
||
(if (fboundp 'which-function-mode)
|
||
(which-function-mode)
|
||
(which-func-mode)))
|
||
|
||
;; This :config call can be omitted if i add it to which-function-mode-hook
|
||
(use-package which-func
|
||
:config
|
||
(setq which-func-unknown "∅")
|
||
:hook
|
||
(prog-mode . gpolonkai/activate-which-func-mode))
|
||
|
||
;; “Fortunes” are from the Hungarian version an ancient MS-DOS based program called TAGLINE
|
||
|
||
(use-package cookie1
|
||
:demand t
|
||
:custom
|
||
(cookie-file (expand-file-name "fortune-cookies.txt" user-emacs-directory))
|
||
:bind
|
||
(:map gpolonkai/pers-map
|
||
("k" . cookie)))
|
||
|
||
(use-package dired
|
||
:ensure nil
|
||
:custom
|
||
(dired-dwim-target t)
|
||
(wdired-create-parent-directories t)
|
||
(wdired-allow-to-change-permissions t)
|
||
:bind
|
||
(:map dired-mode-map
|
||
("RET" . dired-find-alternate-file)
|
||
("^" . (lambda () (interactive) (find-alternate-file "..")))
|
||
("W" . wdired-change-to-wdired-mode)))
|
||
|
||
(use-package goto-addr
|
||
:hook ((compilation-mode . goto-address-mode)
|
||
(prog-mode . goto-address-prog-mode)
|
||
(eshell-mode . goto-address-mode)
|
||
(shell-mode . goto-address-mode))
|
||
:bind
|
||
(:map goto-address-highlight-keymap
|
||
("<RET>" . goto-address-at-point)
|
||
("M-<RET>" . newline))
|
||
:commands (goto-address-prog-mode goto-address-mode))
|
||
|
||
;; Close unused buffers at midnight.
|
||
(use-package midnight
|
||
:ensure nil
|
||
:custom
|
||
(clean-buffer-list-kill-never-buffer-names '("*scratch*"
|
||
"*Messages*"
|
||
"*dashboard*"))
|
||
:config
|
||
(midnight-mode t))
|
||
|
||
(use-package display-line-numbers
|
||
:bind
|
||
(:map gpolonkai/pers-map
|
||
("C-n" . display-line-numbers-mode)))
|
||
|
||
(use-package ispell
|
||
:custom
|
||
(ispell-dictionary "en_GB")
|
||
(ispell-program-name "/usr/bin/hunspell")
|
||
:hook
|
||
(mail-send . ispell-message)
|
||
(message-send . ispell-message))
|
||
|
||
(use-package speedbar)
|
||
|
||
;; A Termux-specific override for `browse-url'
|
||
(when (gpolonkai/termux-p)
|
||
(use-package browse-url
|
||
:ensure nil
|
||
:config
|
||
(advice-add 'browse-url-default-browser :override
|
||
(lambda (url &rest args)
|
||
(start-process-shell-command
|
||
"open-url"
|
||
nil
|
||
(concat "am start -a android.intent.action.VIEW --user 0 -d "
|
||
url))))))
|
||
|
||
(use-package dabbrev
|
||
:bind (("M-/" . dabbrev-completion)
|
||
("C-M-/" . dabbrev-expand)))
|
||
|
||
;; Make sure we always have the latest ELPA GPG keys
|
||
(use-package gnu-elpa-keyring-update)
|
||
|
||
;; Keep packages up to date
|
||
|
||
(use-package auto-package-update
|
||
:custom
|
||
(auto-package-update-interval 7)
|
||
(auto-package-update-delete-old-versions t)
|
||
;; Even though this might require a restart when packages are updated, since
|
||
;; `use-package' invocations update the list of installed packages, we have to
|
||
;; do this in `after-init-hook'.
|
||
:hook
|
||
(after-init . auto-package-update-maybe))
|
||
|
||
;; TODO: This :config call might be omitted if i move it to
|
||
;; ace-window-display-mode-hook
|
||
(use-package ace-window
|
||
:custom
|
||
(aw-background nil)
|
||
(aw-dispatch-always t)
|
||
:config
|
||
(add-to-list 'aw-dispatch-alist
|
||
'(?s gpolonkai/scroll-window-up " Scroll window up")
|
||
t)
|
||
(add-to-list 'aw-dispatch-alist
|
||
'(?S gpolonkai/scroll-window-down " Scroll window down")
|
||
t)
|
||
(add-to-list 'aw-dispatch-alist
|
||
'(?q gpolonkai/bury-window " Bury (quit) window")
|
||
t)
|
||
:bind
|
||
(:map ctl-x-map
|
||
("o" . ace-window))
|
||
:custom-face
|
||
(aw-leading-char-face ((t (:inherit ace-jump-face-foreground :height 2.0)))))
|
||
|
||
(use-package doom-themes
|
||
:custom
|
||
(doom-themes-enable-bold t)
|
||
(doom-themes-enable-italic t)
|
||
:config
|
||
(load-theme 'doom-nord-aurora t)
|
||
(doom-themes-visual-bell-config)
|
||
(doom-themes-org-config))
|
||
|
||
;; The package that converted me to Emacs:
|
||
;; https://gergely.polonkai.eu/blog/2014/9/17/nyanmacs.html
|
||
(use-package nyan-mode
|
||
:config
|
||
(nyan-mode t)
|
||
:custom
|
||
(nyan-bar-length 20)
|
||
(nyan-animate-nyancat t)
|
||
(nyan-wavy-trail t))
|
||
|
||
;; The list of active minor modes can easily fill my whole mode line (twice…).
|
||
;; This is one of the things to protect me from that.
|
||
(use-package delight)
|
||
|
||
(use-package minions
|
||
:config
|
||
(minions-mode 1))
|
||
|
||
(use-package doom-modeline
|
||
:init
|
||
(doom-modeline-mode 1)
|
||
:custom
|
||
(doom-modeline-continuous-word-count-modes '(markdown-mode gfm-mode org-mode rst-mode))
|
||
(doom-modeline-hud t)
|
||
(doom-modeline-minor-modes t))
|
||
|
||
(use-package beacon
|
||
:demand
|
||
:config
|
||
(beacon-mode 1)
|
||
:bind
|
||
(:map gpolonkai/pers-map
|
||
("b" . beacon-blink)))
|
||
|
||
(use-package eshell-fringe-status
|
||
:hook
|
||
(eshell-mode . eshell-fringe-status-mode))
|
||
|
||
(use-package eshell-prompt-extras
|
||
:config
|
||
(with-eval-after-load "esh-opt"
|
||
(autoload 'epe-theme-lambda "eshell-prompt-extras"))
|
||
:custom
|
||
(eshell-highlight-prompt nil)
|
||
(eshell-prompt-function 'epe-theme-lambda))
|
||
|
||
;; Some (many? most?) Emacs packages use this to do some logical separation of
|
||
;; the code. It is also used by some compilers, and Emacs’ help system.
|
||
|
||
(use-package form-feed
|
||
:hook
|
||
(emacs-lisp-mode . form-feed-mode)
|
||
(compilation-mode . form-feed-mode)
|
||
(help-mode . form-feed-mode))
|
||
|
||
(use-package hl-line
|
||
:config
|
||
(when window-system
|
||
(global-hl-line-mode))
|
||
:custom-face
|
||
(hl-line ((t (:inherit nil :background "gray25")))))
|
||
|
||
(use-package ace-jump-mode
|
||
:bind
|
||
(:map gpolonkai/pers-map
|
||
("SPC" . ace-jump-mode)))
|
||
|
||
(defun gpolonkai/no-blink-matching-paren ()
|
||
"Disable blinking matching parens."
|
||
(customize-set-variable 'blink-matching-paren nil))
|
||
|
||
(defun gpolonkai/blink-matching-paren ()
|
||
"Enable blinking matching parens."
|
||
(customize-set-variable 'blink-matching-paren t))
|
||
|
||
(use-package multiple-cursors
|
||
:init
|
||
(defvar gpolonkai/mc-prefix-map (make-sparse-keymap)
|
||
"Prefix keymap for multiple-cursors")
|
||
(define-prefix-command 'gpolonkai/mc-prefix-map)
|
||
(define-key global-map (kbd "C-c m") 'gpolonkai/mc-prefix-map)
|
||
:hook
|
||
(multiple-cursors-mode-enabled . gpolonkai/no-blink-matching-paren)
|
||
(multiple-cursors-mode-disabled . gpolonkai/blink-matching-paren)
|
||
:bind
|
||
(:map gpolonkai/mc-prefix-map
|
||
("t" . mc/mark-all-like-this)
|
||
("m" . mc/mark-all-like-this-dwim)
|
||
("l" . mc/edit-lines)
|
||
("e" . mc/edit-ends-of-lines)
|
||
("a" . mc/edit-beginnings-of-lines)
|
||
("n" . mc/mark-next-like-this)
|
||
("p" . mc/mark-previous-like-this)
|
||
("s" . mc/mark-sgml-tag-pair)
|
||
("d" . mc/mark-all-like-this-in-defun)
|
||
("M-<mouse-1>" . mc/add-cursor-on-click)))
|
||
|
||
;; phi-search is an incremental search compatible with multiple-cursors
|
||
(use-package phi-search)
|
||
(use-package phi-search-mc
|
||
:config
|
||
(phi-search-mc/setup-keys))
|
||
|
||
(use-package mc-extras
|
||
:demand
|
||
:bind
|
||
(:map mc/keymap
|
||
("=" . mc/compare-chars)))
|
||
|
||
(use-package ace-mc
|
||
:bind
|
||
(:map gpolonkai/mc-prefix-map
|
||
("SPC" . ace-mc-add-multiple-cursors)
|
||
("C-SPC" . ace-mc-add-single-cursor)))
|
||
|
||
(use-package smartparens
|
||
:demand
|
||
:config
|
||
(require 'smartparens-config)
|
||
(show-smartparens-global-mode t)
|
||
:hook
|
||
(prog-mode . turn-on-smartparens-strict-mode)
|
||
(markdown-mode . turn-on-smartparens-strict-mode)
|
||
:bind
|
||
(([f9] . smartparens-strict-mode)
|
||
("C-c s u" . sp-unwrap-sexp)
|
||
("C-c s k" . sp-kill-sexp)
|
||
("C-c s r" . sp-rewrap-sexp)))
|
||
|
||
(use-package which-key
|
||
:config
|
||
(which-key-mode)
|
||
(which-key-setup-minibuffer)
|
||
:custom
|
||
(which-key-idle-delay 0.3))
|
||
|
||
(use-package visual-fill-column
|
||
:custom
|
||
(visual-fill-column-center-text t)
|
||
(visual-fill-column-width 120)
|
||
:hook
|
||
(org-mode . visual-fill-column-mode))
|
||
|
||
(use-package spinner)
|
||
|
||
(use-package avy
|
||
:demand
|
||
:config
|
||
(avy-setup-default)
|
||
:bind
|
||
(("M-g c" . avy-goto-char)
|
||
("M-g C" . avy-goto-char-2)
|
||
("M-g f" . avy-goto-line)
|
||
("M-g w" . avy-goto-word-1)
|
||
("M-g e" . avy-goto-word-0)))
|
||
|
||
(use-package goto-last-change
|
||
:bind
|
||
(("M-g /" . goto-last-change)))
|
||
|
||
(use-package rainbow-mode
|
||
:hook
|
||
(css-mode . rainbow-mode)
|
||
(scss-mode . rainbow-mode)
|
||
(sass-mode . rainbow-mode))
|
||
|
||
(use-package zygospore
|
||
:bind
|
||
(:map ctl-x-map
|
||
("1" . zygospore-toggle-delete-other-windows)))
|
||
|
||
(use-package dashboard
|
||
:after
|
||
projectile
|
||
:config
|
||
(add-to-list 'dashboard-items '(projects . 5) t)
|
||
(dashboard-setup-startup-hook)
|
||
:custom
|
||
(dashboard-set-heading-icons t)
|
||
(dashboard-set-file-icons t)
|
||
(dashboard-center-content t)
|
||
(dashboard-set-navigator t)
|
||
(dashboard-items '((agenda . 5)
|
||
(projects . 5)
|
||
(recents . 5)
|
||
(bookmarks . 5))))
|
||
|
||
(use-package sr-speedbar
|
||
:after speedbar)
|
||
|
||
(use-package hungry-delete
|
||
:config
|
||
(global-hungry-delete-mode))
|
||
|
||
(use-package anzu
|
||
:delight
|
||
:config
|
||
(global-anzu-mode 1))
|
||
|
||
;; Should the fonts be missing, run `all-the-icons-install-fonts'. It’s not run
|
||
;; automatically, as it requires connecting to a website and download a pretty
|
||
;; large font file.
|
||
|
||
(use-package all-the-icons)
|
||
|
||
(use-package all-the-icons-dired
|
||
:hook
|
||
(dired-mode . all-the-icons-dired-mode))
|
||
|
||
(use-package flyspell
|
||
:hook
|
||
(prog-mode . flyspell-prog-mode)
|
||
(text-mode . flyspell-mode))
|
||
|
||
(use-package ace-flyspell
|
||
:bind
|
||
(:map flyspell-mode-map
|
||
("C-M-i" . ace-flyspell-correct-word)))
|
||
|
||
;; Text objects are textual patterns like a line, a top level definition, a
|
||
;; word, a sentence or any other unit of text. When objed-mode is enabled,
|
||
;; certain editing commands (configurable) will activate objed and enable its
|
||
;; modal editing features.
|
||
;;
|
||
;; TODO: is :demand really needed here?
|
||
(use-package objed
|
||
:demand t
|
||
:bind
|
||
(:map global-map
|
||
("M-SPC" . objed-activate)))
|
||
|
||
(use-package alert
|
||
:config
|
||
(setq alert-default-style 'libnotify))
|
||
|
||
(alert-add-rule
|
||
:status '(buried)
|
||
:mode 'eshell-mode
|
||
:style 'notifications)
|
||
|
||
(when (gpolonkai/termux-p)
|
||
(use-package alert-termux
|
||
:after alert
|
||
:config
|
||
(setq alert-default-style 'termux)))
|
||
|
||
(use-package undo-tree
|
||
:config
|
||
(global-undo-tree-mode)
|
||
:custom
|
||
(undo-tree-auto-save-history nil))
|
||
|
||
(use-package ciel
|
||
:bind
|
||
(:map global-map
|
||
("C-c i" . ciel-ci)
|
||
("C-c o" . ciel-co)))
|
||
|
||
(use-package hide-mode-line
|
||
:bind (:map gpolonkai/pers-map
|
||
("h" . hide-mode-line-mode)))
|
||
|
||
(use-package string-inflection
|
||
:bind (:map gpolonkai/pers-map
|
||
("i" . string-inflection-all-cycle)))
|
||
|
||
(use-package spdx
|
||
:bind (:map gpolonkai/pers-map
|
||
("L" . spdx-insert-spdx-copyright))
|
||
:custom
|
||
(spdx-copyright-holder 'user)
|
||
(spdx-copyright-sign 'unicode))
|
||
|
||
(use-package ag
|
||
:commands (ag))
|
||
|
||
(use-package rg
|
||
:commands (rg))
|
||
|
||
;; I started moving my configuration to this Org file. It’s easier to document this way.
|
||
(org-babel-load-file (expand-file-name "configuration.org" user-emacs-directory))
|
||
|
||
;;; init.el ends here
|