fix and change bindings and icons

This commit is contained in:
2022-12-29 12:58:01 +01:00
parent d95f45d049
commit 99a0d6a185
7 changed files with 2122 additions and 65 deletions

View File

@@ -30,15 +30,15 @@
:config
(setq amx-save-file (concat user-cache-directory "amx-items")))
;; in an ivy action minibuffer use M-o `ivy-dispatching-done' to see
;; in an ivy action minibuffer use M-o (`ivy-dispatching-done') to see
;; valid actions.
(use-package ivy
:delight (ivy-mode "Ivy") ;; \u24BE i
:defer 0.1
;; Ivy-based interface to standard commands
:bind (("C-s" . swiper)
;; ("C-M-s" . swiper-all)
("C-c C-r" . ivy-resume) ;; resumes the last Ivy-based completion.
("<f6>" . ivy-resume)
("C-c v" . ivy-push-view)
("C-c V" . ivy-pop-view))
:config
@@ -56,8 +56,30 @@
:after (ivy counsel)
:config
(setcdr (assq t ivy-format-functions-alist) #'ivy-format-function-line)
;; overwrite to fix error, see https://github.com/Yevgnen/ivy-rich/issues/115#issuecomment-1336951680
(defun ivy-rich--switch-buffer-directory (candidate)
"Return directory of file visited by buffer named CANDIDATE, or nil if no file."
(let* ((buffer (get-buffer candidate))
(fn (buffer-file-name buffer)))
;; if valid filename, i.e. buffer visiting file:
(if fn
;; return containing directory
;; (directory-file-name fn) ;; REMOVED
(file-name-directory fn) ;; ADDED
;; else if mode explicitly offering list-buffers-directory, return that; else nil.
;; buffers that don't explicitly visit files, but would like to show a filename,
;; e.g. magit or dired, set the list-buffers-directory variable
(buffer-local-value 'list-buffers-directory buffer))))
(require 'all-the-icons-ivy-rich) ;; as suggested load `all-the-icons-ivy-rich-mode' before `ivy-rich-mode'
(ivy-rich-mode 1))
(use-package all-the-icons-ivy-rich
:defer ;; to be able to load it after `ivy-rich'
:if (display-graphic-p)
:config
;; defines also nice display-transformers
(all-the-icons-ivy-rich-mode 1))
(use-package swiper
:after ivy)
@@ -65,15 +87,15 @@
:after ivy
:bind (("M-x" . counsel-M-x)
("M-y" . counsel-yank-pop)
;; ("C-x b" . counsel-switch-buffer)
("C-x b" . counsel-switch-buffer)
;; ("C-x b" . counsel-ibuffer)
("C-x b" . counsel-buffer-or-recentf)
("C-x C-f" . counsel-find-file)
("C-x C-r" . counsel-recentf)
;; ("<f1> f" . describe-function) ;; counsel-describe-function, not set bc of helpful.el
;; ("<f1> v" . describe-variable) ;; counsel-describe-variable, net set bc of helpful.el
("<f1> l" . find-library) ;; find-library works better with counsel as counsel-find-library
("<f2> i" . counsel-info-lookup-symbol)
;; ("C-x C-r" . counsel-recentf)
("C-x C-r" . counsel-buffer-or-recentf)
("C-h f" . counsel-describe-function)
("C-h v" . counsel-describe-variable)
("C-h l" . counsel-find-library)
;; ("<f2> i" . counsel-info-lookup-symbol) ;; info-lookup-symbol see helpful-symbol
("<f2> u" . counsel-unicode-char)
("<f2> j" . counsel-set-variable)
;; Ivy-based interface to shell and system tools