emacs straight
This commit is contained in:
126
files/init.el
126
files/init.el
@@ -6,6 +6,9 @@
|
|||||||
;
|
;
|
||||||
; ~ M. Thomas
|
; ~ M. Thomas
|
||||||
|
|
||||||
|
;; Initial optimization blob, mostly taken from doom emacs
|
||||||
|
(let ((file-name-handler-alist nil))
|
||||||
|
|
||||||
;; Set the gc threshold high initially so the init.el can just be
|
;; Set the gc threshold high initially so the init.el can just be
|
||||||
;; loaded in one move
|
;; loaded in one move
|
||||||
(setq gc-cons-threshold most-positive-fixnum ; 2^61 bytes
|
(setq gc-cons-threshold most-positive-fixnum ; 2^61 bytes
|
||||||
@@ -101,32 +104,30 @@
|
|||||||
(global-whitespace-mode t)
|
(global-whitespace-mode t)
|
||||||
(setq whitespace-style '(face trailing tabs tab-mark))
|
(setq whitespace-style '(face trailing tabs tab-mark))
|
||||||
|
|
||||||
(require 'package)
|
;; straight.el bootstrap
|
||||||
|
(defvar bootstrap-version)
|
||||||
|
(let ((bootstrap-file
|
||||||
|
(expand-file-name "straight/repos/straight.el/bootstrap.el" user-emacs-directory))
|
||||||
|
(bootstrap-version 5))
|
||||||
|
(unless (file-exists-p bootstrap-file)
|
||||||
|
(with-current-buffer
|
||||||
|
(url-retrieve-synchronously
|
||||||
|
"https://raw.githubusercontent.com/raxod502/straight.el/develop/install.el"
|
||||||
|
'silent 'inhibit-cookies)
|
||||||
|
(goto-char (point-max))
|
||||||
|
(eval-print-last-sexp)))
|
||||||
|
(load bootstrap-file nil 'nomessage))
|
||||||
|
|
||||||
|
;; inhibit package.el load
|
||||||
(setq package-enable-at-startup nil)
|
(setq package-enable-at-startup nil)
|
||||||
(setq package-archives '(("org" . "http://orgmode.org/elpa/")
|
|
||||||
("melpa" . "https://melpa.org/packages/")
|
|
||||||
("elpa" . "http://elpa.gnu.org/packages/")))
|
|
||||||
(package-initialize)
|
|
||||||
|
|
||||||
;; Bootstrap use-package
|
(straight-use-package 'use-package)
|
||||||
(unless (package-installed-p 'use-package) ; unless it is already installed
|
|
||||||
(package-refresh-contents) ; update packages archive
|
|
||||||
(package-install 'use-package)) ; and install the most recent version of use-package
|
|
||||||
|
|
||||||
(eval-when-compile
|
|
||||||
(require 'use-package))
|
|
||||||
|
|
||||||
(use-package quelpa
|
|
||||||
:ensure t)
|
|
||||||
|
|
||||||
(use-package quelpa-use-package
|
|
||||||
:ensure t)
|
|
||||||
|
|
||||||
;; Packages
|
;; Packages
|
||||||
|
|
||||||
;; Copy environment
|
;; Copy environment
|
||||||
(use-package exec-path-from-shell
|
(use-package exec-path-from-shell
|
||||||
:ensure t)
|
:straight t)
|
||||||
|
|
||||||
(exec-path-from-shell-copy-env "SSH_AGENT_PID")
|
(exec-path-from-shell-copy-env "SSH_AGENT_PID")
|
||||||
(exec-path-from-shell-copy-env "SSH_AUTH_SOCK")
|
(exec-path-from-shell-copy-env "SSH_AUTH_SOCK")
|
||||||
@@ -147,7 +148,7 @@
|
|||||||
|
|
||||||
;; Themes and icons
|
;; Themes and icons
|
||||||
(use-package doom-themes
|
(use-package doom-themes
|
||||||
:ensure t
|
:straight t
|
||||||
:init
|
:init
|
||||||
:config
|
:config
|
||||||
(setq doom-gruvbox-light-variant "soft")
|
(setq doom-gruvbox-light-variant "soft")
|
||||||
@@ -157,24 +158,24 @@
|
|||||||
|
|
||||||
;; Cool mode line
|
;; Cool mode line
|
||||||
(use-package doom-modeline
|
(use-package doom-modeline
|
||||||
:ensure t
|
:straight t
|
||||||
:init
|
:init
|
||||||
(setq doom-modeline-height 25)
|
(setq doom-modeline-height 25)
|
||||||
(doom-modeline-mode 1))
|
(doom-modeline-mode 1))
|
||||||
|
|
||||||
;; show color codes
|
;; show color codes
|
||||||
(use-package rainbow-mode
|
(use-package rainbow-mode
|
||||||
:ensure t
|
:straight t
|
||||||
:hook
|
:hook
|
||||||
(prog-mode . rainbow-mode))
|
(prog-mode . rainbow-mode))
|
||||||
|
|
||||||
;; icons
|
;; icons
|
||||||
(use-package all-the-icons
|
(use-package all-the-icons
|
||||||
:ensure t)
|
:straight t)
|
||||||
|
|
||||||
;; NYA NYA NYA NYA NYA NYA NYA NYA NYA NYA NYA NYA NYA NYA NYA NYA
|
;; NYA NYA NYA NYA NYA NYA NYA NYA NYA NYA NYA NYA NYA NYA NYA NYA
|
||||||
(use-package nyan-mode
|
(use-package nyan-mode
|
||||||
:ensure t
|
:straight t
|
||||||
:init
|
:init
|
||||||
(nyan-mode)
|
(nyan-mode)
|
||||||
(nyan-start-animation)
|
(nyan-start-animation)
|
||||||
@@ -187,7 +188,7 @@
|
|||||||
|
|
||||||
;; Heuristic indentation
|
;; Heuristic indentation
|
||||||
(use-package dtrt-indent
|
(use-package dtrt-indent
|
||||||
:ensure t
|
:straight t
|
||||||
:hook
|
:hook
|
||||||
(prog-mode . dtrt-indent-mode)
|
(prog-mode . dtrt-indent-mode)
|
||||||
(text-mode . dtrt-indent-mode)
|
(text-mode . dtrt-indent-mode)
|
||||||
@@ -206,14 +207,14 @@
|
|||||||
|
|
||||||
;; general
|
;; general
|
||||||
(use-package general
|
(use-package general
|
||||||
:ensure t
|
:straight t
|
||||||
:init
|
:init
|
||||||
;; Space as leader key
|
;; Space as leader key
|
||||||
(general-create-definer vim-leader-def :prefix "SPC"))
|
(general-create-definer vim-leader-def :prefix "SPC"))
|
||||||
|
|
||||||
;; Help to find keybindings
|
;; Help to find keybindings
|
||||||
(use-package which-key
|
(use-package which-key
|
||||||
:ensure t
|
:straight t
|
||||||
:init
|
:init
|
||||||
(which-key-mode)
|
(which-key-mode)
|
||||||
:diminish
|
:diminish
|
||||||
@@ -223,7 +224,7 @@
|
|||||||
|
|
||||||
;; 80 character limit line in prog mode
|
;; 80 character limit line in prog mode
|
||||||
(use-package fill-column-indicator
|
(use-package fill-column-indicator
|
||||||
:ensure t
|
:straight t
|
||||||
:defer 1
|
:defer 1
|
||||||
:diminish
|
:diminish
|
||||||
(fci-mode)
|
(fci-mode)
|
||||||
@@ -236,7 +237,7 @@
|
|||||||
|
|
||||||
;; Vim bindings
|
;; Vim bindings
|
||||||
(use-package evil
|
(use-package evil
|
||||||
:ensure t
|
:straight t
|
||||||
:bind
|
:bind
|
||||||
(:map evil-motion-state-map
|
(:map evil-motion-state-map
|
||||||
("C-y" . nil))
|
("C-y" . nil))
|
||||||
@@ -254,13 +255,13 @@
|
|||||||
|
|
||||||
(use-package evil-collection
|
(use-package evil-collection
|
||||||
:after evil
|
:after evil
|
||||||
:ensure t
|
:straight t
|
||||||
:config
|
:config
|
||||||
(evil-collection-init))
|
(evil-collection-init))
|
||||||
|
|
||||||
;; Completion for swiper
|
;; Completion for swiper
|
||||||
(use-package ivy
|
(use-package ivy
|
||||||
:ensure t
|
:straight t
|
||||||
:diminish
|
:diminish
|
||||||
:bind (("C-s" . swiper) ; TODO: possibly map this to / at some point?
|
:bind (("C-s" . swiper) ; TODO: possibly map this to / at some point?
|
||||||
:map ivy-minibuffer-map
|
:map ivy-minibuffer-map
|
||||||
@@ -279,7 +280,7 @@
|
|||||||
(ivy-mode 1))
|
(ivy-mode 1))
|
||||||
|
|
||||||
(use-package counsel
|
(use-package counsel
|
||||||
:ensure t
|
:straight t
|
||||||
:bind (("M-x" . counsel-M-x)
|
:bind (("M-x" . counsel-M-x)
|
||||||
("C-x b" . counsel-ibuffer)
|
("C-x b" . counsel-ibuffer)
|
||||||
("C-x C-f" . counsel-find-file)
|
("C-x C-f" . counsel-find-file)
|
||||||
@@ -288,7 +289,7 @@
|
|||||||
|
|
||||||
;; Org
|
;; Org
|
||||||
(use-package org
|
(use-package org
|
||||||
:ensure t
|
:straight t
|
||||||
;; C-c C-t org rotate
|
;; C-c C-t org rotate
|
||||||
:general
|
:general
|
||||||
(vim-leader-def 'normal 'global
|
(vim-leader-def 'normal 'global
|
||||||
@@ -334,7 +335,7 @@
|
|||||||
|
|
||||||
;; fancy bullets for org
|
;; fancy bullets for org
|
||||||
(use-package org-bullets
|
(use-package org-bullets
|
||||||
:ensure t
|
:straight t
|
||||||
:after org
|
:after org
|
||||||
:hook
|
:hook
|
||||||
(org-mode . org-bullets-mode)
|
(org-mode . org-bullets-mode)
|
||||||
@@ -343,7 +344,7 @@
|
|||||||
|
|
||||||
;; auto latex rendering in org-mode
|
;; auto latex rendering in org-mode
|
||||||
(use-package org-fragtog
|
(use-package org-fragtog
|
||||||
:ensure t
|
:straight t
|
||||||
:hook
|
:hook
|
||||||
(org-mode . org-fragtog-mode))
|
(org-mode . org-fragtog-mode))
|
||||||
|
|
||||||
@@ -351,7 +352,7 @@
|
|||||||
|
|
||||||
;; git
|
;; git
|
||||||
(use-package magit
|
(use-package magit
|
||||||
:ensure t
|
:straight t
|
||||||
:general
|
:general
|
||||||
(vim-leader-def 'normal 'global
|
(vim-leader-def 'normal 'global
|
||||||
"gj" 'magit-blame
|
"gj" 'magit-blame
|
||||||
@@ -367,7 +368,7 @@
|
|||||||
|
|
||||||
;; File bar
|
;; File bar
|
||||||
(use-package treemacs
|
(use-package treemacs
|
||||||
:ensure t
|
:straight t
|
||||||
:defer t
|
:defer t
|
||||||
:config
|
:config
|
||||||
(setq treemacs-follow-after-init t
|
(setq treemacs-follow-after-init t
|
||||||
@@ -390,15 +391,15 @@
|
|||||||
|
|
||||||
(use-package treemacs-evil
|
(use-package treemacs-evil
|
||||||
:after (treemacs evil)
|
:after (treemacs evil)
|
||||||
:ensure t)
|
:straight t)
|
||||||
|
|
||||||
(use-package treemacs-magit
|
(use-package treemacs-magit
|
||||||
:after (treemacs magit)
|
:after (treemacs magit)
|
||||||
:ensure t)
|
:straight t)
|
||||||
|
|
||||||
;; Lsp
|
;; Lsp
|
||||||
(use-package lsp-mode
|
(use-package lsp-mode
|
||||||
:ensure t
|
:straight t
|
||||||
:commands (lsp lsp-deferred)
|
:commands (lsp lsp-deferred)
|
||||||
:init
|
:init
|
||||||
(setq lsp-keymap-prefix "C-l")
|
(setq lsp-keymap-prefix "C-l")
|
||||||
@@ -414,24 +415,15 @@
|
|||||||
(python-mode . lsp)
|
(python-mode . lsp)
|
||||||
(haskell-mode . lsp))
|
(haskell-mode . lsp))
|
||||||
|
|
||||||
;; Ui integration for Lsp
|
|
||||||
(use-package lsp-ui
|
|
||||||
:ensure t
|
|
||||||
:config
|
|
||||||
(setq lsp-ui-peek-enable nil
|
|
||||||
lsp-ui-sideline-show-code-actions nil
|
|
||||||
lsp-modeline-code-actions-enable nil
|
|
||||||
lsp-ui-doc-enable nil))
|
|
||||||
|
|
||||||
;; Tags
|
;; Tags
|
||||||
(use-package lsp-ivy
|
(use-package lsp-ivy
|
||||||
:ensure t
|
:straight t
|
||||||
:after lsp-mode
|
:after lsp-mode
|
||||||
:bind(:map lsp-mode-map ("C-l g a" . lsp-ivy-workspace-symbol)))
|
:bind(:map lsp-mode-map ("C-l g a" . lsp-ivy-workspace-symbol)))
|
||||||
|
|
||||||
;; Completion for Lsp
|
;; Completion for Lsp
|
||||||
(use-package company
|
(use-package company
|
||||||
:ensure t
|
:straight t
|
||||||
:hook
|
:hook
|
||||||
(lsp-mode . company-mode)
|
(lsp-mode . company-mode)
|
||||||
(prog-mode . company-mode)
|
(prog-mode . company-mode)
|
||||||
@@ -447,20 +439,20 @@
|
|||||||
|
|
||||||
;; Frontend for company
|
;; Frontend for company
|
||||||
(use-package company-box
|
(use-package company-box
|
||||||
:ensure t
|
:straight t
|
||||||
:hook
|
:hook
|
||||||
(company-mode . company-box-mode))
|
(company-mode . company-box-mode))
|
||||||
|
|
||||||
;; project support
|
;; project support
|
||||||
(use-package projectile
|
(use-package projectile
|
||||||
:ensure t
|
:straight t
|
||||||
:config
|
:config
|
||||||
(setq projectile-completion-system 'ivy)
|
(setq projectile-completion-system 'ivy)
|
||||||
(projectile-mode +1))
|
(projectile-mode +1))
|
||||||
|
|
||||||
;; ui for projectline
|
;; ui for projectline
|
||||||
(use-package counsel-projectile
|
(use-package counsel-projectile
|
||||||
:ensure t
|
:straight t
|
||||||
:init
|
:init
|
||||||
(define-key projectile-mode-map (kbd "M-p") 'projectile-command-map))
|
(define-key projectile-mode-map (kbd "M-p") 'projectile-command-map))
|
||||||
|
|
||||||
@@ -475,7 +467,7 @@
|
|||||||
(setq company-backends (mapcar #'company-mode/backend-with-yas company-backends)))
|
(setq company-backends (mapcar #'company-mode/backend-with-yas company-backends)))
|
||||||
|
|
||||||
(use-package yasnippet
|
(use-package yasnippet
|
||||||
:ensure t
|
:straight t
|
||||||
:init
|
:init
|
||||||
:bind (:map yas-minor-mode-map
|
:bind (:map yas-minor-mode-map
|
||||||
("C-y" . yas-expand))
|
("C-y" . yas-expand))
|
||||||
@@ -484,15 +476,17 @@
|
|||||||
(company-mode . company-mode/add-yasnippet))
|
(company-mode . company-mode/add-yasnippet))
|
||||||
|
|
||||||
(use-package yasnippet-snippets
|
(use-package yasnippet-snippets
|
||||||
:quelpa ((yasnippet-snippets :fetcher github :repo "CramMK/yasnippet-snippets")))
|
:straight (yasnippet-snippets :type git :host github :repo "AndreaCrotti/yasnippet-snippets"
|
||||||
|
:fork (:host github
|
||||||
|
:repo "crammk/yasnippet-snippets")))
|
||||||
|
|
||||||
;; compiling for lsp
|
;; compiling for lsp
|
||||||
(use-package flycheck
|
(use-package flycheck
|
||||||
:ensure t)
|
:straight t)
|
||||||
|
|
||||||
;; rust
|
;; rust
|
||||||
(use-package rust-mode
|
(use-package rust-mode
|
||||||
:ensure t
|
:straight t
|
||||||
:hook
|
:hook
|
||||||
(rust-mode . prettify-symbols-mode)
|
(rust-mode . prettify-symbols-mode)
|
||||||
(rust-mode . (lambda ()
|
(rust-mode . (lambda ()
|
||||||
@@ -504,7 +498,7 @@
|
|||||||
|
|
||||||
;; LaTeX
|
;; LaTeX
|
||||||
(use-package auctex
|
(use-package auctex
|
||||||
:ensure t
|
:straight t
|
||||||
:defer t
|
:defer t
|
||||||
:init
|
:init
|
||||||
(setq TeX-auto-save t
|
(setq TeX-auto-save t
|
||||||
@@ -513,7 +507,7 @@
|
|||||||
|
|
||||||
;; Math Symbols
|
;; Math Symbols
|
||||||
(use-package math-symbol-lists
|
(use-package math-symbol-lists
|
||||||
:ensure t
|
:straight t
|
||||||
:config
|
:config
|
||||||
(quail-define-package "math" "UTF-8" "Ω" t)
|
(quail-define-package "math" "UTF-8" "Ω" t)
|
||||||
(quail-define-rules ; add whatever extra rules you want to define here...
|
(quail-define-rules ; add whatever extra rules you want to define here...
|
||||||
@@ -548,7 +542,7 @@
|
|||||||
|
|
||||||
;; Java
|
;; Java
|
||||||
(use-package lsp-java
|
(use-package lsp-java
|
||||||
:ensure t
|
:straight t
|
||||||
:config
|
:config
|
||||||
(setq lsp-java-format-on-type-enabled nil))
|
(setq lsp-java-format-on-type-enabled nil))
|
||||||
|
|
||||||
@@ -560,19 +554,19 @@
|
|||||||
|
|
||||||
;; Haskell
|
;; Haskell
|
||||||
(use-package haskell-mode
|
(use-package haskell-mode
|
||||||
:ensure t
|
:straight t
|
||||||
:hook
|
:hook
|
||||||
(haskell-mode . interactive-haskell-mode))
|
(haskell-mode . interactive-haskell-mode))
|
||||||
|
|
||||||
(use-package lsp-haskell
|
(use-package lsp-haskell
|
||||||
:ensure t
|
:straight t
|
||||||
:hook
|
:hook
|
||||||
(haskell-mode . lsp)
|
(haskell-mode . lsp)
|
||||||
(haskell-literate-mode . lsp))
|
(haskell-literate-mode . lsp))
|
||||||
|
|
||||||
;; Graphs
|
;; Graphs
|
||||||
(use-package graphviz-dot-mode
|
(use-package graphviz-dot-mode
|
||||||
:ensure t
|
:straight t
|
||||||
:hook
|
:hook
|
||||||
(graphviz-dot-mode . (lambda () (set-input-method "math")))
|
(graphviz-dot-mode . (lambda () (set-input-method "math")))
|
||||||
:config
|
:config
|
||||||
@@ -580,7 +574,7 @@
|
|||||||
|
|
||||||
;; use my beauty everywhere
|
;; use my beauty everywhere
|
||||||
(use-package emacs-everywhere
|
(use-package emacs-everywhere
|
||||||
:ensure t
|
:straight t
|
||||||
:hook
|
:hook
|
||||||
(emacs-everywhere-mode . (lambda () (set-input-method "math")))
|
(emacs-everywhere-mode . (lambda () (set-input-method "math")))
|
||||||
:config
|
:config
|
||||||
@@ -591,3 +585,5 @@
|
|||||||
(when (file-exists-p "~/.emacs.d/local.el")
|
(when (file-exists-p "~/.emacs.d/local.el")
|
||||||
(message "Loading ~/.emacs.d/local.el")
|
(message "Loading ~/.emacs.d/local.el")
|
||||||
(load-file "~/.emacs.d/local.el"))
|
(load-file "~/.emacs.d/local.el"))
|
||||||
|
|
||||||
|
) ;; close performance let
|
||||||
|
|||||||
Reference in New Issue
Block a user