From 99a0d6a1854e9aac86de2110ef915b15ee11e9a9 Mon Sep 17 00:00:00 2001 From: Daniel Weschke Date: Thu, 29 Dec 2022 12:58:01 +0100 Subject: [PATCH] fix and change bindings and icons --- lisp/all-the-icons-ivy-rich.el | 1937 +++++++++++++++++++++++++++++++ lisp/my/my.el | 12 + settings/completion-settings.el | 40 +- settings/general-settings.el | 47 +- settings/gui-settings.el | 80 +- settings/org-settings.el | 59 +- settings/which-key-settings.el | 12 + 7 files changed, 2122 insertions(+), 65 deletions(-) create mode 100644 lisp/all-the-icons-ivy-rich.el diff --git a/lisp/all-the-icons-ivy-rich.el b/lisp/all-the-icons-ivy-rich.el new file mode 100644 index 00000000..9197954f --- /dev/null +++ b/lisp/all-the-icons-ivy-rich.el @@ -0,0 +1,1937 @@ +;;; all-the-icons-ivy-rich.el --- Better experience with icons for ivy -*- lexical-binding: t; -*- + +;; Copyright (C) 2020 Vincent Zhang + +;; Author: Vincent Zhang +;; Homepage: https://github.com/seagle0128/all-the-icons-ivy-rich +;; Version: 1.8.1 +;; Package-Version: 20221202.1336 +;; Package-Commit: c5839098664104ade4dfcefa0ba716215c4f7812 +;; Package-Requires: ((emacs "25.1") (ivy-rich "0.1.0") (all-the-icons "2.2.0")) +;; Keywords: convenience, icons, ivy + +;; This file is not part of GNU Emacs. + +;; +;; This program is free software; you can redistribute it and/or +;; modify it under the terms of the GNU General Public License as +;; published by the Free Software Foundation; either version 3, or +;; (at your option) any later version. +;; +;; This program is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +;; General Public License for more details. +;; +;; You should have received a copy of the GNU General Public License +;; along with this program; see the file COPYING. If not, write to +;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth +;; Floor, Boston, MA 02110-1301, USA. +;; + +;;; Commentary: + +;; Better experience with icons for ivy. +;; +;; Install: +;; From melpa, `M-x package-install RET all-the-icons-ivy-rich RET`. +;; (all-the-icons-ivy-rich-mode 1) +;; or +;; (use-package all-the-icons-ivy-rich-mode +;; :ensure t +;; :init (all-the-icons-ivy-rich-mode 1)) + + +;;; Code: + +(eval-when-compile + (require 'subr-x) + (require 'package) + (require 'bookmark) + (require 'project)) + +(require 'ivy-rich) +(require 'all-the-icons) + + + +;; Suppress warnings +(defvar counsel--fzf-dir) +(defvar ivy--directory) +(defvar ivy-last) +(defvar ivy-posframe-buffer) + +(declare-function bookmark-get-front-context-string "bookmark") +(declare-function counsel-world-clock--local-time "ext:counsel-world-clock") +(declare-function find-library-name "find-func") +(declare-function ivy-posframe--display "ext:ivy-posframe") +(declare-function package--from-builtin "package") +(declare-function package-desc-status "package") +(declare-function projectile-project-root "ext:projectile") + +;; Compatibility +(unless (fboundp #'file-attribute-user-id) + (defsubst file-attribute-user-id (attributes) + (nth 2 attributes))) + +(unless (fboundp #'file-attribute-group-id) + (defsubst file-attribute-group-id (attributes) + (nth 3 attributes))) + +(unless (fboundp #'file-attribute-modification-time) + (defsubst file-attribute-modification-time (attributes) + (nth 5 attributes))) + +(unless (fboundp #'file-attribute-size) + (defsubst file-attribute-size (attributes) + (nth 7 attributes))) + +(unless (fboundp #'file-attribute-modes) + (defsubst file-attribute-modes (attributes) + (nth 8 attributes))) + + +;; +;; Faces +;; + +(defgroup all-the-icons-ivy-rich nil + "Better experience using icons in ivy." + :group 'all-the-icons + :group 'ivy-rich + :link '(url-link :tag "Homepage" "https://github.com/seagle0128/all-the-icons-ivy-rich")) + +(defface all-the-icons-ivy-rich-on-face + '((t :inherit success)) + "Face used to signal enabled modes.") + +(defface all-the-icons-ivy-rich-off-face + '((t :inherit shadow)) + "Face used to signal disabled modes.") + +(defface all-the-icons-ivy-rich-error-face + '((t :inherit error)) + "Face used to signal disabled modes.") + +(defface all-the-icons-ivy-rich-warn-face + '((t :inherit warning)) + "Face used to signal disabled modes.") + +(defface all-the-icons-ivy-rich-icon-face + '((t (:inherit default))) + "Face used for the icons while `all-the-icons-ivy-rich-color-icon' is nil." + :group 'all-the-icons-ivy-rich) + +(defface all-the-icons-ivy-rich-dir-face + '((t (:inherit font-lock-doc-face))) + "Face used for the directory icon." + :group 'all-the-icons-ivy-rich) + +(defface all-the-icons-ivy-rich-doc-face + '((t (:inherit ivy-completions-annotations))) + "Face used for documentation string." + :group 'all-the-icons-ivy-rich) + +(defface all-the-icons-ivy-rich-size-face + '((t (:inherit shadow))) + "Face used for buffer size." + :group 'all-the-icons-ivy-rich) + +(defface all-the-icons-ivy-rich-time-face + '((t (:inherit shadow))) + "Face used for time." + :group 'all-the-icons-ivy-rich) + +(defface all-the-icons-ivy-rich-bookmark-face + '((t (:inherit all-the-icons-ivy-rich-doc-face))) + "Face used for time." + :group 'all-the-icons-ivy-rich) + +(defface all-the-icons-ivy-rich-version-face + '((t (:inherit font-lock-constant-face))) + "Face used for package version." + :group 'all-the-icons-ivy-rich) + +(defface all-the-icons-ivy-rich-archive-face + '((t (:inherit font-lock-doc-face))) + "Face used for package archive." + :group 'all-the-icons-ivy-rich) + +(defface all-the-icons-ivy-rich-package-status-avaible-face + '((t (:inherit all-the-icons-ivy-rich-on-face))) + "Face used for package status." + :group 'all-the-icons-ivy-rich) + +(defface all-the-icons-ivy-rich-package-status-new-face + '((t (:inherit (all-the-icons-ivy-rich-on-face bold)))) + "Face used for package status." + :group 'all-the-icons-ivy-rich) + +(defface all-the-icons-ivy-rich-package-status-held-face + '((t (:inherit font-lock-constant-face))) + "Face used for package status." + :group 'all-the-icons-ivy-rich) + +(defface all-the-icons-ivy-rich-package-status-installed-face + '((t (:inherit all-the-icons-ivy-rich-off-face))) + "Face used for package status." + :group 'all-the-icons-ivy-rich) + +(defface all-the-icons-ivy-rich-package-status-warn-face + '((t (:inherit all-the-icons-ivy-rich-warn-face))) + "Face used for package status." + :group 'all-the-icons-ivy-rich) + +(defface all-the-icons-ivy-rich-pacage-desc-face + '((t (:inherit all-the-icons-ivy-rich-doc-face))) + "Face used for package description." + :group 'all-the-icons-ivy-rich) + +(defface all-the-icons-ivy-rich-path-face + '((t (:inherit all-the-icons-ivy-rich-doc-face))) + "Face used for file path." + :group 'all-the-icons-ivy-rich) + +(defface all-the-icons-ivy-rich-indicator-face + '((t (:inherit all-the-icons-ivy-rich-error-face))) + "Face used for file indicators." + :group 'all-the-icons-ivy-rich) + +(defface all-the-icons-ivy-rich-major-mode-face + '((t (:inherit font-lock-keyword-face))) + "Face used for buffer major mode." + :group 'all-the-icons-ivy-rich) + +(defface all-the-icons-ivy-rich-project-face + '((t (:inherit font-lock-string-face))) + "Face used for project." + :group 'all-the-icons-ivy-rich) + +(defface all-the-icons-ivy-rich-persp-face + '((t (:inherit font-lock-string-face))) + "Face used for persp." + :group 'all-the-icons-ivy-rich) + +(defface all-the-icons-ivy-rich-file-name-face + '((t :inherit all-the-icons-ivy-rich-doc-face)) + "Face used for highlight file names.") + +(defface all-the-icons-ivy-rich-file-priv-no + '((t :inherit shadow)) + "Face used to highlight the no file privilege attribute.") + +(defface all-the-icons-ivy-rich-file-priv-dir + '((t :inherit font-lock-keyword-face)) + "Face used to highlight the dir file privilege attribute.") + +(defface all-the-icons-ivy-rich-file-priv-link + '((t :inherit font-lock-keyword-face)) + "Face used to highlight the link file privilege attribute.") + +(defface all-the-icons-ivy-rich-file-priv-read + '((t :inherit font-lock-type-face)) + "Face used to highlight the read file privilege attribute.") + +(defface all-the-icons-ivy-rich-file-priv-write + '((t :inherit font-lock-builtin-face)) + "Face used to highlight the write file privilege attribute.") + +(defface all-the-icons-ivy-rich-file-priv-exec + '((t :inherit font-lock-function-name-face)) + "Face used to highlight the exec file privilege attribute.") + +(defface all-the-icons-ivy-rich-file-priv-other + '((t :inherit font-lock-constant-face)) + "Face used to highlight some other file privilege attribute.") + +(defface all-the-icons-ivy-rich-file-priv-rare + '((t :inherit font-lock-variable-name-face)) + "Face used to highlight a rare file privilege attribute.") + +(defface all-the-icons-ivy-rich-file-owner-face + '((t :inherit font-lock-keyword-face)) + "Face used for highlight file owners.") + +(defface all-the-icons-ivy-rich-process-id-face + '((t :inherit default)) + "Face used for process id.") + +(defface all-the-icons-ivy-rich-process-status-face + '((t :inherit success)) + "Face used for process status.") + +(defface all-the-icons-ivy-rich-process-status-alt-face + '((t :inherit all-the-icons-ivy-rich-error-face)) + "Face used for process status: stop, exit, closed and failed.") + +(defface all-the-icons-ivy-rich-process-buffer-face + '((t :inherit font-lock-keyword-face)) + "Face used for process buffer label.") + +(defface all-the-icons-ivy-rich-process-tty-face + '((t :inherit font-lock-doc-face)) + "Face used for process tty.") + +(defface all-the-icons-ivy-rich-process-thread-face + '((t :inherit font-lock-doc-face)) + "Face used for process thread.") + +(defface all-the-icons-ivy-rich-process-command-face + '((t :inherit all-the-icons-ivy-rich-doc-face)) + "Face used for process command.") + +(defface all-the-icons-ivy-rich-type-face + '((t :inherit font-lock-keyword-face)) + "Face used for type.") + +(defface all-the-icons-ivy-rich-value-face + '((t :inherit font-lock-keyword-face)) + "Face used for variable value.") + +(defface all-the-icons-ivy-rich-true-face + '((t :inherit font-lock-builtin-face)) + "Face used to highlight true variable values.") + +(defface all-the-icons-ivy-rich-null-face + '((t :inherit font-lock-comment-face)) + "Face used to highlight null or unbound variable values.") + +(defface all-the-icons-ivy-rich-list-face + '((t :inherit font-lock-constant-face)) + "Face used to highlight list expressions.") + +(defface all-the-icons-ivy-rich-number-face + '((t :inherit font-lock-constant-face)) + "Face used to highlight numeric values.") + +(defface all-the-icons-ivy-rich-string-face + '((t :inherit font-lock-string-face)) + "Face used to highlight string values.") + +(defface all-the-icons-ivy-rich-function-face + '((t :inherit font-lock-function-name-face)) + "Face used to highlight function symbols.") + +(defface all-the-icons-ivy-rich-symbol-face + '((t :inherit font-lock-type-face)) + "Face used to highlight general symbols.") + +(defface all-the-icons-ivy-rich-imenu-type-face + '((t (:inherit all-the-icons-ivy-rich-type-face :height 0.9))) + "Face used for imenu type." + :group 'all-the-icons-ivy-rich) + +(defface all-the-icons-ivy-rich-imenu-doc-face + '((t (:inherit all-the-icons-ivy-rich-doc-face :height 0.9))) + "Face used for imenu documentation." + :group 'all-the-icons-ivy-rich) + +;; +;; Customization +;; + +(defcustom all-the-icons-ivy-rich-icon t + "Whether display the icons." + :group 'all-the-icons-ivy-rich + :type 'boolean) + +(defcustom all-the-icons-ivy-rich-color-icon t + "Whether display the colorful icons. + +It respects `all-the-icons-color-icons'." + :group 'all-the-icons-ivy-rich + :type 'boolean) + +(defcustom all-the-icons-ivy-rich-icon-size 1.0 + "The default icon size in ivy." + :group 'all-the-icons-ivy-rich + :type 'float) + +(defcustom all-the-icons-ivy-rich-project t + "Whether support project root." + :group 'all-the-icons-ivy-rich + :type 'boolean) + +(defcustom all-the-icons-ivy-rich-field-width 80 + "Maximum truncation width of annotation fields. + +This value is adjusted depending on the `window-width'." + :group 'all-the-icons-ivy-rich + :type 'integer) + +(defcustom all-the-icons-ivy-rich-display-transformers-list + '(ivy-switch-buffer + (:columns + ((all-the-icons-ivy-rich-buffer-icon) + (ivy-switch-buffer-transformer (:width 0.3)) + (ivy-rich-switch-buffer-size (:width 7 :face all-the-icons-ivy-rich-size-face)) + (ivy-rich-switch-buffer-indicators (:width 4 :face all-the-icons-ivy-rich-indicator-face :align right)) + (all-the-icons-ivy-rich-switch-buffer-major-mode (:width 18 :face all-the-icons-ivy-rich-major-mode-face)) + (ivy-rich-switch-buffer-project (:width 0.12 :face all-the-icons-ivy-rich-project-face)) + (ivy-rich-switch-buffer-path (:width (lambda (x) (ivy-rich-switch-buffer-shorten-path x (ivy-rich-minibuffer-width 0.3))) :face all-the-icons-ivy-rich-path-face))) + :predicate + (lambda (cand) (get-buffer cand)) + :delimiter "\t") + ivy-switch-buffer-other-window + (:columns + ((all-the-icons-ivy-rich-buffer-icon) + (ivy-switch-buffer-transformer (:width 0.3)) + (ivy-rich-switch-buffer-size (:width 7 :face all-the-icons-ivy-rich-size-face)) + (ivy-rich-switch-buffer-indicators (:width 4 :face all-the-icons-ivy-rich-indicator-face :align right)) + (all-the-icons-ivy-rich-switch-buffer-major-mode (:width 18 :face all-the-icons-ivy-rich-major-mode-face)) + (ivy-rich-switch-buffer-project (:width 0.12 :face all-the-icons-ivy-rich-project-face)) + (ivy-rich-switch-buffer-path (:width (lambda (x) (ivy-rich-switch-buffer-shorten-path x (ivy-rich-minibuffer-width 0.3))) :face all-the-icons-ivy-rich-path-face))) + :predicate + (lambda (cand) (get-buffer cand)) + :delimiter "\t") + + ;; counsel + counsel-switch-buffer + (:columns + ((all-the-icons-ivy-rich-buffer-icon) + (ivy-switch-buffer-transformer (:width 0.3)) + (ivy-rich-switch-buffer-size (:width 7 :face all-the-icons-ivy-rich-size-face)) + (ivy-rich-switch-buffer-indicators (:width 4 :face all-the-icons-ivy-rich-indicator-face :align right)) + (all-the-icons-ivy-rich-switch-buffer-major-mode (:width 18 :face all-the-icons-ivy-rich-major-mode-face)) + (ivy-rich-switch-buffer-project (:width 0.12 :face all-the-icons-ivy-rich-project-face)) + (ivy-rich-switch-buffer-path (:width (lambda (x) (ivy-rich-switch-buffer-shorten-path x (ivy-rich-minibuffer-width 0.3))) :face all-the-icons-ivy-rich-path-face))) + :predicate + (lambda (cand) (get-buffer cand)) + :delimiter "\t") + counsel-switch-buffer-other-window + (:columns + ((all-the-icons-ivy-rich-buffer-icon) + (ivy-switch-buffer-transformer (:width 0.3)) + (ivy-rich-switch-buffer-size (:width 7 :face all-the-icons-ivy-rich-size-face)) + (ivy-rich-switch-buffer-indicators (:width 4 :face all-the-icons-ivy-rich-indicator-face :align right)) + (all-the-icons-ivy-rich-switch-buffer-major-mode (:width 18 :face all-the-icons-ivy-rich-major-mode-face)) + (ivy-rich-switch-buffer-project (:width 0.12 :face all-the-icons-ivy-rich-project-face)) + (ivy-rich-switch-buffer-path (:width (lambda (x) (ivy-rich-switch-buffer-shorten-path x (ivy-rich-minibuffer-width 0.3))) :face all-the-icons-ivy-rich-path-face))) + :predicate + (lambda (cand) (get-buffer cand)) + :delimiter "\t") + counsel-M-x + (:columns + ((all-the-icons-ivy-rich-function-icon) + (counsel-M-x-transformer (:width 0.3)) + (ivy-rich-counsel-function-docstring (:face all-the-icons-ivy-rich-doc-face)))) + counsel-describe-function + (:columns + ((all-the-icons-ivy-rich-function-icon) + (counsel-describe-function-transformer (:width 0.3)) + (all-the-icons-ivy-rich-symbol-class (:width 8 :face all-the-icons-ivy-rich-type-face)) + (all-the-icons-ivy-rich-function-args (:width 0.12 :face all-the-icons-ivy-rich-value-face)) + (ivy-rich-counsel-function-docstring (:face all-the-icons-ivy-rich-doc-face)))) + counsel-describe-variable + (:columns + ((all-the-icons-ivy-rich-variable-icon) + (counsel-describe-variable-transformer (:width 0.3)) + (all-the-icons-ivy-rich-symbol-class (:width 8 :face all-the-icons-ivy-rich-type-face)) + (all-the-icons-ivy-rich-variable-value (:width 0.12)) + (ivy-rich-counsel-variable-docstring (:face all-the-icons-ivy-rich-doc-face)))) + counsel-describe-symbol + (:columns + ((all-the-icons-ivy-rich-symbol-icon) + (ivy-rich-candidate (:width 0.3)) + (all-the-icons-ivy-rich-symbol-class (:width 8 :face all-the-icons-ivy-rich-type-face)) + (all-the-icons-ivy-rich-symbol-docstring (:face all-the-icons-ivy-rich-doc-face))) + :delimiter "\t") + counsel-set-variable + (:columns + ((all-the-icons-ivy-rich-variable-icon) + (counsel-describe-variable-transformer (:width 0.3)) + (all-the-icons-ivy-rich-symbol-class (:width 8 :face all-the-icons-ivy-rich-type-face)) + (all-the-icons-ivy-rich-variable-value (:width 0.12)) + (ivy-rich-counsel-variable-docstring (:face all-the-icons-ivy-rich-doc-face)))) + counsel-apropos + (:columns + ((all-the-icons-ivy-rich-symbol-icon) + (ivy-rich-candidate (:width 0.3)) + (all-the-icons-ivy-rich-symbol-class (:width 8 :face all-the-icons-ivy-rich-type-face)) + (all-the-icons-ivy-rich-symbol-docstring (:face all-the-icons-ivy-rich-doc-face))) + :delimiter "\t") + counsel-info-lookup-symbol + (:columns + ((all-the-icons-ivy-rich-symbol-icon) + (ivy-rich-candidate (:width 0.3)) + (all-the-icons-ivy-rich-symbol-class (:width 8 :face all-the-icons-ivy-rich-type-face)) + (all-the-icons-ivy-rich-symbol-docstring (:face all-the-icons-ivy-rich-doc-face))) + :delimiter "\t") + counsel-descbinds + (:columns + ((all-the-icons-ivy-rich-keybinding-icon) + (ivy-rich-candidate (:width 0.3)) + (all-the-icons-ivy-rich-keybinding-docstring (:face all-the-icons-ivy-rich-doc-face))) + :delimiter "\t") + counsel-find-file + (:columns + ((all-the-icons-ivy-rich-file-icon) + (all-the-icons-ivy-rich-file-name (:width 0.4)) + (all-the-icons-ivy-rich-file-id (:width 15 :face all-the-icons-ivy-rich-file-owner-face :align right)) + (all-the-icons-ivy-rich-file-modes (:width 12)) + (all-the-icons-ivy-rich-file-size (:width 7 :face all-the-icons-ivy-rich-size-face)) + (all-the-icons-ivy-rich-file-modification-time (:face all-the-icons-ivy-rich-time-face))) + :delimiter "\t") + counsel-file-jump + (:columns + ((all-the-icons-ivy-rich-file-icon) + (all-the-icons-ivy-rich-file-name (:width 0.4)) + (all-the-icons-ivy-rich-file-id (:width 15 :face all-the-icons-ivy-rich-file-owner-face :align right)) + (all-the-icons-ivy-rich-file-modes (:width 12)) + (all-the-icons-ivy-rich-file-size (:width 7 :face all-the-icons-ivy-rich-size-face)) + (all-the-icons-ivy-rich-file-modification-time (:face all-the-icons-ivy-rich-time-face))) + :delimiter "\t") + counsel-dired + (:columns + ((all-the-icons-ivy-rich-file-icon) + (all-the-icons-ivy-rich-file-name (:width 0.4)) + (all-the-icons-ivy-rich-file-id (:width 15 :face all-the-icons-ivy-rich-file-owner-face :align right)) + (all-the-icons-ivy-rich-file-modes (:width 12)) + (all-the-icons-ivy-rich-file-size (:width 7 :face all-the-icons-ivy-rich-size-face)) + (all-the-icons-ivy-rich-file-modification-time (:face all-the-icons-ivy-rich-time-face))) + :delimiter "\t") + counsel-dired-jump + (:columns + ((all-the-icons-ivy-rich-file-icon) + (all-the-icons-ivy-rich-file-name (:width 0.4)) + (all-the-icons-ivy-rich-file-id (:width 15 :face all-the-icons-ivy-rich-file-owner-face :align right)) + (all-the-icons-ivy-rich-file-modes (:width 12)) + (all-the-icons-ivy-rich-file-size (:width 7 :face all-the-icons-ivy-rich-size-face)) + (all-the-icons-ivy-rich-file-modification-time (:face all-the-icons-ivy-rich-time-face))) + :delimiter "\t") + counsel-fzf + (:columns + ((all-the-icons-ivy-rich-file-icon) + (all-the-icons-ivy-rich-file-name (:width 0.4)) + (all-the-icons-ivy-rich-file-id (:width 15 :face all-the-icons-ivy-rich-file-owner-face :align right)) + (all-the-icons-ivy-rich-file-modes (:width 12)) + (all-the-icons-ivy-rich-file-size (:width 7 :face all-the-icons-ivy-rich-size-face)) + (all-the-icons-ivy-rich-file-modification-time (:face all-the-icons-ivy-rich-time-face))) + :delimiter "\t") + counsel-git + (:columns + ((all-the-icons-ivy-rich-file-icon) + (all-the-icons-ivy-rich-file-name (:width 0.4)) + (all-the-icons-ivy-rich-file-id (:width 15 :face all-the-icons-ivy-rich-file-owner-face :align right)) + (all-the-icons-ivy-rich-file-modes (:width 12)) + (all-the-icons-ivy-rich-file-size (:width 7 :face all-the-icons-ivy-rich-size-face)) + (all-the-icons-ivy-rich-file-modification-time (:face all-the-icons-ivy-rich-time-face))) + :delimiter "\t") + counsel-recentf + (:columns + ((all-the-icons-ivy-rich-file-icon) + (all-the-icons-ivy-rich-file-name (:width 0.5)) + (all-the-icons-ivy-rich-file-id (:width 15 :face all-the-icons-ivy-rich-file-owner-face :align right)) + (all-the-icons-ivy-rich-file-modes (:width 12)) + (all-the-icons-ivy-rich-file-size (:width 7 :face all-the-icons-ivy-rich-size-face)) + (ivy-rich-file-last-modified-time (:face all-the-icons-ivy-rich-time-face))) + :delimiter "\t") + counsel-buffer-or-recentf + (:columns + ((all-the-icons-ivy-rich-file-icon) + (counsel-buffer-or-recentf-transformer (:width 0.5)) + (all-the-icons-ivy-rich-file-id (:width 15 :face all-the-icons-ivy-rich-file-owner-face :align right)) + (all-the-icons-ivy-rich-file-modes (:width 12)) + (all-the-icons-ivy-rich-file-size (:width 7 :face all-the-icons-ivy-rich-size-face)) + (ivy-rich-file-last-modified-time (:face all-the-icons-ivy-rich-time-face))) + :delimiter "\t") + counsel-bookmark + (:columns + ((all-the-icons-ivy-rich-bookmark-icon) + (all-the-icons-ivy-rich-bookmark-name (:width 0.25)) + (ivy-rich-bookmark-type (:width 10)) + (all-the-icons-ivy-rich-bookmark-filename (:width 0.3 :face all-the-icons-ivy-rich-bookmark-face)) + (all-the-icons-ivy-rich-bookmark-context (:face all-the-icons-ivy-rich-doc-face))) + :delimiter "\t") + counsel-bookmarked-directory + (:columns + ((all-the-icons-ivy-rich-file-icon) + (ivy-rich-candidate)) + :delimiter "\t") + counsel-package + (:columns + ((all-the-icons-ivy-rich-package-icon) + (ivy-rich-candidate (:width 0.25)) + (all-the-icons-ivy-rich-package-version (:width 16 :face all-the-icons-ivy-rich-version-face)) + (all-the-icons-ivy-rich-package-status (:width 12)) + (all-the-icons-ivy-rich-package-archive-summary (:width 7 :face all-the-icons-ivy-rich-archive-face)) + (all-the-icons-ivy-rich-package-install-summary (:face all-the-icons-ivy-rich-pacage-desc-face))) + :delimiter "\t") + counsel-fonts + (:columns + ((all-the-icons-ivy-rich-font-icon) + (ivy-rich-candidate)) + :delimiter "\t") + counsel-major + (:columns + ((all-the-icons-ivy-rich-mode-icon) + (counsel-describe-function-transformer (:width 0.3)) + (ivy-rich-counsel-function-docstring (:face all-the-icons-ivy-rich-doc-face)))) + counsel-minor + (:columns + ((all-the-icons-ivy-rich-mode-icon) + (ivy-rich-candidate)) + :delimiter "\t") + counsel-find-library + (:columns + ((all-the-icons-ivy-rich-library-icon) + (all-the-icons-ivy-rich-library-transformer (:width 0.3)) + (all-the-icons-ivy-rich-library-path (:face all-the-icons-ivy-rich-path-face))) + :delimiter "\t") + counsel-load-library + (:columns + ((all-the-icons-ivy-rich-library-icon) + (all-the-icons-ivy-rich-library-transformer (:width 0.3)) + (all-the-icons-ivy-rich-library-path (:face all-the-icons-ivy-rich-path-face))) + :delimiter "\t") + counsel-load-theme + (:columns + ((all-the-icons-ivy-rich-theme-icon) + (ivy-rich-candidate)) + :delimiter "\t") + counsel-world-clock + (:columns + ((all-the-icons-ivy-rich-world-clock-icon) + (ivy-rich-candidate (:width 0.3)) + (all-the-icons-ivy-rich-world-clock (:face all-the-icons-ivy-rich-time-face))) + :delimiter "\t") + counsel-tramp + (:columns + ((all-the-icons-ivy-rich-tramp-icon) + (ivy-rich-candidate)) + :delimiter "\t") + counsel-git-checkout + (:columns + ((all-the-icons-ivy-rich-git-branch-icon) + (ivy-rich-candidate)) + :delimiter "\t") + counsel-list-processes + (:columns + ((all-the-icons-ivy-rich-process-icon) + (ivy-rich-candidate (:width 25)) + (all-the-icons-ivy-rich-process-id (:width 7 :face all-the-icons-ivy-rich-process-id-face)) + (all-the-icons-ivy-rich-process-status (:width 7)) + (all-the-icons-ivy-rich-process-buffer-name (:width 25 :face all-the-icons-ivy-rich-process-buffer-face)) + (all-the-icons-ivy-rich-process-tty-name (:width 12 :face all-the-icons-ivy-rich-process-tty-face)) + (all-the-icons-ivy-rich-process-thread (:width 12 :face all-the-icons-ivy-rich-process-thread-face)) + (all-the-icons-ivy-rich-process-command (:face all-the-icons-ivy-rich-process-command-face))) + :delimiter "\t") + counsel-projectile-switch-project + (:columns + ((all-the-icons-ivy-rich-file-icon) + (all-the-icons-ivy-rich-project-name (:width 0.4)) + (all-the-icons-ivy-rich-project-file-id (:width 15 :face all-the-icons-ivy-rich-file-owner-face :align right)) + (all-the-icons-ivy-rich-project-file-modes (:width 12)) + (all-the-icons-ivy-rich-project-file-size (:width 7 :face all-the-icons-ivy-rich-size-face)) + (all-the-icons-ivy-rich-project-file-modification-time (:face all-the-icons-ivy-rich-time-face))) + :delimiter "\t") + counsel-projectile-switch-to-buffer + (:columns + ((counsel-projectile-switch-to-buffer-transformer)) + :predicate + (lambda (cand) (get-buffer cand)) + :delimiter "\t") + counsel-projectile-find-file + (:columns + ((all-the-icons-ivy-rich-file-icon) + (counsel-projectile-find-file-transformer (:width 0.4)) + (all-the-icons-ivy-rich-project-file-id (:width 15 :face all-the-icons-ivy-rich-file-owner-face :align right)) + (all-the-icons-ivy-rich-project-file-modes (:width 12)) + (all-the-icons-ivy-rich-project-file-size (:width 7 :face all-the-icons-ivy-rich-size-face)) + (all-the-icons-ivy-rich-project-file-modification-time (:face all-the-icons-ivy-rich-time-face))) + :delimiter "\t") + counsel-projectile-find-dir + (:columns + ((all-the-icons-ivy-rich-file-icon) + (counsel-projectile-find-dir-transformer (:width 0.4)) + (all-the-icons-ivy-rich-project-file-id (:width 15 :face all-the-icons-ivy-rich-file-owner-face :align right)) + (all-the-icons-ivy-rich-project-file-modes (:width 12)) + (all-the-icons-ivy-rich-project-file-size (:width 7 :face all-the-icons-ivy-rich-size-face)) + (all-the-icons-ivy-rich-project-file-modification-time (:face all-the-icons-ivy-rich-time-face))) + :delimiter "\t") + counsel-imenu + (:columns + ((all-the-icons-ivy-rich-imenu-icon) + (ivy-rich-candidate) + (all-the-icons-ivy-rich-imenu-class (:face all-the-icons-ivy-rich-imenu-type-face)) + (all-the-icons-ivy-rich-imenu-docstring (:face all-the-icons-ivy-rich-imenu-doc-face))) + :delimiter "\t") + counsel-company + (:columns + ((all-the-icons-ivy-rich-company-icon) + (ivy-rich-candidate)) + :delimiter "\t") + counsel-command-history + (:columns + ((all-the-icons-ivy-rich-command-icon) + (ivy-rich-candidate)) + :delimiter "\t") + counsel-minibuffer-history + (:columns + ((all-the-icons-ivy-rich-history-icon) + (ivy-rich-candidate)) + :delimiter "\t") + counsel-read-directory-name + (:columns + ((all-the-icons-ivy-rich-dir-icon) + (all-the-icons-ivy-rich-project-name)) + :delimiter "\t") + counsel-rpm + (:columns + ((all-the-icons-ivy-rich-package-icon) + (ivy-rich-candidate)) + :delimiter "\t") + counsel-dpkg + (:columns + ((all-the-icons-ivy-rich-package-icon) + (ivy-rich-candidate)) + :delimiter "\t") + + counsel-ack + (:columns + ((all-the-icons-ivy-rich-grep-file-icon) + (all-the-icons-ivy-rich-grep-transformer)) + :delimiter "\t") + counsel-ag + (:columns + ((all-the-icons-ivy-rich-grep-file-icon) + (all-the-icons-ivy-rich-grep-transformer)) + :delimiter "\t") + counsel-pt + (:columns + ((all-the-icons-ivy-rich-grep-file-icon) + (all-the-icons-ivy-rich-grep-transformer)) + :delimiter "\t") + counsel-rg + (:columns + ((all-the-icons-ivy-rich-grep-file-icon) + (all-the-icons-ivy-rich-grep-transformer)) + :delimiter "\t") + + ;; Execute command + execute-extended-command + (:columns + ((all-the-icons-ivy-rich-function-icon) + (counsel-M-x-transformer (:width 0.3)) + (ivy-rich-counsel-function-docstring (:face all-the-icons-ivy-rich-doc-face)))) + execute-extended-command-for-buffer + (:columns + ((all-the-icons-ivy-rich-function-icon) + (counsel-M-x-transformer (:width 0.3)) + (ivy-rich-counsel-function-docstring (:face all-the-icons-ivy-rich-doc-face)))) + + ;; projectile + projectile-completing-read + (:columns + ((all-the-icons-ivy-rich-file-icon) + (all-the-icons-ivy-rich-project-find-file-transformer (:width 0.4)) + (all-the-icons-ivy-rich-project-file-id (:width 15 :face all-the-icons-ivy-rich-file-owner-face :align right)) + (all-the-icons-ivy-rich-project-file-modes (:width 12)) + (all-the-icons-ivy-rich-project-file-size (:width 7 :face all-the-icons-ivy-rich-size-face)) + (all-the-icons-ivy-rich-project-file-modification-time (:face all-the-icons-ivy-rich-time-face))) + :delimiter "\t") + + ;; project + project-execute-extended-command + (:columns + ((all-the-icons-ivy-rich-function-icon) + (counsel-M-x-transformer (:width 0.3)) + (ivy-rich-counsel-function-docstring (:face all-the-icons-ivy-rich-doc-face)))) + + project-switch-project + (:columns + ((all-the-icons-ivy-rich-file-icon) + (all-the-icons-ivy-rich-project-name (:width 0.4)) + (all-the-icons-ivy-rich-project-file-id (:width 15 :face all-the-icons-ivy-rich-file-owner-face :align right)) + (all-the-icons-ivy-rich-project-file-modes (:width 12)) + (all-the-icons-ivy-rich-project-file-size (:width 7 :face all-the-icons-ivy-rich-size-face)) + (all-the-icons-ivy-rich-project-file-modification-time (:face all-the-icons-ivy-rich-time-face))) + :delimiter "\t") + project-find-file + (:columns + ((all-the-icons-ivy-rich-file-icon) + (all-the-icons-ivy-rich-project-find-file-transformer (:width 0.4)) + (all-the-icons-ivy-rich-project-file-id (:width 15 :face all-the-icons-ivy-rich-file-owner-face :align right)) + (all-the-icons-ivy-rich-project-file-modes (:width 12)) + (all-the-icons-ivy-rich-project-file-size (:width 7 :face all-the-icons-ivy-rich-size-face)) + (all-the-icons-ivy-rich-project-file-modification-time (:face all-the-icons-ivy-rich-time-face))) + :delimiter "\t") + project-or-external-find-file + (:columns + ((all-the-icons-ivy-rich-file-icon) + (all-the-icons-ivy-rich-project-find-file-transformer (:width 0.4)) + (all-the-icons-ivy-rich-project-file-id (:width 15 :face all-the-icons-ivy-rich-file-owner-face :align right)) + (all-the-icons-ivy-rich-project-file-modes (:width 12)) + (all-the-icons-ivy-rich-project-file-size (:width 7 :face all-the-icons-ivy-rich-size-face)) + (all-the-icons-ivy-rich-project-file-modification-time (:face all-the-icons-ivy-rich-time-face))) + :delimiter "\t") + project-dired + (:columns + ((all-the-icons-ivy-rich-file-icon) + (all-the-icons-ivy-rich-project-name (:width 0.4)) + (all-the-icons-ivy-rich-project-file-id (:width 15 :face all-the-icons-ivy-rich-file-owner-face :align right)) + (all-the-icons-ivy-rich-project-file-modes (:width 12)) + (all-the-icons-ivy-rich-project-file-size (:width 7 :face all-the-icons-ivy-rich-size-face)) + (all-the-icons-ivy-rich-project-file-modification-time (:face all-the-icons-ivy-rich-time-face))) + :delimiter "\t") + project-vc-dir + (:columns + ((all-the-icons-ivy-rich-file-icon) + (all-the-icons-ivy-rich-project-name (:width 0.4)) + (all-the-icons-ivy-rich-project-file-id (:width 15 :face all-the-icons-ivy-rich-file-owner-face :align right)) + (all-the-icons-ivy-rich-project-file-modes (:width 12)) + (all-the-icons-ivy-rich-project-file-size (:width 7 :face all-the-icons-ivy-rich-size-face)) + (all-the-icons-ivy-rich-project-file-modification-time (:face all-the-icons-ivy-rich-time-face))) + :delimiter "\t") + project-find-regexp + (:columns + ((all-the-icons-ivy-rich-grep-file-icon) + (all-the-icons-ivy-rich-grep-transformer)) + :delimiter "\t") + + ;; package + package-install + (:columns + ((all-the-icons-ivy-rich-package-icon) + (ivy-rich-candidate (:width 0.25)) + (all-the-icons-ivy-rich-package-version (:width 16 :face all-the-icons-ivy-rich-version-face)) + (all-the-icons-ivy-rich-package-status (:width 12)) + (all-the-icons-ivy-rich-package-archive-summary (:width 7 :face all-the-icons-ivy-rich-archive-face)) + (all-the-icons-ivy-rich-package-install-summary (:face all-the-icons-ivy-rich-pacage-desc-face))) + :delimiter "\t") + package-reinstall + (:columns + ((all-the-icons-ivy-rich-package-icon) + (ivy-rich-candidate (:width 0.25)) + (all-the-icons-ivy-rich-package-version (:width 16 :face all-the-icons-ivy-rich-version-face)) + (all-the-icons-ivy-rich-package-status (:width 12)) + (all-the-icons-ivy-rich-package-archive-summary (:width 7 :face all-the-icons-ivy-rich-archive-face)) + (all-the-icons-ivy-rich-package-install-summary (:face all-the-icons-ivy-rich-pacage-desc-face))) + :delimiter "\t") + package-delete + (:columns + ((all-the-icons-ivy-rich-package-icon) + (all-the-icons-ivy-rich-package-name (:width 0.25)) + (all-the-icons-ivy-rich-package-version (:width 16 :face all-the-icons-ivy-rich-version-face)) + (all-the-icons-ivy-rich-package-status (:width 12)) + (all-the-icons-ivy-rich-package-archive-summary (:width 7 :face all-the-icons-ivy-rich-archive-face)) + (all-the-icons-ivy-rich-package-install-summary (:face all-the-icons-ivy-rich-pacage-desc-face))) + :delimiter "\t") + + ;; persp + persp-switch-to-buffer + (:columns + ((all-the-icons-ivy-rich-buffer-icon) + (ivy-switch-buffer-transformer (:width 0.3)) + (ivy-rich-switch-buffer-size (:width 7 :face all-the-icons-ivy-rich-size-face)) + (ivy-rich-switch-buffer-indicators (:width 4 :face all-the-icons-ivy-rich-indicator-face :align right)) + (all-the-icons-ivy-rich-switch-buffer-major-mode (:width 18 :face all-the-icons-ivy-rich-major-mode-face)) + (ivy-rich-switch-buffer-project (:width 0.12 :face all-the-icons-ivy-rich-project-face)) + (ivy-rich-switch-buffer-path (:width (lambda (x) (ivy-rich-switch-buffer-shorten-path x (ivy-rich-minibuffer-width 0.3))) :face all-the-icons-ivy-rich-path-face))) + :predicate + (lambda (cand) (get-buffer cand)) + :delimiter "\t") + persp-switch + (:columns + ((all-the-icons-ivy-rich-project-icon) + (ivy-rich-candidate (:face all-the-icons-ivy-rich-persp-face))) + :delimiter "\t") + persp-frame-switch + (:columns + ((all-the-icons-ivy-rich-project-icon) + (ivy-rich-candidate (:face all-the-icons-ivy-rich-persp-face))) + :delimiter "\t") + persp-window-switch + (:columns + ((all-the-icons-ivy-rich-project-icon) + (ivy-rich-candidate (:face all-the-icons-ivy-rich-persp-face))) + :delimiter "\t") + persp-kill + (:columns + ((all-the-icons-ivy-rich-project-icon) + (ivy-rich-candidate (:face all-the-icons-ivy-rich-persp-face))) + :delimiter "\t") + persp-save-and-kill + (:columns + ((all-the-icons-ivy-rich-project-icon) + (ivy-rich-candidate (:face all-the-icons-ivy-rich-persp-face))) + :delimiter "\t") + persp-import-buffers + (:columns + ((all-the-icons-ivy-rich-project-icon) + (ivy-rich-candidate (:face all-the-icons-ivy-rich-persp-face))) + :delimiter "\t") + persp-import-win-conf + (:columns + ((all-the-icons-ivy-rich-project-icon) + (ivy-rich-candidate (:face all-the-icons-ivy-rich-persp-face))) + :delimiter "\t") + persp-kill-buffer + (:columns + ((all-the-icons-ivy-rich-buffer-icon) + (ivy-switch-buffer-transformer (:width 0.3)) + (ivy-rich-switch-buffer-size (:width 7 :face all-the-icons-ivy-rich-size-face)) + (ivy-rich-switch-buffer-indicators (:width 4 :face all-the-icons-ivy-rich-indicator-face :align right)) + (all-the-icons-ivy-rich-switch-buffer-major-mode (:width 18 :face all-the-icons-ivy-rich-major-mode-face)) + (ivy-rich-switch-buffer-project (:width 0.12 :face all-the-icons-ivy-rich-project-face)) + (ivy-rich-switch-buffer-path (:width (lambda (x) (ivy-rich-switch-buffer-shorten-path x (ivy-rich-minibuffer-width 0.3))) :face all-the-icons-ivy-rich-path-face))) + :predicate + (lambda (cand) (get-buffer cand)) + :delimiter "\t") + persp-remove-buffer + (:columns + ((all-the-icons-ivy-rich-buffer-icon) + (ivy-switch-buffer-transformer (:width 0.3)) + (ivy-rich-switch-buffer-size (:width 7 :face all-the-icons-ivy-rich-size-face)) + (ivy-rich-switch-buffer-indicators (:width 4 :face all-the-icons-ivy-rich-indicator-face :align right)) + (all-the-icons-ivy-rich-switch-buffer-major-mode (:width 18 :face all-the-icons-ivy-rich-major-mode-face)) + (ivy-rich-switch-buffer-project (:width 0.12 :face all-the-icons-ivy-rich-project-face)) + (ivy-rich-switch-buffer-path (:width (lambda (x) (ivy-rich-switch-buffer-shorten-path x (ivy-rich-minibuffer-width 0.3))) :face all-the-icons-ivy-rich-path-face))) + :predicate + (lambda (cand) (get-buffer cand)) + :delimiter "\t") + persp-add-buffer + (:columns + ((all-the-icons-ivy-rich-buffer-icon) + (ivy-switch-buffer-transformer (:width 0.3)) + (ivy-rich-switch-buffer-size (:width 7 :face all-the-icons-ivy-rich-size-face)) + (ivy-rich-switch-buffer-indicators (:width 4 :face all-the-icons-ivy-rich-indicator-face :align right)) + (all-the-icons-ivy-rich-switch-buffer-major-mode (:width 18 :face all-the-icons-ivy-rich-major-mode-face)) + (ivy-rich-switch-buffer-project (:width 0.12 :face all-the-icons-ivy-rich-project-face)) + (ivy-rich-switch-buffer-path (:width (lambda (x) (ivy-rich-switch-buffer-shorten-path x (ivy-rich-minibuffer-width 0.3))) :face all-the-icons-ivy-rich-path-face))) + :predicate + (lambda (cand) (get-buffer cand)) + :delimiter "\t") + + all-the-icons-ivy-rich-kill-buffer + (:columns + ((all-the-icons-ivy-rich-buffer-icon) + (ivy-switch-buffer-transformer (:width 0.3)) + (ivy-rich-switch-buffer-size (:width 7 :face all-the-icons-ivy-rich-size-face)) + (ivy-rich-switch-buffer-indicators (:width 4 :face all-the-icons-ivy-rich-indicator-face :align right)) + (all-the-icons-ivy-rich-switch-buffer-major-mode (:width 18 :face all-the-icons-ivy-rich-major-mode-face)) + (ivy-rich-switch-buffer-project (:width 0.12 :face all-the-icons-ivy-rich-project-face)) + (ivy-rich-switch-buffer-path (:width (lambda (x) (ivy-rich-switch-buffer-shorten-path x (ivy-rich-minibuffer-width 0.3))) :face all-the-icons-ivy-rich-path-face))) + :predicate + (lambda (cand) (get-buffer cand)) + :delimiter "\t") + + org-switchb + (:columns + ((all-the-icons-ivy-rich-buffer-icon) + (ivy-switch-buffer-transformer (:width 0.3)) + (ivy-rich-switch-buffer-size (:width 7 :face all-the-icons-ivy-rich-size-face)) + (ivy-rich-switch-buffer-indicators (:width 4 :face all-the-icons-ivy-rich-indicator-face :align right)) + (all-the-icons-ivy-rich-switch-buffer-major-mode (:width 18 :face all-the-icons-ivy-rich-major-mode-face)) + (ivy-rich-switch-buffer-project (:width 0.12 :face all-the-icons-ivy-rich-project-face)) + (ivy-rich-switch-buffer-path (:width (lambda (x) (ivy-rich-switch-buffer-shorten-path x (ivy-rich-minibuffer-width 0.3))) :face all-the-icons-ivy-rich-path-face))) + :predicate + (lambda (cand) (get-buffer cand)) + :delimiter "\t") + + customize-group + (:columns + ((all-the-icons-ivy-rich-settings-icon) + (ivy-rich-candidate (:width 0.3)) + (all-the-icons-ivy-rich-custom-group-docstring (:face all-the-icons-ivy-rich-doc-face))) + :delimiter "\t") + + describe-character-set + (:columns + ((all-the-icons-ivy-rich-charset-icon) + (ivy-rich-candidate (:width 0.3)) + (all-the-icons-ivy-rich-charset-docstring (:face all-the-icons-ivy-rich-doc-face))) + :delimiter "\t") + + describe-coding-system + (:columns + ((all-the-icons-ivy-rich-coding-system-icon) + + (all-the-icons-ivy-rich-coding-system-docstring (:face all-the-icons-ivy-rich-doc-face))) + :delimiter "\t") + + describe-language-environment + (:columns + ((all-the-icons-ivy-rich-lang-icon) + (ivy-rich-candidate)) + :delimiter "\t") + + set-input-method + (:columns + ((all-the-icons-ivy-rich-input-method-icon) + (ivy-rich-candidate (:width 0.3)) + (all-the-icons-ivy-rich-input-method-docstring (:face all-the-icons-ivy-rich-doc-face))) + :delimiter "\t") + + remove-hook + (:columns + ((all-the-icons-ivy-rich-variable-icon) + (counsel-describe-variable-transformer (:width 0.3)) + (all-the-icons-ivy-rich-symbol-class (:width 8 :face all-the-icons-ivy-rich-type-face)) + (all-the-icons-ivy-rich-variable-value (:width 0.12)) + (ivy-rich-counsel-variable-docstring (:face all-the-icons-ivy-rich-doc-face)))) + + markdown-insert-link + (:columns + ((all-the-icons-ivy-rich-link-icon) + (ivy-rich-candidate)) + :delimiter "\t") + markdown-insert-image + (:columns + ((all-the-icons-ivy-rich-link-icon) + (ivy-rich-candidate)) + :delimiter "\t") + + getenv + (:columns + ((all-the-icons-ivy-rich-key-icon) + (ivy-rich-candidate (:face all-the-icons-ivy-rich-string-face))) + :delimiter "\t") + setenv + (:columns + ((all-the-icons-ivy-rich-key-icon) + (ivy-rich-candidate (:face all-the-icons-ivy-rich-string-face))) + :delimiter "\t") + + lsp-ivy-workspace-folders-remove + (:columns + ((all-the-icons-ivy-rich-dir-icon) + (all-the-icons-ivy-rich-project-name (:width 0.4)) + (all-the-icons-ivy-rich-project-file-id (:width 15 :face all-the-icons-ivy-rich-file-owner-face :align right)) + (all-the-icons-ivy-rich-project-file-modes (:width 12)) + (all-the-icons-ivy-rich-project-file-size (:width 7 :face all-the-icons-ivy-rich-size-face)) + (all-the-icons-ivy-rich-project-file-modification-time (:face all-the-icons-ivy-rich-time-face))) + :delimiter "\t") + + treemacs-projectile + (:columns + ((all-the-icons-ivy-rich-project-icon) + (all-the-icons-ivy-rich-project-name (:width 0.4)) + (all-the-icons-ivy-rich-project-file-id (:width 15 :face all-the-icons-ivy-rich-file-owner-face :align right)) + (all-the-icons-ivy-rich-project-file-modes (:width 12)) + (all-the-icons-ivy-rich-project-file-size (:width 7 :face all-the-icons-ivy-rich-size-face)) + (all-the-icons-ivy-rich-project-file-modification-time (:face all-the-icons-ivy-rich-time-face))) + :delimiter "\t")) + "Definitions for ivy-rich transformers. + +See `ivy-rich-display-transformers-list' for details." + :group 'all-the-icons-ivy-rich + :type '(repeat sexp)) + + +;; +;; Utilities +;; + +(defun all-the-icons-ivy-rich-icon-displayable () + "Whether the icons are displayable." + (and all-the-icons-ivy-rich-icon (display-graphic-p))) + +;; Support`ivy-switch-buffer' +(defun all-the-icons-ivy-rich-switch-buffer-major-mode (cand) + "Return the mode name for CAND." + (format-mode-line (ivy-rich--local-values cand 'mode-name))) + +;; Support `kill-buffer' +(defun all-the-icons-ivy-rich-kill-buffer (&optional buffer-or-name) + "Kill the buffer specified by BUFFER-OR-NAME." + (interactive + (list (completing-read (format "Kill buffer (default %s): " (buffer-name)) + (mapcar (lambda (b) + (buffer-name b)) + (buffer-list)) + nil t nil nil + (buffer-name)))) + (kill-buffer buffer-or-name)) + +(defun all-the-icons-ivy-rich--project-root () + "Get the path to the root of your project. +Return `default-directory' if no project was found." + (when all-the-icons-ivy-rich-project + (cond + ;; Ignore remote files due to performance issue + ((file-remote-p default-directory) + default-directory) + ((fboundp 'ffip-project-root) + (let ((inhibit-message t)) + (ffip-project-root))) + ((bound-and-true-p projectile-mode) + (projectile-project-root)) + ((fboundp 'project-current) + (when-let ((project (project-current))) + (expand-file-name (if (fboundp 'project-root) + (project-root project) + (cdr project))))) + (t default-directory)))) + +(defun all-the-icons-ivy-rich--file-path (cand) + "Get the file path of CAND." + (if (eq (ivy-state-caller ivy-last) 'counsel-fzf) + (expand-file-name cand counsel--fzf-dir) + (expand-file-name cand ivy--directory))) + +(defun all-the-icons-ivy-rich--project-file-path (cand) + "Get the project file path of CAND." + (expand-file-name cand (all-the-icons-ivy-rich--project-root))) + +(defun all-the-icons-ivy-rich-project-find-file-transformer (cand) + "Transform non-visited file names with `ivy-virtual' face." + (cond + ((or (ivy--dirname-p cand) + (file-directory-p (all-the-icons-ivy-rich--file-path cand))) + (propertize cand 'face 'ivy-subdir)) + ((not (get-file-buffer + (expand-file-name cand (all-the-icons-ivy-rich--project-root)))) + (propertize cand 'face 'ivy-virtual)) + (t cand))) + +(defvar all-the-icons-ivy-rich--file-modes-cache nil + "File modes cache.") +(defun all-the-icons-ivy-rich--file-modes (file) + "Return FILE modes." + (cond + ((file-remote-p file) "") + ((not (file-exists-p file)) "") + (t (let ((modes (file-attribute-modes (file-attributes file)))) + (or (car (member modes all-the-icons-ivy-rich--file-modes-cache)) + (progn + (dotimes (i (length modes)) + (put-text-property + i (1+ i) 'face + (pcase (aref modes i) + (?- 'all-the-icons-ivy-rich-file-priv-no) + (?d 'all-the-icons-ivy-rich-file-priv-dir) + (?l 'all-the-icons-ivy-rich-file-priv-link) + (?r 'all-the-icons-ivy-rich-file-priv-read) + (?w 'all-the-icons-ivy-rich-file-priv-write) + (?x 'all-the-icons-ivy-rich-file-priv-exec) + ((or ?s ?S ?t ?T) 'all-the-icons-ivy-rich-file-priv-other) + (_ 'all-the-icons-ivy-rich-file-priv-rare)) + modes)) + (push modes all-the-icons-ivy-rich--file-modes-cache) + modes) + ""))))) + +(defun all-the-icons-ivy-rich--file-id (path) + "Return file uid/gid for CAND." + (cond + ((file-remote-p path) "") + ((not (file-exists-p path)) "") + (t (let* ((attrs (file-attributes path 'integer)) + (uid (file-attribute-user-id attrs)) + (gid (file-attribute-group-id attrs))) + (if (or (/= (user-uid) uid) (/= (group-gid) gid)) + (let* ((attributes (file-attributes path 'string)) + (user (file-attribute-user-id attributes)) + (group (file-attribute-group-id attributes))) + (format " %s:%s " user group)) + ""))))) + +(defun all-the-icons-ivy-rich--file-size (file) + "Return FILE size." + (cond + ((file-remote-p file) "") + ((not (file-exists-p file)) "") + (t (file-size-human-readable (file-attribute-size (file-attributes file)))))) + +(defun all-the-icons-ivy-rich--file-modification-time (file) + "Return FILE modification time." + (cond + ((file-remote-p file) "") + ((not (file-exists-p file)) "") + (t (format-time-string + "%b %d %H:%M" + (file-attribute-modification-time (file-attributes file)))))) + +;; Support `counsel-find-file', `counsel-dired', etc. +(defun all-the-icons-ivy-rich-file-name (cand) + "Return file name for CAND when reading files. +Display directories with different color. +Display the true name when the file is a symlink." + (let* ((file (ivy-read-file-transformer cand)) + (path (all-the-icons-ivy-rich--file-path cand)) + (type (unless (file-remote-p path) + (file-symlink-p path)))) + (if (stringp type) + (concat file + (propertize (concat " -> " type) + 'face 'all-the-icons-ivy-rich-doc-face)) + file))) + +(defun all-the-icons-ivy-rich-file-modes (cand) + "Return file modes for CAND." + (all-the-icons-ivy-rich--file-modes + (all-the-icons-ivy-rich--file-path cand))) + +(defun all-the-icons-ivy-rich-file-id (cand) + "Return file uid/gid for CAND." + (all-the-icons-ivy-rich--file-id + (all-the-icons-ivy-rich--file-path cand))) + +(defun all-the-icons-ivy-rich-file-size (cand) + "Return file size for CAND." + (all-the-icons-ivy-rich--file-size + (all-the-icons-ivy-rich--file-path cand))) + +(defun all-the-icons-ivy-rich-file-modification-time (cand) + "Return file modification time for CAND." + (all-the-icons-ivy-rich--file-modification-time + (all-the-icons-ivy-rich--file-path cand))) + +;; Support `counsel-projectile-find-file', `counsel-projectile-dired', etc. +(defun all-the-icons-ivy-rich-project-name (cand) + "Return project name for CAND." + (if (or (ivy--dirname-p cand) + (file-directory-p (all-the-icons-ivy-rich--file-path cand))) + (propertize cand 'face 'ivy-subdir) + cand)) + +(defun all-the-icons-ivy-rich-project-file-modes (cand) + "Return file modes for CAND." + (all-the-icons-ivy-rich--file-modes + (all-the-icons-ivy-rich--project-file-path cand))) + +(defun all-the-icons-ivy-rich-project-file-id (cand) + "Return file uid/gid for CAND." + (all-the-icons-ivy-rich--file-id + (all-the-icons-ivy-rich--project-file-path cand))) + +(defun all-the-icons-ivy-rich-project-file-size (cand) + "Return file size for CAND." + (all-the-icons-ivy-rich--file-size + (all-the-icons-ivy-rich--project-file-path cand))) + +(defun all-the-icons-ivy-rich-project-file-modification-time (cand) + "Return file modification time for CAND." + (all-the-icons-ivy-rich--file-modification-time + (all-the-icons-ivy-rich--project-file-path cand))) + +;; Support `counsel-bookmark' +(defun all-the-icons-ivy-rich-bookmark-name (cand) + "Return bookmark name for CAND." + (car (assoc cand bookmark-alist))) + +(defun all-the-icons-ivy-rich-bookmark-filename (cand) + "Return bookmark info for CAND." + (let ((file (ivy-rich-bookmark-filename cand))) + (cond + ((null file) "") + ((file-remote-p file) file) + (t file)))) + +(defun all-the-icons-ivy-rich-bookmark-context (cand) + "Return bookmark context for CAND." + (let ((context (bookmark-get-front-context-string + (assoc cand (bound-and-true-p bookmark-alist))))) + (if (and context (not (string-empty-p context))) + (concat (string-trim + (replace-regexp-in-string + "[ \t]+" " " + (replace-regexp-in-string "\n" "\\\\n" context))) + "…") + ""))) + +;; Support `counsel-package', `package-delete', `package-reinstall' and `package-delete' +(defun all-the-icons-ivy-rich-package-name (cand) + "Return formalized package name for CAND." + (replace-regexp-in-string "-[[:digit:]]+\\.?[[:digit:]+\\.]+\\'" "" + (replace-regexp-in-string "^\\(\\+\\|-\\)" "" cand))) + +(defun all-the-icons-ivy-rich-package-status (cand) + "Return package status for CAND." + (let* ((pkg-alist (bound-and-true-p package-alist)) + (pkg (intern-soft (all-the-icons-ivy-rich-package-name cand))) + ;; taken from `describe-package-1' + (pkg-desc (or (car (alist-get pkg pkg-alist)) + (if-let (built-in (assq pkg package--builtins)) + (package--from-builtin built-in) + (car (alist-get pkg package-archive-contents)))))) + (if-let ((status (and pkg-desc (package-desc-status pkg-desc)))) + (cond ((string= status "available") + (propertize status 'face 'all-the-icons-ivy-rich-package-status-avaible-face)) + ((string= status "new") + (propertize status 'face 'all-the-icons-ivy-rich-package-status-new-face)) + ((string= status "held") + (propertize status 'face 'all-the-icons-ivy-rich-package-status-held-face)) + ((member status '("avail-obso" "installed" "dependency" "incompat" "deleted")) + (propertize status 'face 'all-the-icons-ivy-rich-package-status-installed-face)) + ((member status '("disabled" "unsigned")) + (propertize status 'face 'all-the-icons-ivy-rich-package-status-warn-face)) + (t status)) + (propertize "orphan" 'face 'all-the-icons-ivy-rich-error-face)))) + +(defun all-the-icons-ivy-rich-package-install-summary (cand) + "Return package install summary for CAND. Used for `counsel-package'." + (ivy-rich-package-install-summary (all-the-icons-ivy-rich-package-name cand))) + +(defun all-the-icons-ivy-rich-package-archive-summary (cand) + "Return package archive summary for CAND. Used for `counsel-package'." + (ivy-rich-package-archive-summary (all-the-icons-ivy-rich-package-name cand))) + +(defun all-the-icons-ivy-rich-package-version (cand) + "Return package version for CAND. Used for `counsel-package'." + (ivy-rich-package-version (all-the-icons-ivy-rich-package-name cand))) + +(defun all-the-icons-ivy-rich--truncate-docstring (doc) + "Truncate DOC string." + (if (and doc (string-match "^\\(.+\\)\\([\r\n]\\)?" doc)) + (truncate-string-to-width (match-string 1 doc) 80) + "")) + +;; Support `counsel-describe-face' +(defun all-the-icons-ivy-rich-counsel-face-docstring (cand) + "Return face's documentation for CAND." + (all-the-icons-ivy-rich--truncate-docstring + (documentation-property (intern-soft cand) 'face-documentation))) + +;; Support `counsel-describe-function'and `counsel-describe-variable' +(defun all-the-icons-ivy-rich-function-args (cand) + "Return function arguments for CAND." + (let ((sym (intern-soft cand)) + (tmp)) + (or + (elisp-function-argstring + (cond + ((listp (setq tmp (gethash (indirect-function sym) + advertised-signature-table t))) + tmp) + ((setq tmp (help-split-fundoc + (ignore-errors (documentation sym t)) + sym)) + (substitute-command-keys (car tmp))) + ((setq tmp (help-function-arglist sym)) + (if (and (stringp tmp) + (string-match-p "Arg list not available" tmp)) + "[autoload]" + tmp)))) + ""))) + +(defun all-the-icons-ivy-rich-variable-value (cand) + "Return the variable value of CAND as string." + (let ((sym (intern-soft cand))) + (cond + ((not (boundp sym)) + (propertize "#" 'face 'all-the-icons-ivy-rich-null-face)) + (t (let ((val (symbol-value sym))) + (pcase val + ('nil (propertize "nil" 'face 'all-the-icons-ivy-rich-null-face)) + ('t (propertize "t" 'face 'all-the-icons-ivy-rich-true-face)) + ((pred keymapp) (propertize "#" 'face 'all-the-icons-ivy-rich-value-face)) + ((pred bool-vector-p) (propertize "#" 'face 'all-the-icons-ivy-rich-value-face)) + ((pred hash-table-p) (propertize "#" 'face 'all-the-icons-ivy-rich-value-face)) + ((pred syntax-table-p) (propertize "#" 'face 'all-the-icons-ivy-rich-value-face)) + ;; Emacs BUG: abbrev-table-p throws an error + ((guard (ignore-errors (abbrev-table-p val))) (propertize "#" 'face 'all-the-icons-ivy-rich-value-face)) + ((pred char-table-p) (propertize "#" 'face 'all-the-icons-ivy-rich-value-face)) + ((pred byte-code-function-p) (propertize "#" 'face 'all-the-icons-ivy-rich-function-face)) + ((and (pred functionp) (pred symbolp)) + ;; NOTE: We are not consistent here, values are generally printed unquoted. But we + ;; make an exception for function symbols to visually distinguish them from symbols. + ;; I am not entirely happy with this, but we should not add quotation to every type. + (format (propertize "#'%s" 'face 'all-the-icons-ivy-rich-function-face) val)) + ((pred recordp) (format (propertize "#" 'face 'all-the-icons-ivy-rich-value-face) (type-of val))) + ((pred symbolp) (propertize (symbol-name val) 'face 'all-the-icons-ivy-rich-symbol-face)) + ((pred numberp) (propertize (number-to-string val) 'face 'all-the-icons-ivy-rich-number-face)) + (_ (let ((print-escape-newlines t) + (print-escape-control-characters t) + (print-escape-multibyte t) + (print-level 10) + (print-length all-the-icons-ivy-rich-field-width)) + (propertize + (prin1-to-string + (if (stringp val) + ;; Get rid of string properties to save some of the precious space + (substring-no-properties + val 0 + (min (length val) all-the-icons-ivy-rich-field-width)) + val)) + 'face + (cond + ((listp val) 'all-the-icons-ivy-rich-list-face) + ((stringp val) 'all-the-icons-ivy-rich-string-face) + (t 'all-the-icons-ivy-rich-value-face))))))))))) + +;; Support `counsel-describe-symbol', `counsel-info-lookup-symbol' and `counsel-apropos' + +;; Taken from advice--make-docstring +(defun all-the-icons-ivy-rich--advised (fun) + "Return t if function FUN is advised." + (let ((flist (indirect-function fun))) + (advice--p (if (eq 'macro (car-safe flist)) (cdr flist) flist)))) + +;; Symbol class characters from Emacs 28 `help--symbol-completion-table-affixation' +;; ! and * are additions. Same as marginalia +(defun all-the-icons-ivy-rich-symbol-class (cand) + "Return symbol class characters for symbol CAND. + +Function: +f function +c command +C interactive-only command +m macro +M special-form +g cl-generic +p pure +s side-effect-free +@ autoloaded +! advised +- obsolete + +Variable: +u custom (U modified compared to global value) +v variable +l local (L modified compared to default value) +- obsolete + +Other: +a face +t cl-type" + (let ((s (intern-soft cand))) + (format + "%-6s" + (concat + (when (fboundp s) + (concat + (cond + ((get s 'pure) "p") + ((get s 'side-effect-free) "s")) + (cond + ((commandp s) (if (get s 'interactive-only) "C" "c")) + ((cl-generic-p s) "g") + ((macrop (symbol-function s)) "m") + ((special-form-p (symbol-function s)) "M") + (t "f")) + (and (autoloadp (symbol-function s)) "@") + (and (all-the-icons-ivy-rich--advised s) "!") + (and (get s 'byte-obsolete-info) "-"))) + (when (boundp s) + (concat + (when (local-variable-if-set-p s) + (if (ignore-errors + (not (equal (symbol-value s) + (default-value s)))) + "L" "l")) + (if (custom-variable-p s) + (if (ignore-errors + (not (equal + (symbol-value s) + (eval (car (get s 'standard-value)))))) + "U" "u") + "v") + (and (get s 'byte-obsolete-variable) "-"))) + (and (facep s) "a") + (and (fboundp 'cl-find-class) (cl-find-class s) "t"))))) + +(defun all-the-icons-ivy-rich-symbol-docstring (cand) + "Return symbol's documentation for CAND." + (let ((symbol (intern-soft cand))) + (cond + ((fboundp symbol) + (ivy-rich-counsel-function-docstring cand)) + ((facep symbol) + (all-the-icons-ivy-rich-counsel-face-docstring cand)) + ((and (boundp symbol) (not (keywordp symbol))) + (ivy-rich-counsel-variable-docstring cand)) + (t "")))) + +;; Support `counsel-imenu' +(defun all-the-icons-ivy-rich--counsel-imenu-symbol (cand) + "Return imenu symbol from CAND." + (let ((str (split-string cand ": "))) + (or (cadr str) (car str)))) + +(defun all-the-icons-ivy-rich-imenu-class (cand) + "Return imenu's class characters for CAND. + +Only available in `emacs-lisp-mode'." + (if (derived-mode-p 'emacs-lisp-mode) + (string-trim + (all-the-icons-ivy-rich-symbol-class + (all-the-icons-ivy-rich--counsel-imenu-symbol cand))) + "")) + +(defun all-the-icons-ivy-rich-imenu-docstring (cand) + "Return imenu's documentation for CAND. + +Only available in `emacs-lisp-mode'." + (if (derived-mode-p 'emacs-lisp-mode) + (all-the-icons-ivy-rich-symbol-docstring + (all-the-icons-ivy-rich--counsel-imenu-symbol cand)) + "")) + +;; Support `counsel-descbinds' +(defun all-the-icons-ivy-rich-keybinding-docstring (cand) + "Return keybinding's documentation for CAND." + ;; The magic number 15 is from `counsel--descbinds-cands' + (if (not (string-match-p " ignore" cand)) + (let* ((pos (string-match-p " .+" cand 15)) + (sym (string-trim (substring cand pos)))) + (all-the-icons-ivy-rich-symbol-docstring sym)) + "")) + +;; Support `customize-group' +(defun all-the-icons-ivy-rich-custom-group-docstring (cand) + "Return custom group's documentation for CAND." + (all-the-icons-ivy-rich--truncate-docstring + (or (documentation-property (intern cand) 'group-documentation) ""))) + +;; Support `describe-character-set' +(defun all-the-icons-ivy-rich-charset-docstring (cand) + "Return charset's documentation for CAND." + (all-the-icons-ivy-rich--truncate-docstring (charset-description (intern cand)))) + +;; Support `describe-coding-system' +(defun all-the-icons-ivy-rich-coding-system-docstring (cand) + "Return coding system's documentation for CAND." + (all-the-icons-ivy-rich--truncate-docstring (coding-system-doc-string (intern cand)))) + +;; Support `set-input-method' +(defun all-the-icons-ivy-rich-input-method-docstring (cand) + "Return input method's documentation for CAND." + (nth 4 (assoc cand input-method-alist))) + +;; Support `counsel-list-processes' +(defun all-the-icons-ivy-rich-process-id (cand) + "Return process id for CAND. + +For a network, serial, and pipe connections, return \"--\"." + (let ((p (get-process cand))) + (when (processp p) + (format "%s" (or (process-id p) "--"))))) + +(defun all-the-icons-ivy-rich-process-status (cand) + "Return process status for CAND." + (let ((p (get-process cand))) + (when (processp p) + (let* ((status (process-status p)) + (face (if (memq status '(stop exit closed failed)) + 'all-the-icons-ivy-rich-process-status-alt-face + 'all-the-icons-ivy-rich-process-status-face))) + (propertize (symbol-name status) 'face face))))) + +(defun all-the-icons-ivy-rich-process-buffer-name (cand) + "Return process buffer name for CAND. + +If the buffer is killed, return \"--\"." + (let ((p (get-process cand))) + (when (processp p) + (let ((buf (process-buffer p))) + (if (buffer-live-p buf) + (buffer-name buf) + "--"))))) + +(defun all-the-icons-ivy-rich-process-tty-name (cand) + "Return the name of the terminal process uses for CAND." + (let ((p (get-process cand))) + (when (processp p) + (or (process-tty-name p) "--")))) + +(defun all-the-icons-ivy-rich-process-thread (cand) + "Return process thread for CAND." + (if (> emacs-major-version 26) + (propertize + (format "%-12s" + (let ((p (get-process cand))) + (when (processp p) + (cond + ((or + (null (process-thread p)) + (not (fboundp 'thread-name))) "--") + ((eq (process-thread p) main-thread) "Main") + ((thread-name (process-thread p))) + (t "--"))))) + 'face 'all-the-icons-ivy-rich-process-thread-face) + "")) + +(defun all-the-icons-ivy-rich-process-command (cand) + "Return process command for CAND." + (let ((p (get-process cand))) + (when (processp p) + (let ((type (process-type p))) + (if (memq type '(network serial pipe)) + (let ((contact (if (> emacs-major-version 26) + (process-contact p t t) + (process-contact p t)))) + (if (eq type 'network) + (format "(%s %s)" + (if (plist-get contact :type) + "datagram" + "network") + (if (plist-get contact :server) + (format + "server on %s" + (if (plist-get contact :host) + (format "%s:%s" + (plist-get contact :host) + (plist-get + contact :service)) + (plist-get contact :local))) + (format "connection to %s:%s" + (plist-get contact :host) + (plist-get contact :service)))) + (format "(serial port %s%s)" + (or (plist-get contact :port) "?") + (let ((speed (plist-get contact :speed))) + (if speed + (format " at %s b/s" speed) + ""))))) + (mapconcat 'identity (process-command p) " ")))))) + +;; Support `counsel-find-library' and `counsel-load-library' +(defun all-the-icons-ivy-rich-library-transformer (cand) + "Return library name for CAND." + (if (featurep (intern-soft cand)) + cand + (propertize cand 'face 'all-the-icons-ivy-rich-off-face))) + +(defun all-the-icons-ivy-rich-library-path (cand) + "Return library path for CAND." + (abbreviate-file-name + (or (ignore-errors (find-library-name cand)) ""))) + +;; Support `counsel-world-clock' +(defun all-the-icons-ivy-rich-world-clock (cand) + "Return local time of timezone (CAND)." + (counsel-world-clock--local-time cand)) + +(defun all-the-icons-ivy-rich-grep-transformer (cand) + "Transform search results (CAND). +Support`counsel-ack', `counsel-ag', `counsel-pt' and `counsel-rg', etc." + (cond + ((string-match "\\(.+\\):\\([0-9]+\\):\\(.+\\)" cand) + (let ((file (match-string 1 cand)) + (line (match-string 2 cand)) + (result (match-string 3 cand))) + (format "%s:%s:%s" + (propertize file 'face 'ivy-grep-info) + (propertize line 'face 'ivy-grep-info) + result))) + ((string-match "\\(.+\\):\\(.+\\)(\\(.+\\))" cand) + (let ((file (match-string 1 cand)) + (msg (match-string 2 cand)) + (err (match-string 3 cand))) + (format "%s:%s(%s)" + (propertize file 'face 'ivy-grep-info) + msg + (propertize err 'face 'error)))) + (t cand))) + +;; +;; Icons +;; + +(defun all-the-icons-ivy-rich--align-icons () + "Set tab size to 1, to insert tabs as delimiters." + (setq-local tab-width 1)) + +(defun all-the-icons-ivy-rich-minibuffer-align-icons () + "Align the icons in `minibuffer'." + (all-the-icons-ivy-rich--align-icons)) + +(defun all-the-icons-ivy-rich-ivy-posframe-align-icons (&rest _) + "Align the icons in `ivy-posframe'." + (with-current-buffer ivy-posframe-buffer + (all-the-icons-ivy-rich--align-icons))) + +(defun all-the-icons-ivy-rich--format-icon (icon) + "Format ICON'." + (let* ((props (get-text-property 0 'face icon)) + (family (plist-get props :family)) + (face (if all-the-icons-ivy-rich-color-icon + (or (plist-get props :inherit) props) + 'all-the-icons-ivy-rich-icon-face)) + (new-face `(:inherit ,face + :family ,family + :height ,all-the-icons-ivy-rich-icon-size))) + (format " %s" (propertize icon 'face new-face)))) + +(defun all-the-icons-ivy-rich-buffer-icon (cand) + "Display buffer icon for CAND in `ivy-rich'." + (when (all-the-icons-ivy-rich-icon-displayable) + (let ((icon (with-current-buffer (get-buffer cand) + (if (eq major-mode 'dired-mode) + (all-the-icons-icon-for-dir cand :face 'all-the-icons-ivy-rich-dir-face) + (all-the-icons-icon-for-buffer))))) + (all-the-icons-ivy-rich--format-icon + (if (or (null icon) (symbolp icon)) + (all-the-icons-faicon "file-o" :face 'all-the-icons-dsilver :height 0.9 :v-adjust 0.0) + (propertize icon 'display '(raise 0.0))))))) + +(defun all-the-icons-ivy-rich-file-icon (cand) + "Display file icon for CAND in `ivy-rich'." + (when (all-the-icons-ivy-rich-icon-displayable) + (let ((icon (cond + ((ivy--dirname-p cand) + (all-the-icons-icon-for-dir cand :face 'all-the-icons-ivy-rich-dir-face)) + ((not (string-empty-p cand)) + (all-the-icons-icon-for-file (file-name-nondirectory cand) :height 0.9 :v-adjust 0.0))))) + (all-the-icons-ivy-rich--format-icon + (if (or (null icon) (symbolp icon)) + (all-the-icons-faicon "file-o" :face 'all-the-icons-dsilver :height 0.9 :v-adjust 0.0) + (propertize icon 'display '(raise 0.0))))))) + +(defun all-the-icons-ivy-rich-dir-icon (_cand) + "Display project icon in `ivy-rich'." + (when (all-the-icons-ivy-rich-icon-displayable) + (all-the-icons-ivy-rich--format-icon + (all-the-icons-octicon "file-directory" :height 1.0 :v-adjust 0.01 :face 'all-the-icons-silver)))) + +(defun all-the-icons-ivy-rich-project-icon (_cand) + "Display project icon in `ivy-rich'." + (when (all-the-icons-ivy-rich-icon-displayable) + (all-the-icons-ivy-rich--format-icon + (all-the-icons-octicon "repo" :height 1.0 :v-adjust 0.01 :face 'all-the-icons-silver)))) + +(defun all-the-icons-ivy-rich-mode-icon (_cand) + "Display mode icon in `ivy-rich'." + (when (all-the-icons-ivy-rich-icon-displayable) + (all-the-icons-ivy-rich--format-icon + (all-the-icons-faicon "cube" :height 0.95 :v-adjust -0.05 :face 'all-the-icons-blue)))) + +(defun all-the-icons-ivy-rich-function-icon (cand) + "Display function icon in `ivy-rich'." + (when (all-the-icons-ivy-rich-icon-displayable) + (all-the-icons-ivy-rich--format-icon + (if (commandp (intern cand)) + (all-the-icons-faicon "cog" :height 0.95 :v-adjust -0.05 :face 'all-the-icons-blue) + (all-the-icons-faicon "cube" :height 0.95 :v-adjust -0.05 :face 'all-the-icons-purple))))) + +(defun all-the-icons-ivy-rich-command-icon (_cand) + "Display command icon in `ivy-rich'." + (when (all-the-icons-ivy-rich-icon-displayable) + (all-the-icons-ivy-rich--format-icon + (all-the-icons-faicon "cog" :height 0.95 :v-adjust -0.05 :face 'all-the-icons-blue)))) + +(defun all-the-icons-ivy-rich-history-icon (_cand) + "Display command icon in `ivy-rich'." + (when (all-the-icons-ivy-rich-icon-displayable) + (all-the-icons-ivy-rich--format-icon + (all-the-icons-material "history" :height 1.1 :v-adjust -0.1 :face 'all-the-icons-lblue)))) + +(defun all-the-icons-ivy-rich-variable-icon (cand) + "Display the variable icon in `ivy-rich'." + (when (all-the-icons-ivy-rich-icon-displayable) + (all-the-icons-ivy-rich--format-icon + (if (custom-variable-p (intern cand)) + (all-the-icons-faicon "tag" :height 0.9 :v-adjust -0.05 :face 'all-the-icons-lblue) + (all-the-icons-octicon "tag" :height 0.95 :v-adjust -0.05 :face 'all-the-icons-lblue))))) + +(defun all-the-icons-ivy-rich-face-icon (_cand) + "Display face icon in `ivy-rich'." + (when (all-the-icons-ivy-rich-icon-displayable) + (all-the-icons-ivy-rich--format-icon + (all-the-icons-material "palette" :height 1.0 :v-adjust -0.225 :face 'all-the-icons-blue)))) + +(defun all-the-icons-ivy-rich-symbol-icon (cand) + "Display the symbol icon in `ivy-rich'." + (when (all-the-icons-ivy-rich-icon-displayable) + (let ((sym (intern (all-the-icons-ivy-rich--counsel-imenu-symbol cand)))) + (cond + ((string-match-p "Packages?[:)]" cand) + (all-the-icons-ivy-rich--format-icon + (all-the-icons-faicon "archive" :height 0.9 :v-adjust -0.05 :face 'all-the-icons-silver))) + ((or (functionp sym) (macrop sym)) + (all-the-icons-ivy-rich-function-icon cand)) + ((facep sym) + (all-the-icons-ivy-rich-face-icon cand)) + ((symbolp sym) + (all-the-icons-ivy-rich-variable-icon cand)) + (t (all-the-icons-ivy-rich--format-icon + (all-the-icons-octicon "gear" :height 0.9 :v-adjust -0.05 :face 'all-the-icons-silver))))))) + +(defun all-the-icons-ivy-rich-company-icon (cand) + "Display the symbol icon of company in `ivy-rich'." + (when (all-the-icons-ivy-rich-icon-displayable) + (all-the-icons-ivy-rich--format-icon + (if (fboundp 'company-box--get-icon) + (company-box--get-icon cand) + (all-the-icons-octicon "gear" :height 0.9 :v-adjust -0.05 :face 'all-the-icons-silver))))) + +(defun all-the-icons-ivy-rich-theme-icon (_cand) + "Display the theme icon in `ivy-rich'." + (when (all-the-icons-ivy-rich-icon-displayable) + (all-the-icons-ivy-rich--format-icon + (all-the-icons-material "palette" :height 1.0 :v-adjust -0.225 :face 'all-the-icons-lcyan)))) + +(defun all-the-icons-ivy-rich-keybinding-icon (_cand) + "Display the keybindings icon in `ivy-rich'." + (when (all-the-icons-ivy-rich-icon-displayable) + (all-the-icons-ivy-rich--format-icon + (all-the-icons-faicon "keyboard-o" :height 0.9 :v-adjust -0.05 :face 'all-the-icons-lsilver)))) + +(defun all-the-icons-ivy-rich-library-icon (_cand) + "Display the library icon in `ivy-rich'." + (when (all-the-icons-ivy-rich-icon-displayable) + (all-the-icons-ivy-rich--format-icon + (all-the-icons-material "view_module" :height 1.0 :v-adjust -0.225 :face 'all-the-icons-lblue)))) + +(defun all-the-icons-ivy-rich-package-icon (_cand) + "Display the package icon in `ivy-rich'." + (when (all-the-icons-ivy-rich-icon-displayable) + (all-the-icons-ivy-rich--format-icon + (all-the-icons-faicon "archive" :height 0.9 :v-adjust -0.05 :face 'all-the-icons-silver)))) + +(defun all-the-icons-ivy-rich-font-icon (_cand) + "Display the font icon in `ivy-rich'." + (when (all-the-icons-ivy-rich-icon-displayable) + (all-the-icons-ivy-rich--format-icon + (all-the-icons-faicon "font" :height 0.85 :v-adjust -0.05 :face 'all-the-icons-lblue)))) + +(defun all-the-icons-ivy-rich-world-clock-icon (_cand) + "Display the world clock icon in `ivy-rich'." + (when (all-the-icons-ivy-rich-icon-displayable) + (all-the-icons-ivy-rich--format-icon + (all-the-icons-faicon "globe" :height 0.9 :v-adjust -0.05 :face 'all-the-icons-lblue)))) + +(defun all-the-icons-ivy-rich-tramp-icon (_cand) + "Display the tramp icon in `ivy-rich'." + (when (all-the-icons-ivy-rich-icon-displayable) + (all-the-icons-ivy-rich--format-icon + (all-the-icons-octicon "radio-tower" :height 0.8 :v-adjust 0.01)))) + +(defun all-the-icons-ivy-rich-git-branch-icon (_cand) + "Display the git branch icon in `ivy-rich'." + (when (all-the-icons-ivy-rich-icon-displayable) + (all-the-icons-ivy-rich--format-icon + (all-the-icons-octicon "git-branch" :height 1.0 :v-adjust -0.05 :face 'all-the-icons-green)))) + +(defun all-the-icons-ivy-rich-process-icon (_cand) + "Display the process icon in `ivy-rich'." + (when (all-the-icons-ivy-rich-icon-displayable) + (all-the-icons-ivy-rich--format-icon + (all-the-icons-faicon "bolt" :height 1.0 :v-adjust -0.05 :face 'all-the-icons-lblue)))) + +(defun all-the-icons-ivy-rich-imenu-icon (cand) + "Display the imenu icon for CAND in `ivy-rich'." + (if (derived-mode-p 'emacs-lisp-mode) + (all-the-icons-ivy-rich-symbol-icon cand) + (when (all-the-icons-ivy-rich-icon-displayable) + (all-the-icons-ivy-rich--format-icon + (let ((case-fold-search nil)) + (cond + ((string-match-p "Type Parameters?[:)]" cand) + (all-the-icons-faicon "arrows" :height 0.85 :v-adjust -0.05)) + ((string-match-p "\\(Variables?\\)\\|\\(Fields?\\)\\|\\(Parameters?\\)[:)]" cand) + (all-the-icons-octicon "tag" :height 0.95 :v-adjust 0 :face 'all-the-icons-lblue)) + ((string-match-p "Constants?[:)]" cand) + (all-the-icons-faicon "square-o" :height 0.95 :v-adjust -0.05)) + ((string-match-p "Enum\\(erations?\\)?[:)]" cand) + (all-the-icons-material "storage" :height 0.95 :v-adjust -0.2 :face 'all-the-icons-orange)) + ((string-match-p "References?[:)]" cand) + (all-the-icons-material "collections_bookmark" :height 0.95 :v-adjust -0.2)) + ((string-match-p "\\(Types?\\)\\|\\(Property\\)[:)]" cand) + (all-the-icons-faicon "wrench" :height 0.9 :v-adjust -0.05)) + ((string-match-p "\\(Functions?\\)\\|\\(Methods?\\)\\|\\(Constructors?\\)[:)]" cand) + (all-the-icons-faicon "cube" :height 0.95 :v-adjust -0.05 :face 'all-the-icons-purple)) + ((string-match-p "\\(Class\\)\\|\\(Structs?\\)[:)]" cand) + (all-the-icons-material "settings_input_component" :height 0.9 :v-adjust -0.15 :face 'all-the-icons-orange)) + ((string-match-p "Interfaces?[:)]" cand) + (all-the-icons-material "share" :height 0.95 :v-adjust -0.2 :face 'all-the-icons-lblue)) + ((string-match-p "Modules?[:)]" cand) + (all-the-icons-material "view_module" :height 0.95 :v-adjust -0.15 :face 'all-the-icons-lblue)) + ((string-match-p "Packages?[:)]" cand) + (all-the-icons-faicon "archive" :height 0.9 :v-adjust -0.05 :face 'all-the-icons-silver)) + (t (all-the-icons-octicon "tag" :height 0.95 :v-adjust 0 :face 'all-the-icons-blue)))))))) + +(defun all-the-icons-ivy-rich-bookmark-icon (cand) + "Return bookmark type for CAND." + (when (all-the-icons-ivy-rich-icon-displayable) + (all-the-icons-ivy-rich--format-icon + (let ((file (ivy-rich-bookmark-filename cand))) + (cond + ((null file) + (all-the-icons-material "block" :height 1.0 :v-adjust -0.2 :face 'all-the-icons-ivy-rich-warn-face)) ; fixed #38 + ((file-remote-p file) + (all-the-icons-octicon "radio-tower" :height 0.8 :v-adjust 0.01)) + ((not (file-exists-p file)) + (all-the-icons-material "block" :height 1.0 :v-adjust -0.2 :face 'all-the-icons-ivy-rich-error-face)) + ((file-directory-p file) + (all-the-icons-octicon "file-directory" :height 0.9 :v-adjust 0.01)) + (t (all-the-icons-icon-for-file (file-name-nondirectory file) :height 0.9 :v-adjust 0.0))))))) + +(defun all-the-icons-ivy-rich-settings-icon (_cand) + "Display settings icon for CAND in `ivy-rich'." + (when (all-the-icons-ivy-rich-icon-displayable) + (all-the-icons-ivy-rich--format-icon + (all-the-icons-octicon "settings" :height 0.9 :v-adjust -0.01 :face 'all-the-icons-lblue)))) + +(defun all-the-icons-ivy-rich-charset-icon (_cand) + "Display charset icon for CAND in `ivy-rich'." + (when (all-the-icons-ivy-rich-icon-displayable) + (all-the-icons-ivy-rich--format-icon + (all-the-icons-faicon "table" :height 0.9 :v-adjust -0.05 :face 'all-the-icons-lblue)))) + +(defun all-the-icons-ivy-rich-coding-system-icon (_cand) + "Display coding system icon for CAND in `ivy-rich'." + (when (all-the-icons-ivy-rich-icon-displayable) + (all-the-icons-ivy-rich--format-icon + (all-the-icons-faicon "table" :height 0.9 :v-adjust -0.05 :face 'all-the-icons-purple)))) + +(defun all-the-icons-ivy-rich-lang-icon (_cand) + "Display language icon in `ivy-rich'." + (when (all-the-icons-ivy-rich-icon-displayable) + (all-the-icons-ivy-rich--format-icon + (all-the-icons-faicon "language" :height 0.9 :v-adjust -0.05 :face 'all-the-icons-lblue)))) + +(defun all-the-icons-ivy-rich-input-method-icon (_cand) + "Display input method icon in `ivy-rich'." + (when (all-the-icons-ivy-rich-icon-displayable) + (all-the-icons-ivy-rich--format-icon + (all-the-icons-faicon "keyboard-o" :height 0.9 :v-adjust -0.05 :face 'all-the-icons-lblue)))) + +(defun all-the-icons-ivy-rich-grep-file-icon (cand) + "Display file icon for CAND in `ivy-rich'. +Support`counsel-ack', `counsel-ag', `counsel-pt' and `counsel-rg', etc." + (when (or (string-match "\\(.+\\):\\([0-9]+\\):\\(.+\\)" cand) + (string-match "\\(.+\\):\\(.+\\)(\\(.+\\))" cand)) + (all-the-icons-ivy-rich-file-icon (match-string 1 cand)))) + +(defun all-the-icons-ivy-rich-link-icon (cand) + "Display link icon in `ivy-rich'." + (if (string-prefix-p "#" cand) + (all-the-icons-faicon "anchor" :height 0.8 :v-adjust -0.05 :face 'all-the-icons-green) + (all-the-icons-material "link" :height 1.0 :v-adjust -0.2 :face 'all-the-icons-blue))) + +(defun all-the-icons-ivy-rich-key-icon (_cand) + "Display key icon in `ivy-rich'." + (when (all-the-icons-ivy-rich-icon-displayable) + (all-the-icons-ivy-rich--format-icon + (all-the-icons-octicon "key" :height 0.8 :v-adjust -0.05)))) + + +;; +;; Modes +;; + +(defvar all-the-icons-ivy-rich-display-transformers-old-list ivy-rich-display-transformers-list) + +;;;###autoload +(define-minor-mode all-the-icons-ivy-rich-mode + "Better experience with icons for ivy." + :lighter nil + :global t + (if all-the-icons-ivy-rich-mode + (progn + (add-hook 'minibuffer-setup-hook #'all-the-icons-ivy-rich-minibuffer-align-icons) + (advice-add #'ivy-posframe--display :after #'all-the-icons-ivy-rich-ivy-posframe-align-icons) + (global-set-key [remap kill-buffer] #'all-the-icons-ivy-rich-kill-buffer) + (setq ivy-rich-display-transformers-list all-the-icons-ivy-rich-display-transformers-list)) + (progn + (remove-hook 'minibuffer-setup-hook #'all-the-icons-ivy-rich-minibuffer-align-icons) + (advice-remove #'ivy-posframe--display #'all-the-icons-ivy-rich-ivy-posframe-align-icons) + (global-unset-key [remap kill-buffer]) + (setq ivy-rich-display-transformers-list all-the-icons-ivy-rich-display-transformers-old-list))) + (ivy-rich-reload)) + +;;;###autoload +(defun all-the-icons-ivy-rich-reload () + "Reload `all-the-icons-ivy-rich'." + (interactive) + (when all-the-icons-ivy-rich-mode + (all-the-icons-ivy-rich-mode -1) + (all-the-icons-ivy-rich-mode 1) + (message "Reload all-the-icons-ivy-rich"))) + +(provide 'all-the-icons-ivy-rich) + +;;; all-the-icons-ivy-rich.el ends here diff --git a/lisp/my/my.el b/lisp/my/my.el index 2adde182..66a7760d 100644 --- a/lisp/my/my.el +++ b/lisp/my/my.el @@ -57,6 +57,12 @@ [[help:kill-line][Cut rest of line]] ........... =C-k= [[move-line-down][Move line down]] .......... =M-down= [[help:indent-rigidly][Indent lines]] ........... =C-x= =TAB= + *Help* + [[help:helpful-at-point][Symbol at point]] ........ =C-c= =C-d= [[help:describe-variable][Variable]] ................. =C-h= =v= + [[help:helpful-command][Commands]] ................. =C-h= =C= [[help:helpful-variable][Variable (extended)]] ...... =C-h= =V= + [[help:describe-function][Functions]] ................ =C-h= =f= [[help:describe-key][Key]] ...................... =C-h= =k= + [[help:helpful-function][Functions (extended)]] ..... =C-h= =F= [[help:helpful-key][Key (extended)]] ........... =C-h= =K= + *Multiple cursors* [[help:mc/mark-all-dwim][Mark all at point]] .... =M-m= =s= =m= =a= , Jump to next cursor ...... =C-v= , (un)hide other lines ..... =C-'= , Jump to previous cursor .. =M-v= @@ -115,8 +121,14 @@ - [[help:eval-print-last-sexp][last to buffer]] [[help:kill-sexp][Cut expression]] ........... =C-M-k= [[help:mark-sexp][Mark expression]] .......... =C-M-@= [[help:backward-kill-sexp][Cut last expression]] . =C-M-backsp= + +IBuffer + + [[help:ibuffer-filter-by-unsaved][Filter unsaved files]] ....... =/= =u= [[help:ibuffer-filter-disable][Disable filter]] ............. =/= =/= + ") (my-org-help-mode) + (when (featurep 'org-appear) (org-appear-mode -1)) (goto-char (point-min)) (local-set-key (kbd "q") 'kill-buffer-and-window) (local-set-key (kbd "C-g") 'kill-buffer-and-window) diff --git a/settings/completion-settings.el b/settings/completion-settings.el index cb12d9ba..7a157829 100644 --- a/settings/completion-settings.el +++ b/settings/completion-settings.el @@ -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. - ("" . 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) - ;; (" f" . describe-function) ;; counsel-describe-function, not set bc of helpful.el - ;; (" v" . describe-variable) ;; counsel-describe-variable, net set bc of helpful.el - (" l" . find-library) ;; find-library works better with counsel as counsel-find-library - (" 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) + ;; (" i" . counsel-info-lookup-symbol) ;; info-lookup-symbol see helpful-symbol (" u" . counsel-unicode-char) (" j" . counsel-set-variable) ;; Ivy-based interface to shell and system tools diff --git a/settings/general-settings.el b/settings/general-settings.el index bf242d2d..ff242861 100644 --- a/settings/general-settings.el +++ b/settings/general-settings.el @@ -61,14 +61,15 @@ t)))) (use-package ibuf-ext - :defer t + :after (ibuffer) + :bind ((:map ibuffer-mode-map + (("/ u" . ibuffer-filter-by-unsaved)))) :config (define-ibuffer-filter unsaved "Toggle current view to buffers whose file is unsaved." (:description "file is unsaved") (with-current-buffer buf - (and buffer-file-name (buffer-modified-p)))) - (define-key ibuffer-mode-map (kbd "/ u") 'ibuffer-filter-by-unsaved)) + (and buffer-file-name (buffer-modified-p))))) ;; recentf stuff (use-package recentf @@ -314,32 +315,48 @@ Version 2016-07-13" ;; A better *Help* buffer (use-package helpful + ;;:after counsel :bind (;; Note that the built-in `describe-function' includes both functions ;; and macros. `helpful-function' is functions only, so we provide ;; `helpful-callable' as a drop-in replacement to include `helpful-macro'. - ("C-h f" . describe-function) - ;; ("C-h f" . helpful-callable) - ("C-h v" . describe-variable) - ;; ("C-h v" . helpful-variable) - ("C-h k" . helpful-key) + + ;; ("C-h f" . helpful-callable) ;; C-h f default describe-function + ;; ("C-h v" . helpful-variable) ;; C-h v default describe-variable + ;; ("C-h k" . helpful-key) ;; C-h k default describe-key + ;; Lookup the current symbol at point. C-c C-d is a common keybinding ;; for this in lisp modes. ("C-c C-d" . helpful-at-point) + ;; Look up *F*unctions (excludes macros). ;; By default, C-h F is bound to `Info-goto-emacs-command-node'. Helpful ;; already links to the manual, if a function is referenced there. - ("C-h F" . helpful-function) + ;; ("C-h F" . helpful-function) + ;; Look up functions including macros (like `describe-function'). + ("C-h F" . helpful-callable) + ;; ("C-h F" . counsel-describe-function) ;; calls helpful-callable, see below + + ;; Look up *K*eys. + ;; By default, C-h K is bound to `Info-goto-emacs-key-command-node'. + ;; Helpful already links to the manual, if a key is referenced there. + ("C-h K" . helpful-key) + + ;; Look up *V*ariable. + ("C-h V" . helpful-variable) + ;; ("C-h V" . counsel-describe-variable) ;; calls helpful-vraiable, see below + ;; Look up *C*ommands. ;; By default, C-h C is bound to describe `describe-coding-system'. I ;; don't find this very useful, but it's frequently useful to only ;; look at interactive functions. ("C-h C" . helpful-command)) :config - (with-eval-after-load 'ivy - ;; Ivy users can use Helpful with counsel commands: - (setq counsel-describe-function-function #'helpful-callable) - (setq counsel-describe-variable-function #'helpful-variable))) + ;; (with-eval-after-load 'ivy + ;; ;; Ivy users can use Helpful with counsel commands: + ;; (setq counsel-describe-function-function #'helpful-callable) + ;; (setq counsel-describe-variable-function #'helpful-variable)) + ) ;; ;; keyboard @@ -764,8 +781,12 @@ Version 2016-07-13" )) (easy-menu-define my-org-minor-mode-menu nil "My Org Minor Mode Menu" '("Org Minor Mode / Toggles" :visible (eq major-mode 'org-mode) + ["Org Appear" org-appear-mode + :style toggle :selected org-appear-mode :help "org-appear-mode"] ["Org Fancy Priorities [Ⓟ]" org-fancy-priorities-mode :style toggle :selected org-fancy-priorities-mode :help "org-sticky-header-mode"] + ["Org Indent" org-indent-mode + :style toggle :selected org-indent-mode :help "org-indent-mode"] ["Org Latex Remove Logfiles" (setq org-latex-remove-logfiles (not org-latex-remove-logfiles)) :style toggle :selected org-latex-remove-logfiles :help "org-latex-remove-logfiles"] ["Org Link Descriptive" org-toggle-link-display diff --git a/settings/gui-settings.el b/settings/gui-settings.el index 2e4372ad..f735563f 100644 --- a/settings/gui-settings.el +++ b/settings/gui-settings.el @@ -181,6 +181,7 @@ DISPLAY-START: `integer', e.g. 3820" (use-package all-the-icons :defer t + :if (display-graphic-p) :config (when (and (not (my-font-installed-p "all-the-icons")) (window-system)) @@ -197,32 +198,59 @@ DISPLAY-START: `integer', e.g. 3820" (setq dashboard-set-file-icons t) (setq dashboard-set-navigator t) (setq dashboard-startup-banner 'logo) - (setq dashboard-navigator-buttons - ;; list of lines having list of elements - ;; element: (icon title help action face prefix suffix) - `(;; 1st line custom views - (("" "Custom Views:" "custom views" nil default "" "") - (,(all-the-icons-fileicon "elisp" :height 1.0 :v-adjust -0.1) "ELisp" "my-view-elisp" (lambda (&rest _) (my-tab-view-elisp)) ) - (,(all-the-icons-alltheicon "python" :height 1.0 :v-adjust 0.0) "Python" "my-view-python" (lambda (&rest _) (my-tab-view-python)) ) - (,(all-the-icons-alltheicon "script" :height 1.0 :v-adjust 0.0) "Shell" "my-view-shell" (lambda (&rest _) (my-tab-view-shell)) ) - (,(all-the-icons-octicon "file-media" :height 1.0 :v-adjust 0.0) "Gnuplot" "my-view-gnuplot" (lambda (&rest _) (my-tab-view-gnuplot)) ) - (,(all-the-icons-octicon "file-pdf" :height 1.0 :v-adjust 0.0) "Org PDF" "my-view-org-pdf" (lambda (&rest _) (my-tab-view-org-pdf)) )) - ;; 2nd line major modes 1st part - (("" "Major Modes:" "major modes" nil default "" "") - ("" "Deft" "deft" (lambda (&rest _) (deft)) ) - ("" "EShell" "eshell-mode" (lambda (&rest _) (eshell)) ) - ("" "Magit" "magit" (lambda (&rest _) (magit)) ) - (,(all-the-icons-octicon "mail" :height 1.0 :v-adjust 0.0) "Mu4e" "mu4e" (lambda (&rest _) (mu4e)) ) - (,(all-the-icons-octicon "mail" :height 1.0 :v-adjust 0.0) "Notmuch" "notmuch" (lambda (&rest _) (notmuch)) ) - ("" "Org-Brain" "org-brain-visualize" (lambda (&rest _) (call-interactively 'org-brain-visualize)) )) - ;; 3rd line major modes 2nd part - (("" "Org-Drill" "org-drill" (lambda (&rest _) (org-drill)) ) - ("" "Powershell" "powershell" (lambda (&rest _) (powershell)) ) - ("" "Shell" "shell" (lambda (&rest _) (shell)) ) - ("" "Treemacs" "treemacs" (lambda (&rest _) (treemacs)) )) - ;; 4th line infos - ((,(all-the-icons-material "help_outline" :height 1.1 :v-adjust -0.15) "Help" "?/h" (lambda (&rest _) (describe-mode)) nil) - (,(all-the-icons-material "refresh" :height 1.1 :v-adjust -0.15) "Restart" "restart-emacs" (lambda (&rest _) (restart-emacs)) nil)))) + (if (display-graphic-p) + (setq dashboard-navigator-buttons + ;; list of lines having list of elements + ;; element: (icon title help action face prefix suffix) + `(;; 1st line custom views + (("" "Custom Views:" "custom views" nil default "" "") + (,(all-the-icons-fileicon "elisp" :height 1.0 :v-adjust -0.1) "ELisp" "my-view-elisp" (lambda (&rest _) (my-tab-view-elisp)) ) + (,(all-the-icons-alltheicon "python" :height 1.0 :v-adjust 0.0) "Python" "my-view-python" (lambda (&rest _) (my-tab-view-python)) ) + (,(all-the-icons-alltheicon "script" :height 1.0 :v-adjust 0.0) "Shell" "my-view-shell" (lambda (&rest _) (my-tab-view-shell)) ) + (,(all-the-icons-octicon "file-media" :height 1.0 :v-adjust 0.0) "Gnuplot" "my-view-gnuplot" (lambda (&rest _) (my-tab-view-gnuplot)) ) + (,(all-the-icons-octicon "file-pdf" :height 1.0 :v-adjust 0.0) "Org PDF" "my-view-org-pdf" (lambda (&rest _) (my-tab-view-org-pdf)) )) + ;; 2nd line major modes 1st part + (("" "Major Modes:" "major modes" nil default "" "") + ("" "Deft" "deft" (lambda (&rest _) (deft)) ) + ("" "EShell" "eshell-mode" (lambda (&rest _) (eshell)) ) + ("" "Magit" "magit" (lambda (&rest _) (magit)) ) + (,(all-the-icons-octicon "mail" :height 1.0 :v-adjust 0.0) "Mu4e" "mu4e" (lambda (&rest _) (mu4e)) ) + (,(all-the-icons-octicon "mail" :height 1.0 :v-adjust 0.0) "Notmuch" "notmuch" (lambda (&rest _) (notmuch)) ) + ("" "Org-Brain" "org-brain-visualize" (lambda (&rest _) (call-interactively 'org-brain-visualize)) )) + ;; 3rd line major modes 2nd part + (("" "Org-Drill" "org-drill" (lambda (&rest _) (org-drill)) ) + ("" "Powershell" "powershell" (lambda (&rest _) (powershell)) ) + ("" "Shell" "shell" (lambda (&rest _) (shell)) ) + ("" "Treemacs" "treemacs" (lambda (&rest _) (treemacs)) )) + ;; 4th line infos + ((,(all-the-icons-material "help_outline" :height 1.1 :v-adjust -0.15) "Help" "?/h" (lambda (&rest _) (describe-mode)) nil) + (,(all-the-icons-material "refresh" :height 1.1 :v-adjust -0.15) "Restart" "restart-emacs" (lambda (&rest _) (restart-emacs)) nil)))) + (setq dashboard-navigator-buttons + ;; list of lines having list of elements + ;; element: (icon title help action face prefix suffix) + `(;; 1st line custom views + (("" "Custom Views:" "custom views" nil default "" "") + ("" "ELisp" "my-view-elisp" (lambda (&rest _) (my-tab-view-elisp)) ) + ("" "Python" "my-view-python" (lambda (&rest _) (my-tab-view-python)) ) + ("" "Shell" "my-view-shell" (lambda (&rest _) (my-tab-view-shell)) ) + ("" "Gnuplot" "my-view-gnuplot" (lambda (&rest _) (my-tab-view-gnuplot)) ) + ("" "Org PDF" "my-view-org-pdf" (lambda (&rest _) (my-tab-view-org-pdf)) )) + ;; 2nd line major modes 1st part + (("" "Major Modes:" "major modes" nil default "" "") + ("" "Deft" "deft" (lambda (&rest _) (deft)) ) + ("" "EShell" "eshell-mode" (lambda (&rest _) (eshell)) ) + ("" "Magit" "magit" (lambda (&rest _) (magit)) ) + ("" "Mu4e" "mu4e" (lambda (&rest _) (mu4e)) ) + ("" "Notmuch" "notmuch" (lambda (&rest _) (notmuch)) ) + ("" "Org-Brain" "org-brain-visualize" (lambda (&rest _) (call-interactively 'org-brain-visualize)) )) + ;; 3rd line major modes 2nd part + (("" "Org-Drill" "org-drill" (lambda (&rest _) (org-drill)) ) + ("" "Powershell" "powershell" (lambda (&rest _) (powershell)) ) + ("" "Shell" "shell" (lambda (&rest _) (shell)) ) + ("" "Treemacs" "treemacs" (lambda (&rest _) (treemacs)) )) + ;; 4th line infos + (("" "Help" "?/h" (lambda (&rest _) (describe-mode)) nil) + ("" "Restart" "restart-emacs" (lambda (&rest _) (restart-emacs)) nil))))) (setq dashboard-items '((recents . 10) (bookmarks . 5) ;; (projects . 5) diff --git a/settings/org-settings.el b/settings/org-settings.el index b627f04e..d52eede8 100644 --- a/settings/org-settings.el +++ b/settings/org-settings.el @@ -332,7 +332,9 @@ Example defines (setq org-appear-autoemphasis t) ;; toggle emphasis markers, t by default, needs `org-hide-emphasis-markers' active (setq org-appear-autolinks t) ;; toogle links, needs `org-link-descriptive' active (setq org-appear-autosubmarkers t) ;; toogle subscripts and superscripts: ^3 -> ³, needs `org-pretty-entities' active - (setq org-appear-autokeywords t)) ;; toogle keywords: #+TITLE: foo -> foo, needs `org-hidden-keywords' active + (setq org-appear-autokeywords t) ;; toogle keywords: #+TITLE: foo -> foo, needs `org-hidden-keywords' active + (setq org-appear-delay 0.5) ;; with delay a mouse click open a link directly and holding down shows the description + (setq org-appear-trigger 'always)) (use-package org-brain ;; uses org-id If you find that org-brain is missing entries, or list entries which doesn’t exist, try using M-x org-brain-update-id-locations, which syncs the org-brain entries with the org-id caching system. :commands (org-brain-visualize) @@ -556,7 +558,13 @@ Suggest the URL title as a description for resource." (setq org-roam-directory (expand-file-name "~/Sync/workspace/emacs/org-roam")) ;; check if folder exists (setq org-roam-db-location (concat user-cache-directory "org-roam.db")) ;; (setq org-roam-graph-viewer nil) + (with-eval-after-load 'which-key + (which-key-add-key-based-replacements + "C-c r" "org-roam")) :config + ;; when browsing notes display also tags + ;; set tags `org-roam-tag-add': file: #+FILETAGS: :tag1:...: / * headline :tag1:...: + (setq org-roam-node-display-template "${title} ${tags}") (org-roam-db-autosync-mode) ;; sync on file change ;;(org-roam-setup) ) @@ -564,9 +572,14 @@ Suggest the URL title as a description for resource." (use-package org-roam-graph :bind (("C-c r g" . org-roam-graph))) -(use-package org-roam-ui +(use-package org-roam-timestamps :after (org-roam) + :config + (org-roam-timestamps-mode)) + +(use-package org-roam-ui :commands (org-roam-ui-mode) + :bind (("C-c r u" . org-roam-ui-mode)) :config (setq org-roam-ui-sync-theme t) (setq org-roam-ui-follow t) @@ -583,24 +596,36 @@ Suggest the URL title as a description for resource." (use-package org-superstar ;; formerly - ;;(require 'org-bullets) - ;;(add-hook 'org-mode-hook 'org-bullets-mode) + ;; after changing settings run `org-superstar-restart' :hook (org-mode . org-superstar-mode) ;; defers the loading. :config - (setq org-superstar-leading-bullet " ·") ;; " ․" " ·" " ⚫" or to hide: ?\s + ;; headlines + (setq org-superstar-leading-bullet " ·") ;; " ․" " ·" " ⚫" or to hide: ?\s (without quotation marks) + (setq org-superstar-remove-leading-stars nil) ;; to remove the indentation, needs org-superstar-leading-bullet set to ?\s + (setq org-superstar-headline-bullets-list + '(?◉ + ?○ + ?✸ + ?✿)) + ;; (setq org-superstar-leading-bullet ?\s) + ;; (setq org-superstar-leading-bullet "\u200b") + ;; (setq org-superstar-headline-bullets-list '(?\s)) + ;; (setq org-superstar-headline-bullets-list '("\u200b")) + ;; (setq org-superstar-headline-bullets-list '(?․)) + + ;; items (setq org-superstar-prettify-item-bullets t) ;; can cause slowdown when using a lot of lists (thousands), run command org-superstar-toggle-lightweight-list or set this variable to nil or see hack on the source web page - (setq org-superstar-remove-leading-stars nil) ;; to remove the indentation - (setq org-superstar-special-todo-items t) ;; using symbols defined in org-superstar-todo-bullet-alist - ;; (setq org-superstar-todo-bullet-alist - ;; '(("TODO" . 9744) - ;; ("WAIT" . 9744) - ;; ("DONE" . 9745) - ;; ("CANC" . 9745))) - (setq org-superstar-todo-bullet-alist - '(("TODO" . 9744) - ("WAIT" . 9744) - ("DONE" . 9744) - ("CANC" . 9744))) + (setq org-superstar-item-bullet-alist + '((?* . ?•) + (?+ . ?➤) + (?- . ?–))) + (setq org-superstar-special-todo-items t) ;; using symbols defined in org-superstar-todo-bullet-alist + (setq org-superstar-todo-bullet-alist ;; ☐ ☑ + '(("TODO" . ?☐) + ("WAIT" . ?☐) + ("DONE" . ?☐) + ("CANC" . ?☐))) + (set-face-attribute 'org-superstar-leading nil :foreground "#42444a")) ;; "#42444a" (use-package org-table diff --git a/settings/which-key-settings.el b/settings/which-key-settings.el index 3463a52b..76b43598 100644 --- a/settings/which-key-settings.el +++ b/settings/which-key-settings.el @@ -19,6 +19,7 @@ (setq which-key-dont-use-unicode t)) :config (which-key-mode) + (setq which-key-allow-multiple-replacements t) (unless (daemonp) ;; problem if using unicodes and emacsclient, the last line of which-key side-frame is cropped. (add-to-list 'which-key-replacement-alist '(("TAB" . nil) . ("↹" . nil))) @@ -44,6 +45,17 @@ ;; formaly which-key-declare-prefixes ;; blob/c7a103a772d808101d7635ec10f292ab9202d9ee/layers/%2Bdistributions/spacemacs-base/packages.el (which-key-add-key-based-replacements + "C-c !" "flyspell" + "C-c ," "semantic/senator" + "C-x RET" "coding-system" + "C-x 8" "char" + "C-x X" "edebug" + "C-x a" "abbrev" + "C-x n" "narrow" + "C-x p" "project" + "C-x r" "register/rectangle/bookmark" + "C-x t" "tab" + "C-x w" "window" "M-m" '("root" . "My root") "M-m a" "applications" "M-m b" "buffers"