From a187752c824b47052d33d3bc12749b5a7d2e8191 Mon Sep 17 00:00:00 2001 From: Franck Cuny Date: Thu, 1 Jun 2023 19:35:59 -0700 Subject: 🤡 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I06b104d79deac199f9cd9cdae705e333d23cc852 --- emacs/custom/my-completion.el | 88 ------------------------------------------- 1 file changed, 88 deletions(-) delete mode 100644 emacs/custom/my-completion.el (limited to 'emacs/custom/my-completion.el') diff --git a/emacs/custom/my-completion.el b/emacs/custom/my-completion.el deleted file mode 100644 index e66f0ce..0000000 --- a/emacs/custom/my-completion.el +++ /dev/null @@ -1,88 +0,0 @@ -;;; my-completion.el --- Configure parts related to completion -*- lexical-binding: t -*- - -;;; Commentary: - -;;; Code: - -(require 'cape) -(require 'consult) -(require 'corfu) -(require 'corfu-popupinfo) -(require 'orderless) -(require 'marginalia) -(require 'savehist) -(require 'vertico) - -;;; settings -;; save the mini buffer's history -(savehist-mode t) -(setq savehist-file (expand-file-name "var/history" user-emacs-directory)) - -(setq completion-styles '(orderless basic)) -(setq completion-category-defaults nil) - -(setq corfu-cycle t) ;; Enable cycling for `corfu-next/previous' -(setq corfu-auto t) ;; Enable auto completion -(setq corfu-max-width 80) ;; Default is 100 and is too wide - -(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)))) - -(advice-add #'corfu-insert :after #'corfu-send-shell) - -;; enable corfu popup mode -(corfu-popupinfo-mode t) - -;; transition quickly -(setq corfu-popupinfo-delay '(0.25 . 0.1)) - -;; don't hide the popup when -;; transitioning between candidates -(setq corfu-popupinfo-hide nil) - -;; Silence the pcomplete capf, no errors or messages! -(advice-add 'pcomplete-completions-at-point :around #'cape-wrap-silent) - -;; Ensure that pcomplete does not write to the buffer -;; and behaves as a pure `completion-at-point-function'. -(advice-add 'pcomplete-completions-at-point :around #'cape-wrap-purify) - -(vertico-mode t) ;; Enable vertico globally -(marginalia-mode t) ;; Enable marginalia globally -(global-corfu-mode) ;; Enable corfu globally - -(add-to-list 'completion-at-point-functions #'cape-file) -(add-to-list 'completion-at-point-functions #'cape-abbrev) -(add-to-list 'completion-at-point-functions #'cape-ispell) - -;;; bindings -(global-set-key (kbd "C-c m") 'consult-mode-command) -(global-set-key (kbd "C-x b") 'consult-buffer) -(global-set-key (kbd "C-x 4 b") 'consult-buffer-other-window) -(global-set-key (kbd "C-x r b") 'consult-bookmark) -(global-set-key (kbd "C-x p b") 'consult-project-buffer) -(global-set-key (kbd "C-c i") 'consult-imenu) -(global-set-key (kbd "C-c f") 'consult-git-grep) -(global-set-key (kbd "C-c /") 'consult-ripgrep) -(global-set-key (kbd "C-c r") 'consult-recent-file) -(global-set-key (kbd "M-y") 'consult-yank-pop) -(global-set-key (kbd "M-g e") 'consult-compile-error) -(global-set-key (kbd "M-g f") 'consult-flymake) -(global-set-key (kbd "M-g M-g") 'consult-goto-line) -(global-set-key (kbd "M-g O") 'consult-outline) -(global-set-key (kbd "M-g o") 'consult-org-heading) -(global-set-key (kbd "M-g m") 'consult-mark) -(global-set-key (kbd "M-g k") 'consult-global-mark) -(global-set-key (kbd "M-s l") 'consult-line) -(global-set-key (kbd "M-s L") 'consult-line-multi) - -;;; hooks - -(provide 'my-completion) - -;;; my-completion.el ends here -- cgit 1.4.1