forked from FG42/FG42
1
0
Fork 0

Make vertico available on the WM but not consult

This commit is contained in:
Sameer Rahmani 2024-04-29 13:59:14 +01:00
parent 09e32cc5a5
commit a9b7a40473
Signed by: lxsameer
GPG Key ID: 8741FACBF412FFA5
3 changed files with 73 additions and 67 deletions

View File

@ -283,8 +283,7 @@ contextual information."
;; Activating the WM mode
(exwm-enable)
(exwm-systemtray-enable)
(exwm-randr-enable)
(fido-mode))
(exwm-randr-enable))
(message "[FG42]: Use `fg42-help' to get help."))

View File

@ -25,64 +25,62 @@
(require 'fpkg)
(require 'fg42/config))
;; We don't want vertico in wm mode. Since it serves no purpose really.
(when-not-wm
(use! vertico
"Vertico provides a performant and minimalistic vertical completion UI
(use! vertico
"Vertico provides a performant and minimalistic vertical completion UI
based on the default completion system. The focus of Vertico is to provide
a UI which behaves correctly under all circumstances."
:config
(require 'vertico-multiform)
(require 'vertico-flat)
(require 'vertico-grid)
(require 'vertico-buffer)
(require 'vertico-indexed)
(require 'vertico-quick)
(require 'vertico-repeat)
:config
(require 'vertico-multiform)
(require 'vertico-flat)
(require 'vertico-grid)
(require 'vertico-buffer)
(require 'vertico-indexed)
(require 'vertico-quick)
(require 'vertico-repeat)
(vertico-mode)
(vertico-multiform-mode)
;; Configure the display per command.
;; Use a buffer with indices for imenu
(vertico-mode)
(vertico-multiform-mode)
;; Configure the display per command.
;; Use a buffer with indices for imenu
(setq vertico-multiform-commands
'((imenu buffer indexed)))
;; Configure the display per completion category.
;; Use the grid display for files and a buffer
;; for the consult-grep commands.
(setq vertico-multiform-categories
'((file grid)))
(setq vertico-count 10)
(setq vertico-cycle t)
(when-wm
(setq vertico-multiform-commands
'((imenu buffer indexed)))
;; Configure the display per completion category.
;; Use the grid display for files and a buffer
;; for the consult-grep commands.
'((t flat)))
(setq vertico-multiform-categories
'((file grid)))
(setq vertico-count 10)
(setq vertico-cycle t)
(when-wm
(setq vertico-multiform-commands
'((t flat)))
(setq vertico-multiform-categories
'((file flat)))))
'((file flat)))))
(use! orderless
"This package provides an orderless completion style that divides the
(use! orderless
"This package provides an orderless completion style that divides the
pattern into space-separated components, and matches candidates that
match all of the components in any order."
:init
(setq completion-styles '(orderless basic)
completion-category-defaults nil
completion-category-overrides '((file (styles partial-completion)))))
:init
(setq completion-styles '(orderless basic)
completion-category-defaults nil
completion-category-overrides '((file (styles partial-completion)))))
(use! marginalia
"Adds useful info to minibuffers completions."
:commands marginalia-mode
:hook (emacs-startup . marginalia-mode))
(use! marginalia
"Adds useful info to minibuffers completions."
:commands marginalia-mode
:hook (emacs-startup . marginalia-mode))
(when-not-wm
(use! ctrlf
"Single buffer text search."
:config
(ctrlf-mode +1)))
(when-not-wm
(use! ctrlf
"Single buffer text search."
:config
(ctrlf-mode +1))
(use! consult
@ -192,6 +190,7 @@ match all of the components in any order."
)
;; For some reason `consult's autoloads do not work
(use! consult-imenu
"Setup the `consult-imenu' stuff."
:after consult
@ -202,28 +201,28 @@ match all of the components in any order."
(use! consult-compile
"Setup the `consult-compile' stuff."
:after consult
:bind (("M-g e" . consult-compile-error)))
:bind (("M-g e" . consult-compile-error))))
(with-config "graphics"
(use! nerd-icons-completion
"Nerd icons in marginalia"
:after marginalia
:config
(nerd-icons-completion-mode)
(add-hook 'marginalia-mode-hook #'nerd-icons-completion-marginalia-setup)))
(with-config "graphics"
(use! nerd-icons-completion
"Nerd icons in marginalia"
:after marginalia
:config
(nerd-icons-completion-mode)
(add-hook 'marginalia-mode-hook #'nerd-icons-completion-marginalia-setup)))
(with-config "floating-vertico"
(use! vertico-posframe
"This is an vertico extension, which lets vertico use posframe to show
(with-config "floating-vertico"
(use! vertico-posframe
"This is an vertico extension, which lets vertico use posframe to show
its candidate menu."
:hook (emacs-startup . vertico-posframe-mode)
:config
(setq vertico-posframe-parameters
'((left-fringe . 1)
(right-fringe . 1)
(border . 1))))))
:hook (emacs-startup . vertico-posframe-mode)
:config
(setq vertico-posframe-parameters
'((left-fringe . 1)
(right-fringe . 1)
(border . 1)))))
(provide 'fg42/minibuffer-vertico)
;;; minibuffer-vertico.el ends here

View File

@ -79,7 +79,15 @@
:commands exwm-enable
:config
(require 'exwm-config)
(exwm-config-ido)
;; (setq ido-enable-flex-matching t)
;; Setup a basic completion
;; (icomplete-mode)
;; (defun my-icomplete-styles ()
;; (setq-local completion-styles '(flex initials)))
;; (add-hook 'icomplete-minibuffer-setup-hook 'my-icomplete-styles)
;; (exwm-config-ido)
;; Set the initial number of workspaces (they can also be created later).
(setq exwm-workspace-number 10)
@ -125,7 +133,7 @@
(number-sequence 0 9))
;; Bind "s-&" to launch applications ('M-&' also works if the output
;; buffer does not bother you).
([?\s-d] . #'fg42/run)
([?\s-d] . fg42/run)
;; Bind "s-<f2>" to "slock", a simple X display locker.
([s-f2] . (lambda ()
(interactive)