feat(vertico): use basic completion for remotes
Close: #5313 Co-authored-by: Stefan Lendl <ste.lendl@gmail.com>
This commit is contained in:
parent
2fdcefa831
commit
fc163b16c9
2 changed files with 17 additions and 1 deletions
|
@ -299,3 +299,13 @@ targets."
|
|||
(if keymap
|
||||
(cons '(vertico-current . embark-target) fr)
|
||||
fr))))))
|
||||
|
||||
;;;###autoload
|
||||
(defun +vertico-basic-remote-try-completion (string table pred point)
|
||||
(and (vertico--remote-p string)
|
||||
(completion-basic-try-completion string table pred point)))
|
||||
|
||||
;;;###autoload
|
||||
(defun +vertico-basic-remote-all-completions (string table pred point)
|
||||
(and (vertico--remote-p string)
|
||||
(completion-basic-all-completions string table pred point)))
|
||||
|
|
|
@ -53,11 +53,17 @@ overrides `completion-styles' during company completion sessions.")
|
|||
;; Flex matching
|
||||
((string-prefix-p "~" pattern) `(orderless-flex . ,(substring pattern 1)))
|
||||
((string-suffix-p "~" pattern) `(orderless-flex . ,(substring pattern 0 -1)))))
|
||||
(add-to-list
|
||||
'completion-styles-alist
|
||||
'(+vertico-basic-remote
|
||||
+vertico-basic-remote-try-completion
|
||||
+vertico-basic-remote-all-completions
|
||||
"Use basic completion on remote files only"))
|
||||
(setq completion-styles '(orderless)
|
||||
completion-category-defaults nil
|
||||
;; note that despite override in the name orderless can still be used in
|
||||
;; find-file etc.
|
||||
completion-category-overrides '((file (styles . (orderless partial-completion))))
|
||||
completion-category-overrides '((file (styles +vertico-basic-remote orderless partial-completion)))
|
||||
orderless-style-dispatchers '(+vertico-orderless-dispatch)
|
||||
orderless-component-separator "[ &]")
|
||||
;; ...otherwise find-file gets different highlighting than other commands
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue