Skip to first and last candidate in vertico
This commit is contained in:
parent
c2f091634e
commit
4252faee42
@ -929,13 +929,16 @@ Ace Window will show a hint if there are more than 2 windows, but I don't really
|
|||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
|
;; TODO Prot help improving workflow. There's a bug where sometimes this doesn't work anymore
|
||||||
|
;; Is there a way to detect if the current window is a side window?
|
||||||
(global-set-key (kbd "C-`") #'window-toggle-side-windows)
|
(global-set-key (kbd "C-`") #'window-toggle-side-windows)
|
||||||
|
|
||||||
(defvar joe/side-window-buffers '("^\\*Flycheck errors\\*$"
|
(defvar joe/side-window-buffers '("^\\*Flycheck errors\\*$"
|
||||||
"^\\*Completions\\*$"
|
"^\\*Completions\\*$"
|
||||||
|
"^\\*Occur\\*$"
|
||||||
"^\\*Help\\*$"
|
"^\\*Help\\*$"
|
||||||
"^\\*Embark.*"
|
"^\\*Embark.*"
|
||||||
"^\\*helpful.*"
|
"^\\*helpful .*"
|
||||||
"^\\*Compilation\\*$"
|
"^\\*Compilation\\*$"
|
||||||
"^\\*SQL.*"
|
"^\\*SQL.*"
|
||||||
"^\\*HTTP Response\\*$"
|
"^\\*HTTP Response\\*$"
|
||||||
@ -963,6 +966,12 @@ Ace Window will show a hint if there are more than 2 windows, but I don't really
|
|||||||
'((t :inherit font-lock-string-face))
|
'((t :inherit font-lock-string-face))
|
||||||
"Face for `consult' framed buffers.")
|
"Face for `consult' framed buffers.")
|
||||||
|
|
||||||
|
;; If you want to filter the current buffer you can use this and replace :items in the
|
||||||
|
;; beframe-consult-source var
|
||||||
|
;; (defun joe/consult-beframe-names-minus-current ()
|
||||||
|
;; (delete (buffer-name) (beframe-buffer-names)))
|
||||||
|
;; :items ,#'joe/consult-beframe-names-minus-current
|
||||||
|
|
||||||
(defvar beframe-consult-source
|
(defvar beframe-consult-source
|
||||||
`( :name "Frame-specific buffers (current frame)"
|
`( :name "Frame-specific buffers (current frame)"
|
||||||
:narrow ?F
|
:narrow ?F
|
||||||
@ -977,8 +986,6 @@ Ace Window will show a hint if there are more than 2 windows, but I don't really
|
|||||||
|
|
||||||
(beframe-mode +1)
|
(beframe-mode +1)
|
||||||
|
|
||||||
(global-set-key (kbd "s-n") #'joe/consult-buffer-vertico)
|
|
||||||
(global-set-key (kbd "s-p") #'joe/consult-buffer-vertico)
|
|
||||||
#+end_src
|
#+end_src
|
||||||
*** COMMENT Popper
|
*** COMMENT Popper
|
||||||
|
|
||||||
@ -1287,44 +1294,60 @@ Ace Window will show a hint if there are more than 2 windows, but I don't really
|
|||||||
** VEMCO
|
** VEMCO
|
||||||
*** Vertico
|
*** Vertico
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(require 'all-the-icons-completion)
|
(require 'all-the-icons-completion)
|
||||||
;; (require '(vertico :files (:defaults "extensions/*")
|
;; (require '(vertico :files (:defaults "extensions/*")
|
||||||
;; :includes (vertico-indexed
|
;; :includes (vertico-indexed
|
||||||
;; vertico-repeat
|
;; vertico-repeat
|
||||||
;; vertico-directory))
|
;; vertico-directory))
|
||||||
|
|
||||||
(require 'vertico)
|
(require 'vertico)
|
||||||
(vertico-mode)
|
(vertico-mode)
|
||||||
;; (elpaca 'vertico-posframe)
|
;; (elpaca 'vertico-posframe)
|
||||||
|
|
||||||
;; (define-key vertico-map (kbd "C-w") #'vertico-directory-delete-word)
|
;; (define-key vertico-map (kbd "C-w") #'vertico-directory-delete-word)
|
||||||
;; (define-key vertico-map (kbd "C-r") #'vertico-repeat-)
|
;; (define-key vertico-map (kbd "C-r") #'vertico-repeat-)
|
||||||
|
|
||||||
;; (vertico-posframe-mode t)
|
;; (vertico-posframe-mode t)
|
||||||
;; (vertico-indexed-mode)
|
;; (vertico-indexed-mode)
|
||||||
;; (setq vertico-posframe-parameters
|
;; (setq vertico-posframe-parameters
|
||||||
;; '((left-fringe . 100)
|
;; '((left-fringe . 100)
|
||||||
;; (right-fringe . 100)))
|
;; (right-fringe . 100)))
|
||||||
|
|
||||||
;; (setq vertico-posframe-border-width 5)
|
;; (setq vertico-posframe-border-width 5)
|
||||||
;; (setq vertico-posframe-min-height 20)
|
;; (setq vertico-posframe-min-height 20)
|
||||||
;; (defun posframe-poshandler-slightly-below-top (info)
|
(defun posframe-poshandler-slightly-below-top (info)
|
||||||
;; (cons (/ (- (plist-get info :parent-frame-width)
|
(cons (/ (- (plist-get info :parent-frame-width)
|
||||||
;; (plist-get info :posframe-width))
|
(plist-get info :posframe-width))
|
||||||
;; 2)
|
2)
|
||||||
;; 150))
|
180))
|
||||||
;; (setq vertico-posframe-poshandler #'posframe-poshandler-slightly-below-top)
|
|
||||||
|
|
||||||
(defun joe/consult-buffer-vertico ()
|
;; (setq vertico-posframe-poshandler #'posframe-poshandler-frame-center)
|
||||||
|
(setq vertico-posframe-poshandler #'posframe-poshandler-slightly-below-top)
|
||||||
|
|
||||||
|
(defun joe/consult-buffer-vertico-indexed (start-index)
|
||||||
(interactive)
|
(interactive)
|
||||||
(let ((vertico-count 12)
|
(let ((vertico-count 12)
|
||||||
(vertico-posframe-width 110)
|
(vertico-posframe-width 110)
|
||||||
(vertico-posframe-height 20))
|
(vertico-posframe-height 20)
|
||||||
(consult-buffer)))
|
(vertico-group-format nil)
|
||||||
|
(vertico-indexed-start 1)
|
||||||
|
(vertico--index start-index)
|
||||||
|
(consult-buffer-sources '(beframe-consult-source)))
|
||||||
|
(consult-buffer)))
|
||||||
|
|
||||||
(setq vertico-count 20
|
(defun joe/consult-buffer-vertico-next ()
|
||||||
vertico-resize nil
|
(interactive)
|
||||||
vertico-cycle t)
|
(joe/consult-buffer-vertico-indexed 1))
|
||||||
|
(defun joe/consult-buffer-vertico-last ()
|
||||||
|
(interactive)
|
||||||
|
(joe/consult-buffer-vertico-indexed (1- (length (beframe-buffer-names)))))
|
||||||
|
|
||||||
|
(global-set-key (kbd "s-n") #'joe/consult-buffer-vertico-next)
|
||||||
|
(global-set-key (kbd "s-p") #'joe/consult-buffer-vertico-last)
|
||||||
|
|
||||||
|
(setq vertico-count 20
|
||||||
|
vertico-resize nil
|
||||||
|
vertico-cycle t)
|
||||||
(setq vertico-posframe-width 130)
|
(setq vertico-posframe-width 130)
|
||||||
(setq vertico-posframe-height 30)
|
(setq vertico-posframe-height 30)
|
||||||
(setq vertico-posframe-parameters
|
(setq vertico-posframe-parameters
|
||||||
@ -1332,29 +1355,32 @@ Ace Window will show a hint if there are more than 2 windows, but I don't really
|
|||||||
(left-fringe . 30)
|
(left-fringe . 30)
|
||||||
(right-fringe . 30)))
|
(right-fringe . 30)))
|
||||||
|
|
||||||
(require 'savehist)
|
(require 'savehist)
|
||||||
(savehist-mode)
|
(savehist-mode)
|
||||||
(add-hook 'minibuffer-setup-hook #'vertico-repeat-save)
|
(add-hook 'minibuffer-setup-hook #'vertico-repeat-save)
|
||||||
(add-to-list 'savehist-additional-variables 'vertico-repeat-history)
|
(add-to-list 'savehist-additional-variables 'vertico-repeat-history)
|
||||||
|
|
||||||
(define-key vertico-map (kbd "C-M-n") #'vertico-next-group)
|
(define-key vertico-map (kbd "C-M-n") #'vertico-next-group)
|
||||||
(define-key vertico-map (kbd "s-p") #'vertico-previous)
|
(define-key vertico-map (kbd "s-p") #'vertico-previous)
|
||||||
(define-key vertico-map (kbd "s-n") #'vertico-next)
|
(define-key vertico-map (kbd "s-n") #'vertico-next)
|
||||||
;; #' "C-M-p" #'vertico-previous-group)
|
;; #' "C-M-p" #'vertico-previous-group)
|
||||||
|
|
||||||
|
|
||||||
;; (elpaca 'vertico-directory)
|
;; (elpaca 'vertico-directory)
|
||||||
;; :bind (:map vertico-map
|
;; :bind (:map vertico-map
|
||||||
;; ("RET" . vertico-directory-enter)
|
;; ("RET" . vertico-directory-enter)
|
||||||
;; ("DEL" . vertico-directory-delete-char)
|
;; ("DEL" . vertico-directory-delete-char)
|
||||||
;; ("M-DEL" . vertico-directory-delete-word))
|
;; ("M-DEL" . vertico-directory-delete-word))
|
||||||
;; :hook (rfn-eshadow-update-overlay . vertico-directory-tidy))
|
;; :hook (rfn-eshadow-update-overlay . vertico-directory-tidy))
|
||||||
|
|
||||||
#+end_src
|
#+end_src
|
||||||
*** Embark
|
*** Embark
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(require 'embark)
|
(require 'embark)
|
||||||
|
|
||||||
|
;; TODO Prot
|
||||||
|
;; 1.) Cannot quickly deleete buffers from the mini buffer with emark
|
||||||
|
;; 2.) switch-to-buffer-other-frame is not working
|
||||||
(setq embark-quit-after-action '((kill-buffer . nil)))
|
(setq embark-quit-after-action '((kill-buffer . nil)))
|
||||||
|
|
||||||
(defun embark-which-key-indicator ()
|
(defun embark-which-key-indicator ()
|
||||||
@ -1639,6 +1665,7 @@ startup. Reason we have to call this is so the vterm fucntion can call `vterm--i
|
|||||||
(setq mono-complete-backend-capf-complete-fn #'eglot-completion-at-point)
|
(setq mono-complete-backend-capf-complete-fn #'eglot-completion-at-point)
|
||||||
(setq mono-complete-preview-delay 0.1)
|
(setq mono-complete-preview-delay 0.1)
|
||||||
|
|
||||||
|
;; TODO Prot This setting gets lost when creating a new frame
|
||||||
(add-to-list 'face-remapping-alist '(mono-complete-preview-face . shadow))
|
(add-to-list 'face-remapping-alist '(mono-complete-preview-face . shadow))
|
||||||
(mono-complete-mode +1)
|
(mono-complete-mode +1)
|
||||||
#+end_src
|
#+end_src
|
||||||
|
Loading…
x
Reference in New Issue
Block a user