refactor(kbd): Replace my-color-picker with consult-colors-emacs
This commit is contained in:
@@ -68,7 +68,6 @@
|
|||||||
search-ring
|
search-ring
|
||||||
regexp-search-ring
|
regexp-search-ring
|
||||||
extended-command-history)
|
extended-command-history)
|
||||||
savehist-ignored-variables '(consult-notes-history)
|
|
||||||
savehist-autosave-interval 300))
|
savehist-autosave-interval 300))
|
||||||
|
|
||||||
;; saveplace,保存光标位置
|
;; saveplace,保存光标位置
|
||||||
|
|||||||
@@ -35,6 +35,9 @@
|
|||||||
(*is-linux*
|
(*is-linux*
|
||||||
(setq consult-locate-args "plocate --basename --ignore-case")))
|
(setq consult-locate-args "plocate --basename --ignore-case")))
|
||||||
|
|
||||||
|
(define-key consult-narrow-map (vconcat consult-narrow-key "?") #'consult-narrow-help)
|
||||||
|
(setq consult-narrow-key "<")
|
||||||
|
|
||||||
;; set some buffer filter
|
;; set some buffer filter
|
||||||
(setq consult-buffer-filter
|
(setq consult-buffer-filter
|
||||||
(cl-union consult-buffer-filter
|
(cl-union consult-buffer-filter
|
||||||
|
|||||||
@@ -257,18 +257,18 @@ argument)."
|
|||||||
(when-let* ((proj (project-current t)))
|
(when-let* ((proj (project-current t)))
|
||||||
(consult-ripgrep (project-root proj))))
|
(consult-ripgrep (project-root proj))))
|
||||||
|
|
||||||
(defun my-color-picker ()
|
(defun consult-colors-emacs (color)
|
||||||
"Pick a color with preview."
|
"Show a list of all supported colors for a particular frame.
|
||||||
(interactive)
|
|
||||||
(let* ((colors (defined-colors))
|
You can insert the name (default), or insert or kill the hexadecimal or RGB
|
||||||
(choice (completing-read
|
value of the selected COLOR."
|
||||||
"Color: "
|
(interactive
|
||||||
(mapcar (lambda (c)
|
(list (consult--read (list-colors-duplicates (defined-colors))
|
||||||
(propertize
|
:prompt "Emacs color: "
|
||||||
(format "%-20s %s" c "████")
|
:require-match t
|
||||||
'face `(:foreground ,c)))
|
:category 'color
|
||||||
colors))))
|
:history '(:input consult-colors-history))))
|
||||||
(string-trim (car (split-string choice)))))
|
(insert color))
|
||||||
|
|
||||||
(defun fix-theme-colors ()
|
(defun fix-theme-colors ()
|
||||||
"Fix invalid color name in theme files."
|
"Fix invalid color name in theme files."
|
||||||
|
|||||||
@@ -37,7 +37,7 @@
|
|||||||
"R" 'rainbow-mode
|
"R" 'rainbow-mode
|
||||||
"b" 'indent-bars-mode
|
"b" 'indent-bars-mode
|
||||||
"t" 'consult-theme
|
"t" 'consult-theme
|
||||||
"c" 'my-color-picker
|
"c" 'consult-colors-emacs
|
||||||
"f" 'describe-face
|
"f" 'describe-face
|
||||||
"r" 'rainbow-delimiters-mode
|
"r" 'rainbow-delimiters-mode
|
||||||
"k" 'keycast-header-line-mode
|
"k" 'keycast-header-line-mode
|
||||||
|
|||||||
@@ -41,7 +41,6 @@
|
|||||||
search-ring
|
search-ring
|
||||||
regexp-search-ring
|
regexp-search-ring
|
||||||
extended-command-history)
|
extended-command-history)
|
||||||
savehist-ignored-variables '(consult-notes-history)
|
|
||||||
savehist-autosave-interval 300))
|
savehist-autosave-interval 300))
|
||||||
|
|
||||||
(use-package saveplace
|
(use-package saveplace
|
||||||
|
|||||||
Reference in New Issue
Block a user