Emacs: anything package

This article will describe using anything package which provides changing interactive input to candidate list.

1 Install auto-install package

anything package in M-x package-list-package is not enough. Install auto-install package for installing anything package with M-x auto-install.

This article uses ${HOME}/.elisp as emacs lisp directory. .emacs is as below.

;; emacs lisp directory path
(setq load-path
      (append
       (list
        (expand-file-name "~/.elisp/")
        )
       load-path))

Download auto-install.el from emacswiki.

$ wget http://emacswiki.org/emacs/download/auto-install.el
$ mkdir -p ~/.elisp/
$ mv auto-install.el ~/.elisp/

Add auto-install setting to ${HOME}/.emacs.

;; auto-install for NOT enough packages in package-list-packages
(require 'auto-install)
(add-to-list 'load-path (expand-file-name "~/.elisp/auto-install"))
(setq auto-install-directory "~/.elisp/auto-install/")
(auto-install-compatibility-setup)

2 Install anything package

Run M-x auto-install-batch and type anything.

Extension name: anything

This will download about 10 packages. After download each package, install each package with C-c C-c.

Type C-c C-c to continue; Type C-c C-d for view diff; Type C-c C-q to quit.

3 ${HOME}/.emacs

Load anything-startup package with require. Bind global key for anything-for-files.

;; anything
(require 'anything-startup)
(global-set-key "\C-q" 'anything-for-files)

4 anything-for-files

This is simillar with list-buffers called by C-x C-b.

  • Switch buffer with C-x C-o is unnecessary.
  • Return original buffer with C-g.
  • Recently used files and current directory files.
  • Close buffer with M-D.

0001_anything-for-files.png

5 M-x with anything

M-x will output candidate list. After input "goto-l", you can select candidate list with C-p and C-n.

0002_M-x.png