From c91f3fecc4b655148efbfedc5de2fea829ff70a6 Mon Sep 17 00:00:00 2001 From: Jim Myhrberg Date: Sun, 1 Mar 2020 22:31:16 +0000 Subject: [PATCH] chore(editor): Replace smex with amx package Smex has not been updated since late 2015. Amx was originally a fork of smex, but as since evolved much further into it's own thing. Among other things is supports other completing backends, and ivy with it's fuzzy matching feels rather nice. I'm keeping ido-mode for everything else, but specifically for M-x I'll give ivy a try. --- core/siren-core-modules.el | 2 +- modules/editor/siren-amx.el | 29 +++++++++++++++++++++++++++++ modules/editor/siren-ido.el | 2 +- modules/editor/siren-ivy.el | 19 +++++++++++++++++++ modules/editor/siren-smex.el | 2 +- modules/navigation/siren-helm.el | 1 - 6 files changed, 51 insertions(+), 4 deletions(-) create mode 100644 modules/editor/siren-amx.el create mode 100644 modules/editor/siren-ivy.el diff --git a/core/siren-core-modules.el b/core/siren-core-modules.el index fdbf39c..4f79b36 100644 --- a/core/siren-core-modules.el +++ b/core/siren-core-modules.el @@ -21,6 +21,7 @@ (require 'siren-dash-at-point) ;; Editor +(require 'siren-amx) (require 'siren-browse-kill-ring) (require 'siren-display-fill-column) (require 'siren-display-indentation) @@ -31,7 +32,6 @@ (require 'siren-minions) (require 'siren-mwim) (require 'siren-rainbow) -(require 'siren-smex) (require 'siren-undo-tree) (require 'siren-undohist) diff --git a/modules/editor/siren-amx.el b/modules/editor/siren-amx.el new file mode 100644 index 0000000..71e2677 --- /dev/null +++ b/modules/editor/siren-amx.el @@ -0,0 +1,29 @@ +;;; siren-amx.el --- jimeh's Emacs Siren: amx configuration. + +;;; Commentary: + +;; Replace M-x with the more powerful amx. + +;;; Code: + +(require 'siren-ivy) + +(use-package amx + :bind + ("M-x" . amx) + ("C-x C-m" . amx) + ("C-c C-m" . amx) + ("C-c C-c M-x" . execute-extended-command) + + :custom + (amx-backend 'ivy) + (amx-histroy-lenth 15) + (amx-prompt-string "M-x ") + (amx-save-file (expand-file-name "amx-items" siren-cache-dir)) + (amx-show-key-bindings t) + + :config + (amx-mode +1)) + +(provide 'siren-amx) +;;; siren-amx.el ends here diff --git a/modules/editor/siren-ido.el b/modules/editor/siren-ido.el index ef0ede5..262beb6 100644 --- a/modules/editor/siren-ido.el +++ b/modules/editor/siren-ido.el @@ -21,7 +21,7 @@ (ido-use-faces nil) (ido-use-filename-at-point nil) - :init + :config (ido-mode 1)) (use-package ido-completing-read+ diff --git a/modules/editor/siren-ivy.el b/modules/editor/siren-ivy.el new file mode 100644 index 0000000..569b358 --- /dev/null +++ b/modules/editor/siren-ivy.el @@ -0,0 +1,19 @@ +;;; siren-ivy.el --- jimeh's Emacs Siren: ivy configuration. + +;;; Commentary: + +;; Basic configuration for ivy. + +;;; Code: + +(use-package ivy + :defer t + + :custom + (ivy-use-virtual-buffers nil) + (ivy-count-format "%d ") + (ivy-re-builders-alist '((amx-completing-read-ivy . ivy--regex-fuzzy) + (t . ivy--regex-plus)))) + +(provide 'siren-ivy) +;;; siren-ivy.el ends here diff --git a/modules/editor/siren-smex.el b/modules/editor/siren-smex.el index d46f843..e100699 100644 --- a/modules/editor/siren-smex.el +++ b/modules/editor/siren-smex.el @@ -1,4 +1,4 @@ -;;; siren-smex.el --- jimeh's Emacs Siren: smex. +;;; siren-smex.el --- jimeh's Emacs Siren: smex configuration. ;;; Commentary: diff --git a/modules/navigation/siren-helm.el b/modules/navigation/siren-helm.el index d7e7efa..00a97d1 100644 --- a/modules/navigation/siren-helm.el +++ b/modules/navigation/siren-helm.el @@ -24,7 +24,6 @@ (helm-cleanup . siren-helm--show-treemacs-maybe) :bind - ("M-x" . helm-M-x) ("C-t" . helm-imenu) ("C-c t" . helm-imenu-anywhere) ("C-x C-f" . helm-find-files)