From fa7024e33dda6cf7a6f688b2ac7510b33bae5a94 Mon Sep 17 00:00:00 2001 From: Marcel Kapfer Date: Tue, 3 Jan 2023 16:27:08 +0100 Subject: [PATCH 1/4] =?UTF-8?q?=F0=9F=90=9B=20tab-bar-helpers:=20Fix=20org?= =?UTF-8?q?-agenda=20key=20for=20agenda=20tab=20creation?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/mmk2410-tab-bar-helpers.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/mmk2410-tab-bar-helpers.el b/packages/mmk2410-tab-bar-helpers.el index 341466c..10285d2 100644 --- a/packages/mmk2410-tab-bar-helpers.el +++ b/packages/mmk2410-tab-bar-helpers.el @@ -48,7 +48,7 @@ (mmk2410/tab-bar-switch-or-create "Agenda" #'(lambda () - (org-agenda nil "c") + (org-agenda nil "d") (sit-for 1) (split-window-horizontally) (other-window 1) From e54698d0486b58cd555e7ae7232dcbd43a84c246 Mon Sep 17 00:00:00 2001 From: Marcel Kapfer Date: Tue, 3 Jan 2023 16:28:09 +0100 Subject: [PATCH 2/4] =?UTF-8?q?=E2=9C=A8=20Hide=20commands=20in=20M-x=20th?= =?UTF-8?q?at=20don't=20work=20in=20the=20current=20mode?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config.org | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/config.org b/config.org index 3af0cc2..8ef42bb 100644 --- a/config.org +++ b/config.org @@ -258,6 +258,15 @@ Show filesize human readable. (setq-default dired-listing-switches "-alh") #+end_src +** M-x customizations + +Hide commands in M-x which do not work in the current mode. + +#+begin_src emacs-lisp +(setq read-extended-command-predicate + #'command-completion-default-include-p) +#+end_src + * Package configuration ** General configuration From a157d0b9273e245486cc2a7a45a385b98756af2f Mon Sep 17 00:00:00 2001 From: Marcel Kapfer Date: Tue, 3 Jan 2023 16:28:53 +0100 Subject: [PATCH 3/4] =?UTF-8?q?=F0=9F=92=84=20Switch=20to=20ef-themes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config.org | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/config.org b/config.org index 8ef42bb..78a267f 100644 --- a/config.org +++ b/config.org @@ -434,6 +434,7 @@ Source: [[https://github.com/greduan/emacs-theme-gruvbox][Github: greduan/emacs- #+begin_src emacs-lisp (use-package gruvbox-theme + :disabled t :config (load-theme 'gruvbox-light-hard t)) #+end_src @@ -471,11 +472,9 @@ Installing and enabling ef-themes. #+begin_src emacs-lisp (use-package ef-themes - :disabled t :init (setq ef-themes-to-toggle '(ef-light ef-dark)) - (setq ef-themes-mixed-fonts t - ef-themes-variable-pitch-ui t) + (setq ef-themes-mixed-fonts t) (setq ef-themes-headings '((0 . (variable-pitch light 1.9)) (1 . (variable-pitch light 1.8)) @@ -505,8 +504,8 @@ Add a slight transparency to the frames. Code provided by David Wilson / System During the last weeks I got used to using a light theme during daytime and a dark theme during nighttime. Luckily the themes based on Atom One are to my liking and the doom package provides a dark and light variant. One thing that was difficult with Emacs was actually switching theme since it involved disabling all current ones (for some reason on one machine there are two enabled while on the other machine its only one) and then loading the correct one. These functions try to make that process easier, at least for now. The long-term goal is to automatically change the theme based on the current system-wide setting. #+begin_src emacs-lisp -(setq mmk2410/theme-night 'gruvbox-dark-hard) -(setq mmk2410/theme-day 'gruvbox-light-hard) +(setq mmk2410/theme-night 'ef-dark) +(setq mmk2410/theme-day 'ef-light) (defun mmk2410/switch-theme (theme) (mapcar 'disable-theme custom-enabled-themes) @@ -538,6 +537,7 @@ I'm currently trying doom-modeline instead of telephone-line. #+begin_src emacs-lisp (use-package doom-modeline + :disabled t :init (doom-modeline-mode 1) :config (setq doom-modeline-icon t)) #+end_src From e6617a7b33461e870f62a2a3ceb50a7c314d3be7 Mon Sep 17 00:00:00 2001 From: Marcel Kapfer Date: Tue, 3 Jan 2023 16:29:21 +0100 Subject: [PATCH 4/4] =?UTF-8?q?=E2=9C=A8=20Switch=20to=20vertico,=20orderl?= =?UTF-8?q?ess,=20marginalia,=20consult,=20and=20embark?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Instead of counsel, ivy, and swiper --- config.org | 151 +++++++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 129 insertions(+), 22 deletions(-) diff --git a/config.org b/config.org index 78a267f..5732e67 100644 --- a/config.org +++ b/config.org @@ -780,38 +780,145 @@ Source: [[https://github.com/Alexander-Miller/treemacs][Alexander-Miller/treemac :after (treemacs evil)) #+end_src -** counsel, ivy and swiper +** vertico -Emacs package collection (ivy, swiper and counsel) of flexible, simple tools for minibuffer completion. +Vertico is a minimal completion UI that uses core Emacs functionality whenever possible. -Source: [[https://github.com/abo-abo/swiper][GitHub: abo-abo/swiper]] +[[https://github.com/minad/vertico][GitHub: minad/vertico]] #+begin_src emacs-lisp -(use-package counsel - :bind ("M-x" . counsel-M-x)) - -(use-package ivy - :after (counsel) - :diminish (ivy-mode) - :config - (ivy-mode t) - (setq ivy-use-virtual-buffers t) - (setq ivy-count-format "(%d/%d) ") - :bind - (("C-c g" . counsel-git) - ("C-s" . swiper) - ("C-r" . swiper))) +(use-package vertico + :init + (vertico-mode) + (setq vertico-scroll-margin 0) + (setq vertico-resize t) + (setq vertico-cycle t)) #+end_src -** ivy-rich +** orderless -ivy-rich enhances M-x and similar even more by giving more information directly in the minibuffer. +Emacs completion style that matches multiple regexps in any order -Source: [[https://github.com/Yevgnen/ivy-rich][GitHub: Yevgnen/ivy-rich]] +[[https://github.com/oantolin/orderless][GitHub: oantolin/orderless]] #+begin_src emacs-lisp -(use-package ivy-rich - :init (ivy-rich-mode 1)) +(use-package orderless + :ensure t + :custom + (completion-styles '(orderless basic)) + (completion-category-overrides '((file (styles basic partial-completion))))) +#+end_src + +** marginalia + +Marginalia in the minibuffer. + +[[https://github.com/minad/marginalia][GitHub: minad/marginalia]] + +#+begin_src emacs-lisp +(use-package marginalia + :init + (marginalia-mode) + :bind (:map minibuffer-local-map + ("M-A" . marginalia-cycle))) +#+end_src + +** consult + +#+begin_src emacs-lisp +(use-package consult + ;; Replace bindings. Lazily loaded due by `use-package'. + :bind (;; C-c bindings (mode-specific-map) + ("C-c h" . consult-history) + ("C-c m" . consult-mode-command) + ("C-c k" . consult-kmacro) + ;; C-x bindings (ctl-x-map) + ("C-x M-:" . consult-complex-command) ;; orig. repeat-complex-command + ("C-x b" . consult-buffer) ;; orig. switch-to-buffer + ("C-x 4 b" . consult-buffer-other-window) ;; orig. switch-to-buffer-other-window + ("C-x 5 b" . consult-buffer-other-frame) ;; orig. switch-to-buffer-other-frame + ("C-x r b" . consult-bookmark) ;; orig. bookmark-jump + ("C-x p b" . consult-project-buffer) ;; orig. project-switch-to-buffer + ;; Custom M-# bindings for fast register access + ("M-#" . consult-register-load) + ("M-'" . consult-register-store) ;; orig. abbrev-prefix-mark (unrelated) + ("C-M-#" . consult-register) + ;; Other custom bindings + ("M-y" . consult-yank-pop) ;; orig. yank-pop + ;; M-g bindings (goto-map) + ("M-g e" . consult-compile-error) + ("M-g f" . consult-flymake) ;; Alternative: consult-flycheck + ("M-g g" . consult-goto-line) ;; orig. goto-line + ("M-g M-g" . consult-goto-line) ;; orig. goto-line + ("M-g o" . consult-outline) ;; Alternative: consult-org-heading + ("M-g m" . consult-mark) + ("M-g k" . consult-global-mark) + ("M-g i" . consult-imenu) + ("M-g I" . consult-imenu-multi) + ;; M-s bindings (search-map) + ("M-s d" . consult-find) + ("M-s D" . consult-locate) + ("M-s g" . consult-grep) + ("M-s G" . consult-git-grep) + ("M-s r" . consult-ripgrep) + ("M-s l" . consult-line) + ("M-s L" . consult-line-multi) + ("M-s m" . consult-multi-occur) + ("M-s k" . consult-keep-lines) + ("M-s u" . consult-focus-lines) + ;; Isearch integration + ("M-s e" . consult-isearch-history) + :map isearch-mode-map + ("M-e" . consult-isearch-history) ;; orig. isearch-edit-string + ("M-s e" . consult-isearch-history) ;; orig. isearch-edit-string + ("M-s l" . consult-line) ;; needed by consult-line to detect isearch + ("M-s L" . consult-line-multi) ;; needed by consult-line to detect isearch + ;; Minibuffer history + :map minibuffer-local-map + ("M-s" . consult-history) ;; orig. next-matching-history-element + ("M-r" . consult-history)) ;; orig. previous-matching-history-element + :hook (completion-list-mode . consult-preview-at-point-mode) + :init + (setq register-preview-delay 0.5 + register-preview-function #'consult-register-format) + (advice-add #'register-preview :override #'consult-register-window) + (setq xref-show-xrefs-function #'consult-xref + xref-show-definitions-function #'consult-xref) + :config + (consult-customize + consult-theme :preview-key '(:debounce 0.2 any) + consult-ripgrep consult-git-grep consult-grep + consult-bookmark consult-recent-file consult-xref + consult--source-bookmark consult--source-file-register + consult--source-recent-file consult--source-project-recent-file + :preview-key '(:debounce 0.4 any)) + (setq consult-narrow-key "<")) +#+end_src + +** embark + +Emacs Mini-Buffer Actions Rooted in Keymaps + +[[https://github.com/oantolin/embark][GitHub: oantolin/embark]] + +#+begin_src emacs-lisp +(use-package embark + :bind + (("C-." . embark-act) ;; pick some comfortable binding + ("C-;" . embark-dwim) ;; good alternative: M-. + ("C-h B" . embark-bindings)) ;; alternative for `describe-bindings' + + :init + (setq prefix-help-command #'embark-prefix-help-command) + :config + (add-to-list 'display-buffer-alist + '("\\`\\*Embark Collect \\(Live\\|Completions\\)\\*" + nil + (window-parameters (mode-line-format . none))))) + +(use-package embark-consult + :hook + (embark-collect-mode . consult-preview-at-point-mode)) #+end_src ** avy