more emacs tweaks
This commit is contained in:
@@ -50,6 +50,13 @@
|
||||
:defer t
|
||||
:straight '(:type git :host github :repo "nemethf/eglot-x"))
|
||||
|
||||
(use-package sly
|
||||
:ensure t
|
||||
:defer t
|
||||
:hook common-lisp-mode
|
||||
:config
|
||||
(setq inferior-lisp-program "sbcl"))
|
||||
|
||||
(dolist (mode '(c-ts-mode-hook
|
||||
rust-ts-mode-hook
|
||||
odin-ts-mode-hook
|
||||
|
||||
@@ -94,11 +94,48 @@
|
||||
;; (vertico-count 20) ;; Show more candidates
|
||||
;; (vertico-resize t) ;; Grow and shrink the Vertico minibuffer
|
||||
(vertico-cycle t) ;; Enable cycling for `vertico-next/previous'
|
||||
(vertico-multiform-mode)
|
||||
:init
|
||||
(vertico-multiform-mode)
|
||||
(vertico-mode)
|
||||
(define-key vertico-map (kbd "DEL") #'vertico-directory-delete-char))
|
||||
|
||||
(defvar +vertico-transform-functions nil)
|
||||
|
||||
(cl-defmethod vertico--format-candidate :around
|
||||
(cand prefix suffix index start &context ((not +vertico-transform-functions) null))
|
||||
(dolist (fun (ensure-list +vertico-transform-functions))
|
||||
(setq cand (funcall fun cand)))
|
||||
(cl-call-next-method cand prefix suffix index start))
|
||||
|
||||
(defun +vertico-highlight-directory (file)
|
||||
"If FILE ends with a slash, highlight it as a directory."
|
||||
(if (string-suffix-p "/" file)
|
||||
(propertize file 'face 'marginalia-file-priv-dir) ; or face 'dired-directory
|
||||
file))
|
||||
|
||||
;; function to highlight enabled modes similar to counsel-M-x
|
||||
(defun +vertico-highlight-enabled-mode (cmd)
|
||||
"If MODE is enabled, highlight it as font-lock-constant-face."
|
||||
(let ((sym (intern cmd)))
|
||||
(if (or (eq sym major-mode)
|
||||
(and
|
||||
(memq sym minor-mode-list)
|
||||
(boundp sym)))
|
||||
(propertize cmd 'face 'font-lock-constant-face)
|
||||
cmd)))
|
||||
|
||||
;; add-to-list works if 'file isn't already in the alist
|
||||
;; setq can be used but will overwrite all existing values
|
||||
(add-to-list 'vertico-multiform-categories
|
||||
'(file
|
||||
;; this is also defined in the wiki, uncomment if used
|
||||
;; (vertico-sort-function . vertico-sort-directories-first)
|
||||
(+vertico-transform-functions . +vertico-highlight-directory)))
|
||||
(add-to-list 'vertico-multiform-commands
|
||||
'(execute-extended-command
|
||||
(+vertico-transform-functions . +vertico-highlight-enabled-mode)))
|
||||
|
||||
|
||||
;; Enable rich annotations using the Marginalia package
|
||||
(use-package marginalia
|
||||
;; Bind `marginalia-cycle' locally in the minibuffer. To make the binding
|
||||
|
||||
@@ -91,7 +91,7 @@
|
||||
(use-package parinfer-rust-mode
|
||||
:ensure t
|
||||
:defer t
|
||||
:hook emacs-lisp-mode
|
||||
:hook ((emacs-lisp-mode common-lisp-mode lisp-mode scheme-mode) . parinfer-rust-mode)
|
||||
:config
|
||||
(electric-pair-mode -1))
|
||||
|
||||
@@ -99,5 +99,11 @@
|
||||
:ensure t
|
||||
:defer t)
|
||||
|
||||
;; (use-package zoxide
|
||||
;; :ensure t
|
||||
;; :defer t
|
||||
;; :hook eshell-mode
|
||||
;; :straight '(:type git host: sourcehut :repo "vonfry/zoxide.el"))
|
||||
|
||||
(provide 'utils)
|
||||
;;; utils.el ends here
|
||||
|
||||
Reference in New Issue
Block a user