working system

This commit is contained in:
Charlie Root 2024-09-06 11:42:11 +02:00
commit e0ad4ea627
53 changed files with 2927 additions and 0 deletions

56
lisp/init-minibuffer.el Normal file
View file

@ -0,0 +1,56 @@
;;; init-minibuffer.el --- Config for minibuffer completion -*- lexical-binding: t; -*-
;;; Commentary:
;;; Code:
(when (maybe-require-package 'vertico)
(add-hook 'after-init-hook 'vertico-mode)
(when (maybe-require-package 'embark)
(with-eval-after-load 'vertico
(define-key vertico-map (kbd "C-c C-o") 'embark-export)
(define-key vertico-map (kbd "C-c C-c") 'embark-act)))
(when (maybe-require-package 'consult)
(defmacro sanityinc/no-consult-preview (&rest cmds)
`(with-eval-after-load 'consult
(consult-customize ,@cmds :preview-key "M-P")))
(sanityinc/no-consult-preview
consult-ripgrep
consult-git-grep consult-grep
consult-bookmark consult-recent-file consult-xref
consult--source-recent-file consult--source-project-recent-file consult--source-bookmark)
(when (and (executable-find "rg"))
(defun sanityinc/consult-ripgrep-at-point (&optional dir initial)
(interactive (list prefix-arg (when-let ((s (symbol-at-point)))
(symbol-name s))))
(consult-ripgrep dir initial))
(sanityinc/no-consult-preview sanityinc/consult-ripgrep-at-point)
(global-set-key (kbd "M-?") 'sanityinc/consult-ripgrep-at-point))
(global-set-key [remap switch-to-buffer] 'consult-buffer)
(global-set-key [remap switch-to-buffer-other-window] 'consult-buffer-other-window)
(global-set-key [remap switch-to-buffer-other-frame] 'consult-buffer-other-frame)
(global-set-key [remap goto-line] 'consult-goto-line)
(when (maybe-require-package 'embark-consult)
(with-eval-after-load 'embark
(require 'embark-consult)
(add-hook 'embark-collect-mode-hook 'embark-consult-preview-minor-mode)))))
;; (when (maybe-require-package 'vertico-posframe)
;; (add-hook 'after-init-hook 'vertico-posframe-mode)
;; (setq vertico-posframe-poshandler #'posframe-poshandler-frame-bottom-right-corner)
;; (setq vertico-posframe-border-width 4)
;; )
(when (maybe-require-package 'marginalia)
(add-hook 'after-init-hook 'marginalia-mode))
(provide 'init-minibuffer)
;;; init-minibuffer.el ends here