fixed completion stuff

This commit is contained in:
2023-05-17 18:43:44 +02:00
parent c95520c79d
commit 5ea488e4fa
6 changed files with 30 additions and 22 deletions

View File

@@ -1,6 +1,6 @@
- replace smex with https://github.com/DarwinAwardWinner/amx - replace smex with https://github.com/DarwinAwardWinner/amx
- try to marry amx and marginalia somehow - try to marry amx and marginalia somehow
- try https://github.com/oantolin/embark - try https://github.com/oantolin/embark
- check out other vertico extensions
- play with embark: https://karthinks.com/software/fifteen-ways-to-use-embark/ - play with embark: https://karthinks.com/software/fifteen-ways-to-use-embark/
- FIXME: orglist mode: not more able to jump word wise with M-<left|right> - FIXME: orglist mode: not more able to jump word wise with M-<left|right>
- FIXME: how to get rid of IDO?

View File

@@ -156,7 +156,7 @@
(require 'init-ibuffer) (require 'init-ibuffer)
(require 'init-printing) (require 'init-printing)
;; (require 'init-completion) (require 'init-completion)
(require 'init-smarter-than-emacs) (require 'init-smarter-than-emacs)
(require 'init-marginalia) (require 'init-marginalia)
(require 'init-ui) (require 'init-ui)

View File

@@ -8,7 +8,7 @@
;; Hint: Use C-f during file selection to switch to regular find-file ;; Hint: Use C-f during file selection to switch to regular find-file
;; Basic config ;; Basic config
(ido-mode t) ;; (ido-mode t)
(ido-everywhere nil) (ido-everywhere nil)
(use-package ido-completing-read+) (use-package ido-completing-read+)
@@ -85,7 +85,8 @@
(progn (progn
(ido-set-current-directory "/ssh:") (ido-set-current-directory "/ssh:")
(ido-reread-directory)) (ido-reread-directory))
(call-interactively 'self-insert-command)))))) (call-interactively 'self-insert-command))))
(define-key ido-file-completion-map (kbd "C-.") 'embark-act)))
;; by howardism: [re]open non-writable file with sudo ;; by howardism: [re]open non-writable file with sudo
(defadvice ido-find-file (after find-file-sudo activate) (defadvice ido-find-file (after find-file-sudo activate)

View File

@@ -96,7 +96,7 @@
;; Modify the default ibuffer-formats ;; Modify the default ibuffer-formats
(setq ibuffer-formats (setq ibuffer-formats
'((mark modified read-only " " '((mark modified read-only " "
(name 20 40 :left :elide) (name 30 60 :left :elide)
" " " "
(size-h 9 -1 :right) (size-h 9 -1 :right)
" " " "

View File

@@ -33,7 +33,7 @@
(when file (when file
(find-file file)))) (find-file file))))
(global-set-key (kbd "C-x C-r") 'recentf-ido-find-file) ; open recent files, same as M-x rf (global-set-key (kbd "C-x C-r") 'recentf-ido-find-file) ;; open recent files, same as M-x rf
;; now if I incidentally closed a buffer, I can re-open it, thanks to ;; now if I incidentally closed a buffer, I can re-open it, thanks to
;; recent-files ;; recent-files

View File

@@ -23,7 +23,7 @@
;; (setq vertico-resize t) ;; (setq vertico-resize t)
;; Optionally enable cycling for `vertico-next' and `vertico-previous'. ;; Optionally enable cycling for `vertico-next' and `vertico-previous'.
;; (setq vertico-cycle t) (setq vertico-cycle t)
:config :config
@@ -39,18 +39,34 @@ via [[http://whattheemacsd.com/setup-ido.el-02.html][whattheemacs.d]]"
:bind (:map vertico-map :bind (:map vertico-map
("~" . tvd-vertico-jump-home) ("~" . tvd-vertico-jump-home)
("RET" . #'vertico-directory-enter))) ("RET" . #'vertico-directory-enter)
;; experimental, pressing tab on a match doesn't
;; complete it but show the next match, that way I avoid
;; being completed into nonsense matches
("TAB" . #'vertico-next)))
(use-package orderless
:init
;; Configure a custom style dispatcher (see the Consult wiki)
;; (setq orderless-style-dispatchers '(+orderless-consult-dispatch orderless-affix-dispatch)
;; orderless-component-separator #'orderless-escapable-split-on-space)
(setq completion-styles '(substring orderless basic)
orderless-matching-styles '(orderless-prefixes)
completion-category-defaults nil
completion-category-overrides '((file (styles partial-completion)))))
(use-package embark (use-package embark
:ensure t :ensure t
:bind :bind
(("C-." . embark-act) ;; pick some comfortable binding (("C-." . embark-act) ;; pick some comfortable binding
("C-," . embark-dwim) ;; good alternative: M-. ("C-," . embark-dwim)) ;; good alternative: M-.
) ;; alternative for `describe-bindings'
:init :init
@@ -72,7 +88,9 @@ via [[http://whattheemacsd.com/setup-ido.el-02.html][whattheemacs.d]]"
;;; *** Smarter Search
;; test, replace isearch-forward-regexp first only. ;; test, replace isearch-forward-regexp first only.
;; dir: ivy/ ;; dir: ivy/
@@ -82,17 +100,6 @@ via [[http://whattheemacsd.com/setup-ido.el-02.html][whattheemacs.d]]"
(global-set-key "\C-s" 'swiper)) (global-set-key "\C-s" 'swiper))
(use-package orderless
:init
;; Configure a custom style dispatcher (see the Consult wiki)
;; (setq orderless-style-dispatchers '(+orderless-consult-dispatch orderless-affix-dispatch)
;; orderless-component-separator #'orderless-escapable-split-on-space)
(setq completion-styles '(orderless basic)
completion-category-defaults nil
completion-category-overrides '((file (styles partial-completion))))
)
(provide 'init-smarter-than-emacs) (provide 'init-smarter-than-emacs)
;;; init-smarter-than-emacs ends here ;;; init-smarter-than-emacs ends here