emacs/lisp/mitch-packages.el

797 lines
24 KiB
EmacsLisp
Raw Normal View History

2022-06-19 14:13:36 -08:00
;;; mitch-packages --- Declare and configure use-package statements
;;; Commentary:
;; -----------------------------------------------------------------------------
;; This is a file in which I put declarations for packages and things.
;; -----------------------------------------------------------------------------
;;; Code:
;; diminish
(use-package diminish
;; :straight (:type built-in)
)
2022-06-19 14:13:36 -08:00
(use-package eldoc
:straight (:type built-in)
:custom (eldoc-echo-area-use-multiline-p nil)
2022-06-19 14:13:36 -08:00
:defer 1
:diminish)
(use-package tramp
:straight (:type built-in)
:custom (tramp-mode nil))
(use-package savehist
:straight (:type built-in)
:init (savehist-mode))
(use-package whitespace
:straight (:type built-in)
:defer 1
:diminish global-whitespace-mode
:custom
(whitespace-style '(face lines-tail))
(whitespace-line-column 80)
:config (global-whitespace-mode t))
(use-package eshell
:straight (:type built-in)
:hook (eshell-mode . mitch/terminal-setup)
:commands (eshell/emacs eshell/man)
:config
(require 'eshell)
(require 'em-unix)
(require 'eshell-settings))
(use-package ibuffer
:straight (:type built-in)
:commands ibuffer
:custom (ibuffer-use-other-window t))
(use-package image-mode
:straight (:type built-in)
:config
(turn-off-line-numbers)
(blink-cursor-mode -1))
2022-06-19 14:13:36 -08:00
;; Keybinding manager
(use-package general
:config (mitch/general-config))
;; load evil
(use-package evil
:general
(general-define-key
:states 'normal
"<escape>" 'evil-beginning-of-line
"C-p" 'scroll-down-line
"C-n" 'scroll-up-line)
(general-define-key
:states 'insert
"C-w" 'evil-window-map
"C-V" (general-key-dispatch
2022-07-05 20:56:48 -08:00
'evil-quoted-insert
"u" 'insert-char))
2022-06-19 14:13:36 -08:00
:diminish visual-line-mode
:custom
(evil-want-integration t)
(evil-want-keybinding nil)
(evil-want-C-u-scroll nil)
(evil-want-C-i-jump nil)
(evil-vsplit-window-right t)
(evil-split-window-below t)
(evil-undo-system
(if (>= (string-to-number emacs-version) 28)
(quote undo-redo)
(quote undo-fu)))
:init
(evil-mode t))
(use-package evil-collection
:after evil
:diminish evil-collection-unimpaired-mode
:config (evil-collection-init))
(use-package evil-commentary
:diminish 'evil-commentary-mode
:config (evil-commentary-mode)
:hook (prog-mode . evil-commentary-mode))
2022-06-19 14:13:36 -08:00
(use-package evil-surround
:diminish 'global-evil-surround-mode
:hook (prog-mode . evil-surround-mode)
2022-06-19 14:13:36 -08:00
:config (global-evil-surround-mode 1))
(use-package evil-terminal-cursor-changer
:after evil
:diminish
:if (not (display-graphic-p))
:config
(evil-terminal-cursor-changer-activate)
(xterm-mouse-mode))
(use-package undo-fu
:after evil
2022-07-05 20:56:48 -08:00
:if (< (string-to-number emacs-version) 28)
2022-06-19 14:13:36 -08:00
:diminish)
(use-package all-the-icons)
(use-package dirvish
:straight (:files (:defaults "extensions/*.el"))
:commands 'dirvish
2022-07-28 07:06:19 -08:00
:custom
(dirvish-attributes '(all-the-icons collapse))
(dirvish-cache-dir (expand-file-name ".dirvish/" user-emacs-directory))
:init (dirvish-override-dired-mode)
(defun convert-pdf-to-html (pdf)
"Take PDF and convert it into a html file, which is returned.
Requires `mutool' to be installed and available in $PATH (it comes with MuPDF)."
(let ((html (file-name-with-extension pdf ".html")))
(shell-command (concat
(format
"mutool convert -F html -O preserve-images -o '%s' "
html) (format "'%s'" pdf))) html))
(defun view-pdf-in-webkit (pdf)
"View PDF in BUFFER by using `mutool'. This works by converting it to a
html file and viewing that file in `xwidget-webkit'. Requires `mutool' to be
installed and available in $PATH (it comes with MuPDF). Also requires Emacs to
be built with `xwidget' support."
(xwidget-webkit-browse-url
(format "file://%s" (convert-pdf-to-html pdf))))
(dirvish-define-preview pdf (file ext)
"Use `mupdf' and `xwidget-webkit' to generate pdf preview."
:require ("mutool")
(when (equal ext "pdf")
(if (featurep 'xwidget webkit)
(view-pdf-in-webkit file))))
(add-to-list 'dirvish-preview-dispatchers 'pdf)
(setq dired-listing-switches "-l --almost-all")
2022-07-21 08:05:23 -08:00
(setq dirvish-side-display-alist
2022-07-21 08:15:38 -08:00
'((window-width . 0.15)
2022-07-21 08:05:23 -08:00
(slot . -1)
(side . left)))
:hook
(dirvish-mode . turn-off-line-numbers)
:general
(general-define-key
:states 'normal
:keymaps 'dirvish-mode-map
"h" 'dired-up-directory
"l" 'dired-find-file
"/" 'dirvish-narrow)
(general-define-key
:states 'normal
:prefix-command 'file-tree-map-prefix
:prefix-map 'file-tree-map
:prefix "SPC t"
"t" 'dirvish-side))
2022-06-19 14:13:36 -08:00
;; Completion framework...
;; (use-package ivy
;; :diminish
;; :custom
;; (ivy-auto-shrink-minibuffer-alist '((t . t)))
;; :config (ivy-mode t)
;; :general
;; (general-define-key
;; :keymaps 'ivy-minibuffer-map
;; "TAB" 'ivy-alt-done))
;; (use-package counsel
;; :diminish
;; :config (counsel-mode))
(use-package vertico
2022-07-17 10:49:15 -08:00
:straight (:files (:defaults "extensions/vertico-mouse.el"))
:custom (vertico-resize t)
:config (vertico-mode)
(add-hook 'minibuffer-setup-hook 'turn-off-line-numbers))
2022-07-17 10:49:15 -08:00
(use-package vertico-mouse
:straight vertico
:after vertico
:config
2022-07-22 06:59:25 -08:00
(vertico-mouse-mode))
(use-package consult
:after vertico)
2022-06-19 14:13:36 -08:00
;; Minibuffer generic stuff
(use-package marginalia
2022-07-22 06:59:25 -08:00
;; :custom (marginalia-separator " ")
2022-06-19 14:13:36 -08:00
:init (marginalia-mode))
(use-package orderless
:custom
(completion-styles '(orderless partial-completion basic))
(completion-category-defaults nil)
;; (completion-category-overrides '((file (styles basic partial-completion))))
2022-07-22 06:59:25 -08:00
(completion-category-overrides nil))
;; weird multi-path thing
(use-package embark
:general
(general-define-key
:keymap minibuffer-mode-map
"C-." 'embark-act
"C-;" 'embark-dwim)
2022-07-22 06:59:25 -08:00
:init
(defun embark-which-key-indicator ()
"An embark indicator that displays keymaps using which-key.
The which-key help message will show the type and value of the
current target followed by an ellipsis if there are further
targets."
(lambda (&optional keymap targets prefix)
(if (null keymap) (which-key--hide-popup-ignore-command)
2022-07-22 06:59:25 -08:00
(which-key--show-keymap
(if (eq (plist-get (car targets) :type) 'embark-become)
"Become"
2022-07-22 06:59:25 -08:00
(format "Act on %s '%s'%s" (plist-get (car targets) :type)
(embark--truncate-target (plist-get (car targets) :target))
(if (cdr targets) "" "")))
(if prefix (pcase (lookup-key keymap prefix 'accept-default)
((and (pred keymapp) km) km)
(_ (key-binding prefix 'accept-default))) keymap)
nil nil t (lambda (binding)
2022-07-22 06:59:25 -08:00
(not (string-suffix-p "-argument" (cdr binding))))))))
(setq embark-indicators
'(embark-which-key-indicator
embark-highlight-indicator
embark-isearch-highlight-indicator))
(defun embark-hide-which-key-indicator (fn &rest args)
"Hide the which-key indicator immediately when using the completing-read prompter."
(which-key--hide-popup-ignore-command)
(let ((embark-indicators
(remq #'embark-which-key-indicator embark-indicators)))
(apply fn args)))
(advice-add #'embark-completing-read-prompter
:around #'embark-hide-which-key-indicator)
:config
(setq enable-recursive-minibuffers t))
;; Consult users will also want the embark-consult package.
(use-package embark-consult
:after (embark consult))
2022-06-19 14:13:36 -08:00
2022-07-27 07:09:43 -08:00
;; SORTA WORKING: Relative line numbers with stuff
; (use-package linum-relative
; :diminish
; :init
; (require 'cl-lib)
; (require 'linum-relative)
; (setq linum-relative-current-symbol "")
; (defun mitch/get-total-width ()
; "set up linum relative variables per buffer."
; (let ((total-lines (count-lines (point-min) (point-max))))
; (setq-local total-width (ceiling (log total-lines 10)))))
; ;; (defvar total-width 4)
; (defun mitch/symbol-width (symbol)
; (+ 1 (floor (log symbol 10))))
; (defun mitch/linum-get-left-pad (symbol)
; "Get the number of spaces to add before the current relative line number."
; (let* ((symbol-width (mitch/symbol-width line-number)))
; (- (mitch/get-total-width) symbol-width)))
; (defun mitch/right-pad (line-number)
; "Pad the line number to the right."
; (let* ((spacing (- (mitch/get-total-width) (mitch/symbol-width line-number)))
; (spacer (make-string spacing (string-to-char " "))))
; (format (concat "%s" spacer) line-number)))
; (defun mitch/left-pad (line-number)
; "Pad the line number to the left."
; (let ((spacing
; (make-string (mitch/linum-get-left-pad line-number)
; (string-to-char " "))))
; (format (concat spacing "%s") line-number)))
; (defun linum-relative (line-number)
; (let* ((diff1 (abs (- line-number linum-relative-last-pos)))
; (diff (if (cl-minusp diff1)
; diff1
; (+ diff1 linum-relative-plusp-offset)))
; (current-p (= diff linum-relative-plusp-offset))
; (current-symbol (if (and linum-relative-current-symbol current-p)
; (if (string= "" linum-relative-current-symbol)
; (mitch/right-pad line-number)
; linum-relative-current-symbol)
; (mitch/left-pad diff)))
; (face (if current-p 'linum-relative-current-face 'linum)))
; (propertize (format linum-relative-format current-symbol) 'face face)))
; (linum-relative-global-mode 1)
; ;; (mitch/linum-rel-setup)
; ; (linum-relative 282)
; :custom
; (linum-relative-current-symbol "")
; )
(setq display-line-numbers-mode 'relative)
2022-06-19 14:13:36 -08:00
;; broken terminal that doesn't compile but at least it's fast when it does
(use-package vterm
:custom
(vterm-always-compile-module t)
(vterm-module-cmake-args "-DUSE_SYSTEM_LIBVTERM=no")
(vterm-clear-scrollback-when-clearing t)
:config
(evil-collection-define-key 'insert 'vterm-mode-map
(kbd "C-w") 'evil-window-map)
(evil-collection-define-key 'normal 'vterm-mode-map
(kbd "RET") 'hkey-either)
(evil-collection-define-key 'normal 'vterm-mode-map
(kbd "k") 'vterm-send-up)
(evil-collection-define-key 'normal 'vterm-mode-map
(kbd "j") 'vterm-send-down)
2022-06-19 14:13:36 -08:00
(add-to-list 'vterm-keymap-exceptions
"C-w")
(add-to-list 'vterm-keymap-exceptions
"RET")
2022-06-19 14:13:36 -08:00
(setq mitch/vterm-eval-cmds-strings
'("update-pwd"
"restart-emacs"
"find-file-other-window"
"find-file-other-frame"
"eshell/emacs"
"eshell/man"
"dirvish"
"magit"
"info-other-window"
"add-vterm-eval-cmd"))
(defun add-vterm-eval-cmd (function)
"Add FUNCTION to `vterm-eval-cmds' so it can be ran through sh in vterm."
2022-06-19 14:13:36 -08:00
(add-to-list 'vterm-eval-cmds
(list function (intern function))))
(dolist (emacs-function mitch/vterm-eval-cmds-strings)
(add-vterm-eval-cmd emacs-function))
2022-06-19 14:13:36 -08:00
:hook
(vterm-mode . mitch/terminal-setup)
(vterm-exit-functions . save-buffers-kill-terminal))
(use-package multi-vterm
:commands (multi-vterm multi-vterm-other-window)
:config
(defun multi-vterm-other-window ()
"Run a new-ish vterm in the other window"
(interactive)
(other-window 1) (multi-vterm))
:general
(general-define-key
:states '(normal visual)
:prefix "SPC"
:non-normal-prefix "SPC"
"v" 'multi-vterm)
(general-define-key
:states 'normal
:prefix-map 'ctl-x-4-map
:prefix "SPC 4"
"v" 'multi-vterm-other-window))
;; Better modeline? Better modeline.
2022-06-19 14:13:36 -08:00
(use-package airline-themes
:custom
(airline-cursor-colors nil)
(airline-display-directory t)
2022-07-17 13:35:17 -08:00
(airline-eshell-colors nil)
2022-06-19 14:13:36 -08:00
(airline-shortened-directory-length 20)
;; (airline-utf-glyph-separator-left 9585)
;; (airline-utf-glyph-separator-right 9586)
(airline-utf-glyph-separator-left (string-to-char ""))
(airline-utf-glyph-separator-right (string-to-char ""))
:custom-face
(mode-line
((t
(:box (:line-width 2 :style released-button)
(:height (:inherit 'fixed-pitch))))))
2022-06-19 14:13:36 -08:00
:config
2022-07-05 20:56:48 -08:00
;; (load-theme 'airline-kolor t)
(load-theme 'airline-ravenpower t))
(use-package doom-modeline
:init (doom-modeline-mode))
(use-package nyan-mode
:init (nyan-mode))
2022-06-19 14:13:36 -08:00
;; Custom Theme.
;; Not to be confused with a color theme, or a color scheme, or a custom scheme.
(use-package autothemer
:custom
(window-divider-default-places t)
(right-divider-width 5)
(ring-bell-function 'ignore)
:config
(tooltip-mode -1)
(menu-bar-mode -1)
(load-theme 'mitch t))
2022-06-19 14:13:36 -08:00
;; (use-package yascroll
;; :diminish
;; :defer 1
;; ;; :if (not (display-graphic-p))
;; :custom (yascroll:delay-to-hide nil)
;; :custom-face
;; (yascroll:thumb-text-area ((t (:background "ForestGreen"))))
;; (yascroll:thumb-fringe
;; ((t (:background "ForestGreen" :foreground "ForestGreen"))))
;; :config (global-yascroll-bar-mode 1))
2022-06-19 14:13:36 -08:00
;; parentheses settingses
(use-package paredit
:defer 0.1
:general (general-define-key
:states 'normal
"M-j" 'paredit-forward-slurp-sexp
"M-k" 'paredit-forward-barf-sexp
"M-h" 'paredit-backward-barf-sexp
"M-l" 'paredit-backward-slurp-sexp)
:config
(show-paren-mode 1)
(electric-pair-mode 1)
:custom
(show-paren-delay 0)
(show-paren-style 'parenthesis))
;; org mode and messy things
(use-package org
:straight (:type built-in)
:mode (("\\.org$" . org-mode))
:diminish org-indent-mode
2022-06-19 14:13:36 -08:00
:custom
(org-ellipsis "")
(org-hide-leading-stars t)
(org-startup-indented t)
:config
2022-06-22 06:32:29 -08:00
;; (org-indent-mode)
2022-06-21 07:26:38 -08:00
;; (add-hook 'org-mode-hook
;; #'(lambda ()
;; (add-hook 'after-save-hook
;; #'(lambda ()
;; (org-babel-tangle)))))
(add-hook 'after-save-hook
2022-06-21 16:52:17 -08:00
#'(lambda () (if (equal major-mode 'org-mode)
(org-babel-tangle))))
2022-06-19 14:13:36 -08:00
(add-hook 'org-mode-hook
2022-06-21 16:52:17 -08:00
#'(lambda () (setq-local whitespace-style nil)))
2022-06-19 14:13:36 -08:00
(with-eval-after-load 'org
;; This is needed as of Org 9.2
(require 'org-tempo)
(add-to-list 'org-structure-template-alist '("sh" . "src shell"))
2022-06-23 19:00:45 -08:00
(add-to-list 'org-structure-template-alist '("el" . "src elisp"))
2022-06-19 14:13:36 -08:00
(add-to-list 'org-structure-template-alist '("ps1" . "src powershell")))
:hook (org-mode . turn-off-line-numbers))
(use-package org-variable-pitch
:diminish (buffer-face-mode org-variable-pitch-minor-mode)
2022-06-19 14:13:36 -08:00
:config
(set-face-attribute 'org-meta-line nil :inherit '(font-lock-comment-delimiter-face fixed-pitch))
:hook (org-mode . org-variable-pitch-minor-mode))
(use-package org-contrib
:after org
:config
(org-babel-do-load-languages
'org-babel-load-languages
'((powershell . t)
(shell . t)
)))
;; (use-package org-appear
;; :hook (org-mode . org-appear-mode)
;; :after org
;; :custom
;; (org-appear-autolinks t))
(use-package ob-powershell
:after (org powershell)
:custom
(ob-powershell-powershell-command "pwsh"))
(use-package company-org-block
:after (org company))
2022-06-25 10:59:43 -08:00
(use-package ox-hugo
:after ox)
2022-06-19 14:13:36 -08:00
;; cheaty key popups
(use-package which-key
:diminish
:defer 5
:init (which-key-mode t))
;; parentheses are boring
(use-package rainbow-delimiters
:diminish
:defer 1
:hook (prog-mode . rainbow-delimiters-mode))
;; Hex colors
(use-package rainbow-mode
:diminish
:defer 10
:hook (prog-mode . rainbow-mode))
;; Nobody loves a good language
(use-package powershell
:mode ("\\.ps1\\'" . powershell-mode))
(use-package cider
:defer 1)
;; or a bad language
(use-package haskell-mode
:mode "\\.hs\\'"
;; :init
;; (add-hook 'haskell-mode-hook 'haskell-decl-scan-mode)
;; (add-hook 'haskell-mode-hook #'lsp)
:bind (
:map haskell-mode-map
("C-c h" . hoogle)
("C-c s" . haskell-mode-stylish-buffer))
:config (message "Loaded haskell-mode")
(setq haskell-mode-stylish-haskell-path "brittany")
(setq haskell-hoogle-url "https://www.stackage.org/lts/hoogle?q=%s"))
;; c sharp; taken from https://www.reddit.com/r/emacs/comments/k8tnzg/help_setting_up_c_lsp_omnisharproslyn/
(use-package csharp-mode
;; :ensure t
:mode (("\\.cs\\'" . csharp-mode))
:config
(add-to-list 'compilation-error-regexp-alist-alist
'(my-csharp
"^\\(.+\\)(\\([1-9][0-9]+\\),\\([0-9]+\\)): \\(?:\\(warning\\)\\|error\\)?"
1 2 3 (4)))
(add-to-list 'compilation-error-regexp-alist 'my-csharp)
(defun my-csharp-repl ()
"Switch to the CSharpRepl buffer, creating it if necessary."
(interactive)
(if-let ((buf (get-buffer "*CSharpRepl*")))
(pop-to-buffer buf)
(when-let ((b (make-comint "CSharpRepl" "csharp")))
(switch-to-buffer-other-window b))))
(define-key csharp-mode-map (kbd "C-c C-z") 'my-csharp-repl)
;; (define-key csharp-mode-map (kbd "C-c C-c") #'projectile-compile-project)
)
(use-package omnisharp
;; :ensure t
:after csharp-mode
:config
(eval-after-load 'company '(add-to-list 'company-backends 'company-omnisharp))
;; (setq omnisharp-completing-read-function #'ivy-completing-read)
(put 'my-omnisharp-solution-path 'safe-local-variable #'stringp)
:hook (csharp-mode . omnisharp-mode))
(use-package lsp-mode
:hook ((powershell-mode . lsp)
(csharp-mode . lsp)
(lsp-mode . lsp-enable-which-key-integration)
(lsp-completion-mode . my/lsp-mode-setup-completion))
:commands lsp
:init
(defun my/lsp-mode-setup-completion ()
(setf (alist-get 'styles (alist-get 'lsp-capf completion-category-defaults))
'(flex))) ;; Configure flex
:custom
(lsp-completion-provider :none))
2022-07-05 20:56:48 -08:00
(use-package yasnippet
:after lsp)
2022-06-19 14:13:36 -08:00
;; optionally
(use-package lsp-ui
:after lsp
:commands lsp-ui-mode)
;; optionally if you want to use debugger
;; (use-package dap-mode)
;; (use-package dap-powershell)
;; (use-package dap-LANGUAGE) to load the dap adapter for your language
;; Better help-pages. Genuinely pretty great.
(use-package helpful
:general (general-define-key
[remap describe-key] 'helpful-key
[remap describe-variable] 'helpful-variable
[remap describe-function] 'helpful-callable)
(general-define-key
:keymaps 'help-map
"F" 'describe-face
"k" 'helpful-key)
(general-define-key
:keymaps 'emacs-lisp-mode-map
:states 'normal
"K" 'helpful-at-point))
;; Better lisp highlighting?
(use-package highlight-defined
:hook (emacs-lisp-mode . highlight-defined-mode))
;; Shell linting?
(use-package flycheck
:diminish
:hook (prog-mode . flycheck-mode)
;; :config (global-flycheck-mode t)
)
;; Emacs startup profiling
(use-package esup
:commands esup)
;; Blingy file tree view
;; (use-package treemacs
;; :general (general-define-key
;; :states 'normal
;; :prefix-command 'treemacs-map-prefix
;; :prefix-map 'treemacs-map
;; :prefix "SPC t"
;; "t" 'treemacs)
;; :config
;; (treemacs-project-follow-mode)
;; (treemacs-git-mode 'simple)
;; :hook
;; (treemacs-mode . turn-off-line-numbers))
;; (use-package treemacs-evil
;; :after treemacs)
;; (use-package treemacs-all-the-icons
;; :after treemacs)
2022-06-19 14:13:36 -08:00
;; Blingy laggy minimap on the right
(use-package minimap
:general (general-define-key
:states 'normal
:prefix-command 'mini-map-prefix
:prefix-map 'mini-map
:prefix "SPC m"
"m" 'minimap-mode
"k" 'minimap-kill)
:custom
(minimap-window-location 'right)
(minimap-update-delay 0)
:custom-face
(minimap-active-region-background
((t (:background "#303030" :extend t))))
(minimap-current-line-face
2022-07-21 08:15:38 -08:00
((nil (:background "#afafaf" :extend t)))))
2022-06-19 14:13:36 -08:00
;; epic drop-down completion
;; (use-package company
;; :diminish
;; :custom ;(company-require-match nil)
;; (company-tooltip-align-annotations t)
;; :hook (prog-mode . company-mode))
;; (use-package company-lsp
;; :after (lsp company)
;; :config
;; (push 'company-lsp company-backends))
2022-06-19 14:13:36 -08:00
;; (use-package company-fuzzy
2022-07-05 20:56:48 -08:00
;; :diminish
2022-06-19 14:13:36 -08:00
;; :hook (company-mode . company-fuzzy-mode)
;; ;; :init
;; :custom
;; ;; (company-fuzzy-sorting-backend 'flx)
;; (company-fuzzy-prefix-on-top nil)
;; (company-fuzzy-history-backends '(company-yasnippet))
;; (company-fuzzy-trigger-symbols '("." "->" "<" "\"" "'" "@"))
;; (company-fuzzy-passthrough-backends '(company-capf)))
(use-package corfu
:custom
(completion-cycle-threshold 3)
(tab-always-indent 'complete)
(corfu-auto t)
(corfu-quit-no-match t)
(corfu-count (- (window-total-height) 10))
;; (corfu-separator ";")
:init (global-corfu-mode)
;; (defun corfu-enable-always-in-minibuffer ()
;; "Enable Corfu in the minibuffer if Vertico/Mct are not active."
;; (unless (or (bound-and-true-p mct--active)
;; (bound-and-true-p vertico--input))
;; (setq-local corfu-auto nil) ;; Enable/disable auto completion
;; (corfu-mode 1)
;; (minibuffer-complete)))
;; (add-hook 'minibuffer-setup-hook #'corfu-enable-always-in-minibuffer 1)
;; (defun corfu-kill-in-minibuffer ()
;; "Kill corfu and minibuffer. To be bound to Esc."
;; (interactive)
;; (setq-local inhibit-debugger t)
;; (corfu-quit)
;; (exit-minibuffer)
;; )
(defun corfu-send-shell (&rest _)
"Send completion candidate when inside comint/eshell."
(cond
((and (derived-mode-p 'eshell-mode) (fboundp 'eshell-send-input))
(eshell-send-input))
((and (derived-mode-p 'comint-mode) (fboundp 'comint-send-input))
(comint-send-input))))
:general
(general-define-key
:prefix-map 'corfu-map
"C-n" 'corfu-next
"C-p" 'corfu-previous
"RET" 'corfu-insert
"ESC" 'corfu-kill-in-minibuffer
)
)
2022-06-19 14:13:36 -08:00
(use-package popon
:straight
(:type git
:repo "https://codeberg.org/akib/emacs-popon")
:if (not (display-graphic-p)))
2022-06-19 14:13:36 -08:00
(use-package corfu-terminal
:straight
(:type git
:repo "https://codeberg.org/akib/emacs-corfu-terminal")
:after popon
2022-06-19 14:13:36 -08:00
:init (unless
(display-graphic-p)
(corfu-terminal-mode +1)))
;; Visualize whitespace. In a very chill and invisible way.
;; (use-package lsp-dart
;; ;; :custom (lsp-dart-dap-flutter-hot-reload t)
;; :init
;; (add-hook 'dart-mode-hook 'lsp)
;; (add-hook 'dart-mode-hook
;; #'(lambda ()
;; (add-hook 'after-save-hook
;; #'(lambda ()
;; (lsp-dart-dap-flutter-hot-reload))))))
2022-07-05 20:56:48 -08:00
;; (use-package popper
;; :custom
;; (display-buffer-base-action '(display-buffer-pop-up-window))
;; (popper-reference-buffers
;; '(
;; helpful-mode
;; compilation-mode
;; ibuffer-mode
;; "*Warnings"))
;; (popper-mode-line nil)
;; :init
;; (popper-mode +1)
;; (popper-echo-mode +1))
;; (setq display-buffer-base-action '(display-buffer-pop-up-window . nil))
2022-06-19 14:13:36 -08:00
2022-06-21 17:04:19 -08:00
2022-06-19 14:13:36 -08:00
(use-package xwidget ;-webkit
:straight (:type built-in)
:if (featurep 'xwidget-internal)
2022-06-22 06:32:29 -08:00
:commands xwidget-webkit-browse-url
2022-06-19 14:13:36 -08:00
:config
(add-hook 'xwidget-webkit-mode-hook
#'(lambda ()
(turn-off-line-numbers)
(scroll-bar-mode -1)
2022-06-23 19:00:45 -08:00
)))
2022-06-19 14:13:36 -08:00
2022-06-22 06:32:29 -08:00
(use-package magit
2022-07-27 07:09:43 -08:00
:commands magit
:hook (magit-mode . turn-off-line-numbers))
(use-package hyperbole
:diminish
2022-06-22 06:32:29 -08:00
;; :init (hyperbole-mode)
:general (general-define-key
:states 'normal
"RET" 'hkey-either))
2022-06-25 10:59:43 -08:00
(use-package dconf-mode
:straight
(:type git
:repo "https://git.mitchmarq42.xyz/mitch/dconf-mode.el"))
(use-package info-variable-pitch
:straight
(:type git :host github
:repo "kisaragi-hiu/info-variable-pitch")
:config
(add-hook 'Info-mode-hook #'info-variable-pitch-mode))
;; (use-package empv
;; :straight
;; (:type git :host github
;; :repo "isamert/empv.el"))
2022-07-05 20:56:48 -08:00
;; (use-package exwm
;; ;; :init
;; ;; (require 'exwm-config)
;; ;; (exwm-config-example)
;; )
(use-package ani-el
:straight (:type git :repo "https://git.mitchmarq42.xyz/mitch/ani-el"
:files ("ani-el.el" "lib")))
2022-07-05 20:56:48 -08:00
(use-package slime
:if (file-exists-p (expand-file-name "~/quicklisp/slime-helper.el"))
:custom (inferior-lisp-program "sbcl")
:init (load (expand-file-name "~/quicklisp/slime-helper.el")))
;; (use-package pdf-tools
;; :config (add-hook 'pdf-view-mode-hook 'turn-off-line-numbers))
;; built in spell checker, for losers
(use-package flyspell
:straight (:type built-in)
:custom
(flyspell-auto-correct-word t)
:hook
(org-mode . flyspell-mode))
(use-package clojure-mode)
(use-package inf-clojure)
2022-06-19 14:13:36 -08:00
(provide 'mitch-packages)
;;; mitch-packages.el ends here