Actually it’s not even $10. It’s free, both as in speech and as in nachos. So in the spirit of fanning both sides of the fire, here’s a quick look at anything.el
for (gasp) Emacs.
Anything.el is most certainly one of Emacs’s killer features. It’s like ido-mode on steroids, but without the rage or shrinking testicles.
It’s been described as Quicksilver for Emacs, which I guess is kinda true, but that’s not the way I use it.
The documentation for the anything
function says it all:
Select anything. In Lisp program, some optional arguments can be used.
Tomas has a poet’s soul, and what he means when he says “some optional arguments can be used” is that you can go bat-shit crazy with what goes in, what gets displayed, what comes out, what happens then, where am I, why am I naked?
But before we get there, let’s cover the basics, shall we?
Installation
M-x auto-install-batch
is one option. auto-install.el
is here and it’s super handy. Ask for the “anything” package, and you’ll get anything.el, anything-config.el, and anything-match-plugin.el. You’ll want all three. Of course you can just follow the links and install the files yourself if that’s your thing.
Once you’ve got these boys somewhere handy, just
(add-to-list 'load-path "/path/to/anything/folder") (require 'anything-match-plugin) (require 'anything-config)
Eval all that, and you’re ready to go.
Usage
M-x anything
Now we’re in the *anything*
buffer, and you can have a merry time typing away at any part of the filename or filepath you’re after. Behold as anything.el
starts chipping away at the options. C-n
and C-p
behave as expected. Left and right arrow keys move you to different groups of things.
Because you’ve got the match plugin installed, you get some bonus features. Say you start typing your filename, and you’ve still got 50 matches. Add a space and you’re in a whole new pattern group. So now you start typing something unique in the path, and viola, you’re looking at a full-on double rainbow.
Once you’ve found your victim, hit enter to do the default thing, which is usually the thing you want. If you’ve got eccentric taste, hit tab instead for a list of other things you can do with the thing you’ve selected. Thing.
More Youthage
Things get real crazy when you crack open anything-config.el
. Go ahead and anything-imenu
up in there and type in “anything”. Here’s a list of custom anything.el
commands you get for free. Who needs nachos? You’ll have a riotous time mapping keys to the bazillion-ish anything.el
commands the anything-config.el
crew have put together for you.
For my part, C-x b
is anything-mini
, which serves up a combination of buffers and recent files. C-x C-i
is anything-imenu
, which is awesome wearing a hat. C-x f
is anything for recent files, and C-x C-f
is ido-find-file
, which still trumps anything.el
for navigating about file systems.
But wait, there’s more!
You remember that part about going guano building your own who-knows-whats on top of anything.el
? It’s anything.el
‘s finest suit, but alas, a subject for another post.
Pingback: Anything.else | MetaSandwich
who needs nachos indeed?
Thanks for that I’ll give it a go, falls nicely into my belief that my
text editordevelopment support environment should work in the background days and nights just waiting for the moment I press that button to second guess me, if it takes it three days to prepare the buffers and saves me half a second so be it 🙂Not entirely sure what that means, but thanks for reading!
Thanks for taking the time to write these posts on Anything. Much better than any other guides I found online.
Also, from the screenshots, your color-theme looks awesome. Which one are you using?
That’s a home brew based on gvim’s default dark theme. Here’s the gist: https://gist.github.com/759001. You’ll need
color-theme.el
, of course.This is a very nice tutorial for anything – I finally understood a bit of what it was. Thanks! I’m going to try it for a few days now.
However, there are a few things that I think is inferior to ido-mode with flex matching enabled – namely, the matching. In ido, I can type
anyth-ime
and it will be matched toanything-imenu
, which is awesome in the long run. Compared to that, anything is pretty impaired in it’s matching. I suspect that I’m not understanding something with anything.And how do I open an empty buffer with
anything-mini
? I usually open up a few empty (that is, not saved to the disk) buffers for storing temporary info (like when writing longer replies such as this), and I couldn’t understand how to do it withanything-mini
🙁You’re absolutely right:
ido
‘s flex matching is more powerful thananything
‘s, even with the match plugin installed. But there’s a price:anything
powers my project navigation code, and my primary project (Clockwork‘s CMS) has 11,000+ files in it. Try anido-completing-read
on a list of that size with flex matching, and ido will choke. Hard.anything
, on the other hand, handles it without breaking a sweat.And
anything
blowsido
clear out of the water in terms of the flexibility provided for building on top of it.ido-completing-read
takes a list of strings and returns a string and that’s it. If the visual representation of your selection differs from the info you need to act on your selection, clear your calendar and sharpen your yak shears.That said,
ido-mode
certainly has its place. I useido-find-file
overanything-for-files
, because it traverses directories and allows creation of new files. I likeanything-mini
for buffer switching, because I’ve often just closed the buffer I want to get to (it’s a problem, I know) andanything-mini
means I don’t have to care. But if you find yourself often deciding to open a new buffer from a buffer-switching context, by all means,ido-switch-buffer
is your friend.“ido‘s flex matching is more powerful than anything‘s, even with the match plugin installed”
You should contact the developers anything.el about this. I don’t think this kind of flex matching is difficult to implement in Anything.
At last some ratinoality in our little debate.
That’s a well-thought-out answer to a challenging question
I love ‘anything’, the killer feature is being able to use the ‘locate’ command to find files. Only problem is, the matching of space-separated terms doesn’t work anymore since anything just passes the query to the locate program (which can take a regexp). Also, it can be slow. And leave ‘anything’ buffers lying around. Also, development is slow, probably because it’s so monolithic (a single anything-config file for a bazillion sources!?).
I much prefer ‘anything’ to ‘icicles’ anyway, I just wish it was smoother :/
Verified:
anything-locate
is a great concept, but the execution leaves a bit to be desired. At the very least, I wish the match plugin would work properly, without which, narrowing down the enormous result set is clumsy and slow.I haven’t made much use of
anything-locate
myself, however, and for me,anything
‘s killer feature is its great custom source API, which I’ve centered my project tools around. I highly recommend it for those times thatido-completing-read
just won’t cut it. If you’re looking to get started, well there just happen to be a couple of posts on this blog about coding on top ofanything
— check them out at your leisure.Thanks a lot for this guide. But I do not see how you map keys to those command like amything-for-files. At line 2772 of my anything-config.el. the author defined the keyshorts apparently, but none of them work for me. I think an activation is necessary for that, isn’t it? Sorry for my newbie question, but anything rocks!
(global-set-key (kbd "C-x C-f") 'anything-for-files)
should do the trick. Also, make sure you’re loading the anything code as described above.You may be looking at the keys defined for anything-command-map? There is a prefix key for those. There is a default but I set mine like this:
(setq anything-command-map-prefix-key "")
Then try
C-h
to see what is available.Whoops, didn’t escape things properly. I use f12 as my prefix, so ‘f12 C-h’ shows the available bindings.
Just checked and I actually had used customize to change the anything prefix. The setq I provided above won’t work, use instead:
(global-set-key [f12] 'anything-command-map)
Pingback: Quora
I’ve just wanted to let everyone know that anything.el has been forked to Helm at GitHub – https://github.com/emacs-helm/helm
The old project is effectively dead since its active maintainers are the ones supporting Helm now.
Pingback: Emacs: what are good tactics for navigating directories and opening files? | PHP Developer Resource