Giter VIP home page Giter VIP logo

amx's Introduction

Amx, an alternative interface for M-x in Emacs

Build Status MELPA

Amx is an alternative interface for M-x in Emacs. It provides several enhancements over the ordinary execute-extended-command, such as prioritizing your most-used commands in the completion list and showing keyboard shortcuts, and it supports several completion systems for selecting commands, such as ido and ivy.

Installation

You can install amx from from MELPA.

If you want to use the ido or ivy backends, you'll need to install the linked packages as well. If you already have these installed and enabled, Amx should use them automatically.

Since Amx is a fork of Smex, it retains compatibility with the format of smex-save-file. If you are migrating from smex to Amx, Amx will automatically load your smex saved history the first time it is used, so all your frequently-used commands will still be sorted at the top.

Usage

To replace regular M-x with Amx, use M-x amx-mode. This will remap execute-extended-command (the command normally run by M-x) to amx. You can verify that Amx is active by checking for keyboard shortcuts in the completion buffer. If you need to turn it off, use M-x amx-mode again. Customize this variable to permananely enable the mode.

Completion backends

Amx currently supports 3 different completion backends: standard Emacs completion, Ido completion, and ivy completion. By default, Amx automatically detects when ido-mode or ivy-mode are enabled, and uses the appropriate backend. So you should generally get the same kind of completion that you're already used to. However, you can also force Amx to use a specific completion system by customizing the variable amx-backend.

Showing keyboard shortcuts for commands

When completing command names, Amx shows the keyboard shortcut for all commands currently bound to a key, so you can find out when there's an easier way to run the command you're looking for. Alternatively, if you know the keyboard shortcut but don't remember the name of the command it's bound to, you can complete based on the keyboard shortcut (this works best with ido or ivy backends). If you don't like this, you can disable it by customizing amx-show-key-bindings.

Getting help for commands

C-h f, while Amx is active, runs describe-function on the currently selected command.

M-. jumps to the definition of the selected command.

C-h w shows the key bindings for the selected command. (Via where-is.)

Show only major mode commands

amx-major-mode-commands runs Amx, limited to commands that are relevant to the active major mode. Note that this command is not bound to any key by default, so if you use it a lot, you should add your own key binding for it.

Show unbound commands

amx-show-unbound-commands shows frequently used commands that have no key bindings.

Persistence between sessions

Amx keeps a file to save its state betweens Emacs sessions. The default path is ~/.emacs.d/amx-items; you can change it by customizing the variable amx-save-file. Unlike Smex, it should be safe to change the save file after loading Amx.

If amx-save-file does not exist but smex-save-file is defined and does exist, Amx will load its state from that file instead. This facilitates migrating from Smex to Amx while retaining all of your saved command history.

Ignoring commands

Certain commands are not very useful to run via M-x. These include commands that only have an effect when bound to certain keys (e.g. self-insert-command), commands that are marked obsolete, and commands meant for mouse interaction. Amx will not present these commands in the list of completions, but just in case, it will still let you enter them if you know their name. You can tell Amx to ignore additional commands by customizing amx-ignored-command-matchers.

Speeding up Amx

There are two features that can cause a noticeable delay (around 1/4 of a second) when running amx: command ignoring and showing key bindings. Generally this delay is not a problem, since you can start typing imediately and Amx will catch up after the short delay. However, if it bothers you, these delays can be greatly reduced by setting one or both of amx-ignored-command-matchers and amx-show-key-bindings to nil.

Running the tests

Amx comes with a test suite. If you want to run it yourself, first install Eldev, then use eldev test to run the tests. Please run this test suite before submitting any pull requests, and note in the pull request whether any of the tests fail.

Relationship to Smex

Amx is a fork of Smex, which appears to no longer be under active development. However, Amx has diverged significantly from Smex and should be considered a separate package. New features include multiple completion backends, showing/completing on key bindings, and hiding irrelevant commands.

Since the last tagged release of Smex was version 3.0, the first release version of Amx is 3.1.

amx's People

Contributors

abo-abo avatar andyleejordan avatar bkudria avatar clemera avatar darwinawardwinner avatar gvol avatar haxney avatar nonsequitur avatar purcell avatar rolandwalker avatar strburst avatar swsnr avatar syohex avatar tarsius avatar timhillgit avatar vspinu avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.