Initial commit
This commit is contained in:
commit
4cde9a9d76
5
.gitignore
vendored
Normal file
5
.gitignore
vendored
Normal file
|
@ -0,0 +1,5 @@
|
|||
*
|
||||
|
||||
!.gitignore
|
||||
!early-init.el
|
||||
!init.el
|
508
init.el
Normal file
508
init.el
Normal file
|
@ -0,0 +1,508 @@
|
|||
;;; EMACS init file -*- lexical-binding:t -*-
|
||||
|
||||
(require 'package)
|
||||
(add-to-list 'package-archives
|
||||
'("melpa" . "https://melpa.org/packages/"))
|
||||
(package-initialize)
|
||||
|
||||
(unless (package-installed-p 'use-package)
|
||||
(package-refresh-contents)
|
||||
(package-install 'use-package))
|
||||
(setq use-package-always-ensure t
|
||||
use-package-expand-minimally t)
|
||||
(require 'use-package)
|
||||
|
||||
(use-package gcmh
|
||||
;; :custom
|
||||
;; (gcmh-high-cons-threshold 40000000)
|
||||
;; (gcmh-high-cons-threshold most-positive-fixnum)
|
||||
:config
|
||||
(gcmh-mode))
|
||||
|
||||
(let ((emacs-tmp-dir (expand-file-name (format "emacs%d" (user-uid))
|
||||
temporary-file-directory)))
|
||||
(setq auto-save-file-name-transforms `((".*" ,emacs-tmp-dir t))
|
||||
auto-save-list-file-prefix emacs-tmp-dir
|
||||
backup-directory-alist (setq undo-tree-history-directory-alist
|
||||
`((".*" . ,emacs-tmp-dir)))
|
||||
org-preview-latex-image-directory (expand-file-name "ltximg" emacs-tmp-dir)))
|
||||
|
||||
(setq backup-by-copying t
|
||||
inhibit-splash-screen t
|
||||
custom-file (expand-file-name "custom.el" user-emacs-directory))
|
||||
(when (file-readable-p custom-file)
|
||||
(load custom-file))
|
||||
|
||||
(use-package auto-package-update
|
||||
:custom
|
||||
(auto-package-update-prompt-before-update t)
|
||||
(auto-package-update-show-preview t)
|
||||
(auto-package-update-delete-old-versions t)
|
||||
:config
|
||||
(auto-package-update-at-time "05:00"))
|
||||
|
||||
(use-package undo-tree
|
||||
:hook (evil-local-mode . turn-on-undo-tree-mode))
|
||||
|
||||
(use-package evil
|
||||
:custom
|
||||
(x-select-enable-clipboard nil "Disable automatic clipboard=unnamedplus")
|
||||
(evil-want-keybinding nil "Necessary for evil-collection")
|
||||
(evil-want-Y-yank-to-eol t "Make Y behave like it should")
|
||||
(evil-want-C-u-scroll t "Scroll with C-u")
|
||||
(evil-want-C-h-delete t "Delete with C-h")
|
||||
(evil-want-C-w-in-emacs-state t "Allow C-w movement in Emacs windows")
|
||||
(evil-undo-system 'undo-tree "Undo with undo-tree")
|
||||
;; :custom-face
|
||||
;; (evil-ex-lazy-highlight ((t (:foreground nil :inherit highlight))))
|
||||
:config
|
||||
(evil-mode)
|
||||
(evil-select-search-module 'evil-search-module 'evil-search)
|
||||
(defadvice evil-force-normal-state (after evil-search-remove-hl activate)
|
||||
(evil-ex-nohighlight))
|
||||
(evil-global-set-key 'insert (kbd "C-S-h") #'help-command))
|
||||
|
||||
(use-package evil-collection
|
||||
:after evil
|
||||
:custom
|
||||
(evil-collection-setup-minibuffer t)
|
||||
:config
|
||||
(evil-collection-init))
|
||||
|
||||
(use-package evil-leader
|
||||
:after evil
|
||||
:config
|
||||
(evil-leader/set-leader "<SPC>")
|
||||
(evil-leader/set-key
|
||||
"u" #'universal-argument
|
||||
"bb" #'switch-to-buffer
|
||||
"bd" #'evil-delete-buffer
|
||||
"fd" #'dirvish-dwim
|
||||
"fq" #'dirvish-quit
|
||||
"ff" #'find-file
|
||||
"ft" #'treemacs
|
||||
"fs" #'evil-write
|
||||
"f'" #'bookmark-jump
|
||||
"gg" #'magit-status
|
||||
"mm" #'minimap-mode
|
||||
"ps" #'auto-package-update-now
|
||||
;; "ps" (lambda ()
|
||||
;; (interactive)
|
||||
;; (package-refresh-contents)
|
||||
;; (auto-package-update-now-async))
|
||||
"qq" #'evil-quit
|
||||
"qk" #'kill-emacs)
|
||||
(global-evil-leader-mode))
|
||||
|
||||
(use-package evil-surround
|
||||
:after evil
|
||||
:config
|
||||
(global-evil-surround-mode))
|
||||
|
||||
(use-package evil-commentary
|
||||
:after evil
|
||||
:config
|
||||
(evil-commentary-mode))
|
||||
|
||||
(use-package evil-numbers
|
||||
:after evil
|
||||
:config
|
||||
(evil-define-key '(normal visual) 'global "g+" #'evil-numbers/inc-at-pt)
|
||||
(evil-define-key '(normal visual) 'global "g-" #'evil-numbers/dec-at-pt)
|
||||
(evil-define-key '(normal visual) 'global "g=+" #'evil-numbers/inc-at-pt-incremental)
|
||||
(evil-define-key '(normal visual) 'global "g=-" #'evil-numbers/inc-at-pt-incremental))
|
||||
|
||||
(use-package evil-replace-with-register
|
||||
:after evil
|
||||
:custom
|
||||
(evil-replace-with-register-indent t)
|
||||
:config
|
||||
(evil-replace-with-register-install))
|
||||
|
||||
(use-package evil-org
|
||||
:after evil
|
||||
:hook org-mode
|
||||
:config
|
||||
(require 'evil-org-agenda)
|
||||
(evil-org-agenda-set-keys))
|
||||
|
||||
(use-package evil-goggles
|
||||
:after evil
|
||||
:custom
|
||||
(evil-goggles-duration 0.12 "Decrease the duration a tiny bit")
|
||||
(evil-goggles-pulse t)
|
||||
:config
|
||||
(evil-goggles-use-diff-faces)
|
||||
(evil-goggles-mode))
|
||||
|
||||
(use-package evil-terminal-cursor-changer
|
||||
:defer t)
|
||||
|
||||
(use-package hydra
|
||||
:config
|
||||
(defhydra hydra-evil-c-w (evil-normal-state-map "C-w")
|
||||
"C-w"
|
||||
("h" #'evil-window-left "left")
|
||||
("j" #'evil-window-down "down")
|
||||
("k" #'evil-window-up "up")
|
||||
("l" #'evil-window-right "right")
|
||||
("+" #'evil-window-increase-height "+height")
|
||||
("-" #'evil-window-decrease-height "-height")
|
||||
(">" #'evil-window-increase-width "+width")
|
||||
("<" #'evil-window-decrease-width "-width")))
|
||||
|
||||
(use-package lispy
|
||||
:after lispyville)
|
||||
|
||||
(use-package lispyville
|
||||
:hook (emacs-lisp-mode
|
||||
eval-expression-minibuffer-setup
|
||||
ielm-mode
|
||||
lisp-mode
|
||||
lisp-interaction-mode
|
||||
scheme-mode
|
||||
clojure-mode)
|
||||
:config
|
||||
(lispyville-set-key-theme
|
||||
'(operators
|
||||
c-w
|
||||
slurp/barf-cp
|
||||
commentary
|
||||
text-objects
|
||||
additional
|
||||
additional-insert
|
||||
mark
|
||||
(prettify insert)
|
||||
(escape insert emacs)
|
||||
(additional-movement normal visual motion)))
|
||||
(evil-define-key 'normal lispyville-mode-map (kbd "C-v") nil)
|
||||
(evil-define-key 'insert lispyville-mode-map (kbd "DEL") #'lispy-delete-backward)
|
||||
(evil-define-key 'insert lispyville-mode-map (kbd "C-h") #'lispy-delete-backward)
|
||||
(evil-define-key 'insert lispyville-mode-map "(" #'lispy-parens)
|
||||
(evil-define-key 'insert lispyville-mode-map ")" #'lispy-right-nostring)
|
||||
(evil-define-key 'insert lispyville-mode-map "\"" #'lispy-quotes)
|
||||
|
||||
(evil-define-key 'normal lispyville-mode-map ";" nil)
|
||||
(evil-define-key 'normal lispyville-mode-map (kbd "C-;") #'lispy-comment)
|
||||
(evil-define-key 'visual lispyville-mode-map "iF" #'special-lispy-flow))
|
||||
|
||||
(use-package company
|
||||
:custom
|
||||
(company-idle-delay 0.3)
|
||||
:config
|
||||
(define-key company-active-map (kbd "C-h") nil)
|
||||
(define-key company-active-map (kbd "C-w") nil)
|
||||
(define-key company-active-map (kbd "C-/") #'company-show-doc-buffer)
|
||||
(define-key company-active-map (kbd "C-?") #'company-show-location)
|
||||
(global-company-mode))
|
||||
|
||||
;; (use-package lsp-mode
|
||||
;; :commands lsp-mode
|
||||
;; :custom
|
||||
;; (lsp-keymap-prefix nil)
|
||||
;; (lsp-enable-indentation nil)
|
||||
;; (read-process-output-max (* 1024 1024))
|
||||
;; :hook ((lsp-mode . evil-normalize-keymaps)
|
||||
;; (lsp-mode . (lambda ()
|
||||
;; (let ((lsp-keymap-prefix "SPC e"))
|
||||
;; (lsp-enable-which-key-integration)))))
|
||||
;; :config
|
||||
;; (evil-define-key 'normal lsp-mode-map (kbd "SPC e") lsp-command-map))
|
||||
;; ;; :hook (((c-mode java-mode) . lsp-deferred))
|
||||
|
||||
(use-package dtrt-indent
|
||||
:config
|
||||
(dtrt-indent-global-mode))
|
||||
|
||||
(use-package aggressive-indent
|
||||
:config
|
||||
;; (add-to-list 'aggressive-indent-dont-indent-if
|
||||
;; '(member evil-state '(insert replace)))
|
||||
(global-aggressive-indent-mode))
|
||||
|
||||
(use-package rainbow-delimiters
|
||||
:hook prog-mode)
|
||||
|
||||
(use-package tree-sitter
|
||||
:hook (sh-mode
|
||||
c-mode
|
||||
c++-mode
|
||||
css-mode
|
||||
html-mode
|
||||
java-mode
|
||||
js-mode
|
||||
perl-mode
|
||||
python-mode
|
||||
ruby-mode
|
||||
(tree-sitter-after-on . tree-sitter-hl-mode)))
|
||||
(use-package tree-sitter-langs
|
||||
:defer t)
|
||||
|
||||
(use-package which-key
|
||||
:custom
|
||||
(which-key-idle-delay 0.2)
|
||||
:config
|
||||
(which-key-mode))
|
||||
|
||||
(use-package orderless
|
||||
:custom
|
||||
(completion-styles '(orderless basic))
|
||||
(completion-category-defaults nil)
|
||||
(completion-category-overrides '((file (styles partial-completion)))))
|
||||
|
||||
(use-package marginalia
|
||||
:bind (:map minibuffer-local-map
|
||||
("M-a" . marginalia-cycle))
|
||||
:init
|
||||
(marginalia-mode))
|
||||
|
||||
(use-package vertico
|
||||
:config
|
||||
(evil-define-key 'insert minibuffer-local-map (kbd "C-j") #'vertico-next)
|
||||
(evil-define-key 'insert minibuffer-local-map (kbd "C-k") #'vertico-previous)
|
||||
(vertico-mode)
|
||||
(vertico-mouse-mode))
|
||||
|
||||
(use-package yasnippet)
|
||||
(use-package yasnippet-snippets)
|
||||
|
||||
(use-package all-the-icons)
|
||||
|
||||
(use-package all-the-icons-completion
|
||||
:after (marginalia all-the-icons)
|
||||
:hook (marginalia-mode . all-the-icons-completion-marginalia-setup)
|
||||
:init
|
||||
(all-the-icons-completion-mode))
|
||||
|
||||
(use-package treemacs)
|
||||
(use-package treemacs-evil)
|
||||
;; (use-package treemacs-icons-dired
|
||||
;; :hook (dired-mode . treemacs-icons-dired-enable-once))
|
||||
(use-package treemacs-all-the-icons
|
||||
:config
|
||||
(treemacs-load-theme 'all-the-icons))
|
||||
|
||||
(use-package doom-modeline
|
||||
:config
|
||||
(doom-modeline-mode))
|
||||
|
||||
(use-package dirvish
|
||||
:after dired
|
||||
:custom
|
||||
(dirvish-attributes '(all-the-icons))
|
||||
:config
|
||||
(dirvish-override-dired-mode))
|
||||
|
||||
(use-package pdf-tools
|
||||
:defer t
|
||||
:mode (("\\.pdf\\'" . pdf-view-mode))
|
||||
:config
|
||||
(pdf-tools-install))
|
||||
|
||||
(defun set-text-modes-font ()
|
||||
(interactive)
|
||||
(setq buffer-face-mode-face '(:family "DejaVu Sans Mono" :height 115)
|
||||
line-spacing 0.5)
|
||||
(buffer-face-mode))
|
||||
|
||||
(use-package org
|
||||
:defer t
|
||||
:mode (("\\.org$" . org-mode))
|
||||
:hook ((org-mode . org-indent-mode)
|
||||
(org-mode . flyspell-mode)
|
||||
(org-mode . auto-fill-mode)
|
||||
(org-mode . set-text-modes-font))
|
||||
:custom
|
||||
(org-list-allow-alphabetical t)
|
||||
:config
|
||||
;; (setq org-format-latex-options (plist-put org-format-latex-options :scale 2.0))
|
||||
(defhydra hydra-org-evil-shiftmove (org-mode-map "C-c")
|
||||
"S+arrows"
|
||||
("h" #'org-shiftleft "left")
|
||||
("j" #'org-shiftdown "down")
|
||||
("k" #'org-shiftup "up")
|
||||
("l" #'org-shiftright "right")))
|
||||
|
||||
(use-package org-superstar
|
||||
:custom
|
||||
(org-superstar-leading-bullet ?\s)
|
||||
:hook org-mode)
|
||||
|
||||
(use-package org-pdftools
|
||||
:hook (org-mode . org-pdftools-setup-link))
|
||||
|
||||
(use-package editorconfig
|
||||
:config
|
||||
(editorconfig-mode))
|
||||
|
||||
(use-package json-mode
|
||||
:defer t
|
||||
:mode "\\.js\\(?:on\\|[hl]int\\(?:rc\\)?\\)\\'")
|
||||
|
||||
(use-package minimap
|
||||
:defer t
|
||||
:commands minimap-mode
|
||||
:custom-face
|
||||
(minimap-active-region-background ((t (:background nil :inherit hl-line))))
|
||||
:hook ((minimap-sb-mode . evil-emacs-state)
|
||||
(minimap-sb-mode . turn-on-solaire-mode)))
|
||||
|
||||
(use-package magit)
|
||||
|
||||
(use-package tramp
|
||||
:defer t
|
||||
:custom
|
||||
(remote-file-name-inhibit-cache nil)
|
||||
(tramp-verbose 1)
|
||||
:config
|
||||
(setq vc-ignore-dir-regexp (format "%s\\|%s"
|
||||
vc-ignore-dir-regexp
|
||||
tramp-file-name-regexp)))
|
||||
|
||||
(use-package elfeed
|
||||
:custom
|
||||
(elfeed-feeds '(("https://archlinux.org/feeds/news/" arch-linux))))
|
||||
|
||||
;; (use-package md4rd
|
||||
;; :custom
|
||||
;; (md4rd-subs-active '(emacs archlinux))
|
||||
;; :config
|
||||
;; (setq md4rd--oauth-access-token "373959726732-zbIE8PXPDdnYJrCLsSjAoVUm55Dg8g"
|
||||
;; md4rd--oauth-refresh-token "373959726732-5jDpXKE4MImrDWNl7gfSPD3YT6862w")
|
||||
;; (run-with-timer 0 3540 #'md4rd-refresh-login)
|
||||
;; (evil-set-initial-state 'md4rd-mode 'emacs))
|
||||
|
||||
(use-package xkcd
|
||||
:config
|
||||
(evil-set-initial-state 'xkcd-mode 'emacs))
|
||||
|
||||
(use-package ligature
|
||||
:hook (prog-mode
|
||||
(ligature-mode . prettify-symbols-mode))
|
||||
:custom
|
||||
(prettify-symbols-unprettify-at-point t)
|
||||
:config
|
||||
(ligature-set-ligatures 'prog-mode '("|||>" "<|||" "<==>" "<!--" "####" "~~>" "***" "||=" "||>"
|
||||
":::" "::=" "=:=" "===" "==>" "=!=" "=>>" "=<<" "=/=" "!=="
|
||||
"!!." ">=>" ">>=" ">>>" ">>-" ">->" "->>" "-->" "---" "-<<"
|
||||
"<~~" "<~>" "<*>" "<||" "<|>" "<$>" "<==" "<=>" "<=<" "<->"
|
||||
"<--" "<-<" "<<=" "<<-" "<<<" "<+>" "</>" "###" "#_(" "..<"
|
||||
"..." "+++" "/==" "///" "_|_" "www" "&&" "^=" "~~" "~@" "~="
|
||||
"~>" "~-" "**" "*>" "*/" "||" "|}" "|]" "|=" "|>" "|-" "{|"
|
||||
"[|" "]#" "::" ":=" ":>" ":<" "$>" "==" "=>" "!=" "!!" ">:"
|
||||
">=" ">>" ">-" "-~" "-|" "->" "--" "-<" "<~" "<*" "<|" "<:"
|
||||
"<$" "<=" "<>" "<-" "<<" "<+" "</" "#{" "#[" "#:" "#=" "#!"
|
||||
"##" "#(" "#?" "#_" "%%" ".=" ".-" ".." ".?" "+>" "++" "?:"
|
||||
"?=" "?." "??" ";;" "/*" "/=" "/>" "//" "__" "~~" "(*" "*)"
|
||||
"\\\\" "://")))
|
||||
|
||||
(use-package gruvbox-theme
|
||||
:defer t)
|
||||
(use-package catppuccin-theme
|
||||
;; :custom
|
||||
;; (catppuccin-use-24-bit-colors-on-256-colors-term t)
|
||||
:defer t)
|
||||
|
||||
(defun load-theme-with-solaire ()
|
||||
(load-theme 'catppuccin-macchiato t)
|
||||
(solaire-global-mode)
|
||||
(when (daemonp)
|
||||
(remove-hook 'server-after-make-frame-hook #'load-theme-with-solaire)))
|
||||
|
||||
(use-package solaire-mode
|
||||
:custom
|
||||
(solaire-mode-real-buffer-fn (lambda ()
|
||||
(and (solaire-mode-real-buffer-p)
|
||||
(or (custom-theme-enabled-p 'gruvbox)
|
||||
(not (member 'minimap-sb-mode
|
||||
local-minor-modes))))))
|
||||
:config
|
||||
(if (daemonp)
|
||||
(add-hook 'server-after-make-frame-hook #'load-theme-with-solaire)
|
||||
(load-theme-with-solaire)))
|
||||
|
||||
(use-package emacs-everywhere
|
||||
:load-path "~/emacs-everywhere"
|
||||
:defer t
|
||||
:commands emacs-everywhere)
|
||||
|
||||
(use-package tool-bar
|
||||
:ensure nil
|
||||
:config
|
||||
(tool-bar-mode 0))
|
||||
(use-package menu-bar
|
||||
:ensure nil
|
||||
:config
|
||||
(menu-bar-mode 0))
|
||||
(use-package scroll-bar
|
||||
:ensure nil
|
||||
:config
|
||||
(scroll-bar-mode 0))
|
||||
|
||||
(global-hl-line-mode)
|
||||
(add-to-list 'default-frame-alist '(font . "JetbrainsMono Nerd Font-10.5"))
|
||||
;; (add-to-list 'default-frame-alist '(font . "FiraCode Nerd Font-10.5"))
|
||||
|
||||
(setcar mouse-wheel-scroll-amount 3)
|
||||
|
||||
(setq server-client-instructions nil
|
||||
scroll-step 1
|
||||
scroll-margin 3
|
||||
scroll-conservatively 9999
|
||||
read-file-name-completion-ignore-case t
|
||||
read-buffer-completion-ignore-case t
|
||||
completion-ignore-case t
|
||||
sentence-end-double-space nil)
|
||||
|
||||
(setq-default c-basic-offset 4
|
||||
tab-width 4
|
||||
fill-column 80)
|
||||
|
||||
(defun relative-linenum ()
|
||||
(setq display-line-numbers 'relative))
|
||||
(dolist (hook '(prog-mode-hook
|
||||
text-mode-hook
|
||||
conf-mode-hook
|
||||
org-mode-hook))
|
||||
(add-hook hook #'relative-linenum))
|
||||
|
||||
;; (set-face-attribute 'italic nil
|
||||
;; :slant 'italic
|
||||
;; :underline nil)
|
||||
|
||||
(defun use-spaces-for-indent ()
|
||||
(setq indent-tabs-mode nil))
|
||||
|
||||
(add-hook 'emacs-lisp-mode-hook #'use-spaces-for-indent)
|
||||
(add-hook 'lisp-mode-hook #'use-spaces-for-indent)
|
||||
(add-hook 'scheme-mode-hook #'use-spaces-for-indent)
|
||||
(add-hook 'clojure-mode-hook #'use-spaces-for-indent)
|
||||
|
||||
(defun scroll-down-3 ()
|
||||
"Scrolls down by 3"
|
||||
(interactive)
|
||||
(scroll-down 3))
|
||||
|
||||
(defun scroll-up-3 ()
|
||||
"Scrolls up by 3"
|
||||
(interactive)
|
||||
(scroll-up 3))
|
||||
|
||||
(defun frame-make-detect-term (frame)
|
||||
"Check when frames are made in order to make terminal-only configurations"
|
||||
(unless (display-graphic-p frame)
|
||||
(xterm-mouse-mode)
|
||||
(global-set-key (kbd "<mouse-4>") #'scroll-down-3)
|
||||
(global-set-key (kbd "<mouse-5>") #'scroll-up-3)
|
||||
(etcc-on)
|
||||
(setq after-make-frame-functions
|
||||
(remove 'frame-make-detect-term after-make-frame-functions))))
|
||||
|
||||
(add-to-list 'after-make-frame-functions #'frame-make-detect-term)
|
||||
|
||||
(add-to-list 'auto-mode-alist '("\\.yuck\\'" . lisp-mode))
|
||||
|
||||
;; (add-to-list 'default-frame-alist '(internal-border-width . 6))
|
||||
|
||||
(with-current-buffer "*scratch*"
|
||||
(cd "~/"))
|
Loading…
Reference in a new issue