* anything-config.el (anything-c-read-file-name): Add missing key 'name'.
[anything-config.git] / doc / anything.tex
blobb2d2d369cf09640288cfb54cafff14eaff0d747c
1 %%% anything.tex - Anything documentation.
3 %%% Copyright (C) 2010 ~ 2011, Thierry Volpiatto, all rights reserved.
5 %% This file is NOT part of GNU Emacs
6 %%
7 %% License
8 %
9 % This program is free software; you can redistribute it and/or modify
10 % it under the terms of the GNU General Public License as published by
11 % the Free Software Foundation; either version 3, or (at your option)
12 % any later version.
14 % This program is distributed in the hope that it will be useful,
15 % but WITHOUT ANY WARRANTY; without even the implied warranty of
16 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 % GNU General Public License for more details.
19 % You should have received a copy of the GNU General Public License
20 % along with this program; see the file COPYING. If not, write to
21 % the Free Software Foundation, Inc., 51 Franklin Street, Fifth
22 % Floor, Boston, MA 02110-1301, USA.
24 % This file is intended to be processed by plain TeX (TeX82).
26 \documentclass[a4paper,11pt]{article}
27 \usepackage[french]{babel}
28 \usepackage[utf8]{inputenc}
29 \usepackage{textcomp}
30 \usepackage{graphicx}
31 \usepackage{array}
32 \usepackage[pdftex=true,
33 hyperindex=true,
34 colorlinks=true]{hyperref}
35 \usepackage{url}
36 \usepackage{natbib}
37 \usepackage{setspace}
40 \begin{document}
41 \begin{titlepage}
42 \title{Anything User Manual}
43 \date{Last update: \today}
44 \author{ThierryVolpiatto}
45 \maketitle
46 \tableofcontents
47 \end{titlepage}
49 \section{Install}
50 \label{sec:install}
52 First get the files from git repo:
54 Anything git repo is at:\\
55 \url{http://repo.or.cz/w/anything-config.git}
57 To get it with git:
59 \begin{verbatim}
60 git clone git://repo.or.cz/anything-config.git
61 \end{verbatim}
63 NOTE: Files are published on Emacswiki, but be aware that it is \underline{unsafe} to get files from Emacswiki.
65 You need 2 files:
66 \begin{itemize}
67 \item anything.el
68 \end{itemize}
69 Contain the anything engine.
71 \begin{itemize}
72 \item anything-config.el
73 \end{itemize}
74 Contain all the sources and preconfigured functions ready to use.
76 and optionally:
77 \begin{itemize}
78 \item anything-match-plugin.el
79 \end{itemize}
80 Allow matching multi pattern search when entering a space in prompt.
82 Once downloaded these files, put them in your `load-path'.
83 If you don't know what is your load-path do C-h v load-path.
85 \section{Config}
86 \label{sec:config}
87 Edit your ~/.emacs.el file and add:
89 \begin{verbatim}
90 (require 'anything-config)
91 \end{verbatim}
93 Optionally, you can add:
95 \begin{verbatim}
96 (require 'anything-match-plugin)
97 \end{verbatim}
99 Note that if you don't require anything-match-plugin, you can enable/disable it afterward with:
101 M-x anything-c-toggle-match-plugin
103 NOTE:
104 It is not recommended to use the variable `anything-sources', please use instead the preconfigured anything command
105 you will find in anything-config.el or build your own.
107 Be aware also that making your own anything commands with a lot of sources involved can be very costly and slowdown
108 anything a lot.
110 \section{General anything commands}
111 \label{sec:gener-anyth-comm}
112 Anything allow you to have few binding to remember unlike all others Emacs applications.
114 Anything show you by default in mode-line the most useful bindings, you will see in headers of anything buffer some more specific
115 commands.
117 So when anything start what you have to remember:
119 \begin{itemize}
120 \item Access to action menu with
121 \begin{verbatim}
123 \end{verbatim}
124 \end{itemize}
125 \begin{itemize}
126 \item Use persistent actions with
127 \begin{verbatim}
129 \end{verbatim}
130 \end{itemize}
131 \begin{itemize}
132 \item Mark candidate with
133 \begin{verbatim}
134 M-<SPACE>
135 \end{verbatim}
136 \end{itemize}
138 So three bindings to remember and they are anyway documented in mode-line.
139 For more, hitting
140 \begin{verbatim}
141 C-h m
142 \end{verbatim}
143 while in anything session will show you all other bindings.
145 \subsection{All anything bindings}
146 \label{sec:all-anyth-bind}
148 \begin{tabular}{| l | m{5cm} |}
149 \hline
150 Command & Key \\
151 \hline
152 anything-next-line & down or C-n \\
153 \hline
154 anything-previous-line & up or C-p \\
155 \hline
156 anything-previous-page & prior or M-v \\
157 \hline
158 anything-next-page & next or C-v \\
159 \hline
160 anything-beginning-of-buffer &
161 \begin{verbatim}
163 \end{verbatim}
165 \hline
166 anything-end-of-buffer &
167 \begin{verbatim}
169 \end{verbatim}
171 \hline
172 anything-next-source & right or C-o \\
173 \hline
174 anything-previous-source & left \\
175 \hline
176 anything-exit-minibuffer & RET \\
177 \hline
178 anything-select-with-digit-shortcut & C-1/9/A/Z \\
179 \hline
180 anything-select-action & TAB or C-i \\
181 \hline
182 anything-execute-persistent-action & C-z \\
183 \hline
184 anything-select-2nd-action-or-end-of-line & C-e \\
185 \hline
186 anything-select-3rd-action & C-j \\
187 \hline
188 anything-scroll-other-window & M-next or C-M-v \\
189 \hline
190 anything-scroll-other-window-down & M-prior or C-M-y \\
191 \hline
192 anything-toggle-visible-mark & C-SPACE \\
193 \hline
194 anything-prev-visible-mark & M-[ \\
195 \hline
196 anything-next-visible-mark & M-] \\
197 \hline
198 anything-delete-minibuffer-contents & C-k \\
199 \hline
200 anything-isearch & C-s \\
201 \hline
202 anything-toggle-resplit-window & C-t \\
203 \hline
204 anything-quit-and-find-file & C-x C-f \\
205 \hline
206 anything-delete-current-selection & C-c C-d \\
207 \hline
208 anything-yank-selection & C-c C-y \\
209 \hline
210 anything-kill-selection-and-quit & C-c C-k \\
211 \hline
212 anything-follow-mode & C-c C-f \\
213 \hline
214 anything-force-update & C-c C-u \\
215 \hline
216 anything-debug-output & C-c C-x C-d \\
217 \hline
218 anything-display-all-visible-marks & C-c C-x C-m \\
219 \hline
220 anything-send-bug-report-from-anything & C-c C-x C-b \\
221 \hline
222 anything-previous-history-element & M-p \\
223 \hline
224 anything-next-history-element & M-n \\
225 \hline
226 anything-toggle-all-marks & M-m \\
227 \hline
228 anything-yank-text-at-point & C-w \\
229 \hline
230 \end{tabular}
231 \section{Overview of preconfigured anything commands}
232 \label{sec:overv-comm-avail}
233 For starting with anything, a set of commands have been set for you in anything menu.
234 The bindings of all these commands are prefixed with `f5-a'.
236 To discover more anything commands run from menu anything all commands (anything-execute-anything-command).
237 Or run anything-M-x (f5-a M-x) and type anything.
239 When you like a command, e.g f5 a M-x you should bind it to something more convenient like M-x to replace the Emacs
240 original keybinding.
242 \section{Anything Find Files}
243 \label{sec:anything-find-files}
244 `anything-find-files' provide you a way to navigate in your system file easily.
245 All the actions you can do on files from here are described in this section.
247 It is binded in menu, and in `anything-command-map' to f5-a C-x C-f. \\
248 We will assume you have binded `anything-find-files' to C-x C-f.
249 To do that put in your .emacs.el:
250 \begin{verbatim}
251 (global-set-key (kbd "C-x C-f") 'anything-find-files)
252 \end{verbatim}
253 It is well integrated with tramp, you can enter any tramp filename and it will complete.
254 (e.g /su::, /sudo::, /ssh:host:, ... etc)
256 Called with a prefix arg, (C-u) anything-find-files will show you also history of last visited directories.
258 \subsection{Navigation}
259 \label{sec:navigation}
260 Anything-find-files is not by default on ~/ but on default-directory or
261 thing-at-point as it use ffap.If you are on a url, a mail adress
262 etc.. it will do the right thing.
264 So anything-find-files work like find-file (C-x C-f), but if you use it
265 with anything-match-plugin.el, you have to add a space and then the next
266 part of pattern you want to match:
268 Example:
270 \begin{verbatim}
271 Find Files or url: ~/
272 That show all ~/ directory.
274 Find Files or url: ~/des
275 will show all what begin with "des"
277 Find Files or url: ~/ esk
278 (Notice the space after ~/) will show all what contain esk.
280 Find Files or url: ~/ el$
281 Will show all what finish with el
283 \end{verbatim}
284 You can move in the anything buffer with C-n C-p or arrow keys, when you
285 are on a file, you can hit C-z to show only this file-name in the
286 anything buffer.
287 On a directory, C-z will switch to this directory to continue searching
288 in it.
289 On a symlink C-z will expand to the true name of symlink.(moving your
290 mouse cursor over a symlink will show the true name of it).
292 So it is quite easy to navigate in your files with anything-find-files.
294 Forget to mention C-. that go to root of current dir or to precedent
295 level of dir.
296 So for example you can hit C-z and then come back immediatly where you
297 were with C-. instead of erasing minibuffer input with DEL.
298 On non graphic display, it is bound to C-l.
300 If you like it you can safely bind it to C-x C-f to replace the standard
301 find-file:
303 \begin{verbatim}
304 (global-set-key (kbd "C-x C-f") 'anything-find-files)
305 \end{verbatim}
307 NOTE:
308 Starting anything-find-files with C-u will show you a little history of the last visited directories.
311 \subsection{Jump with nth commands}
312 \label{sec:jump-with-nth}
313 Take advantage of the second, third and 4th actions in anything.
314 Instead of opening action menu with TAB, just hit:
316 C-e for 2th action\\
317 C-j for 3th action\\
319 You can bind 4th action to some key like this:
320 \begin{verbatim}
321 (define-key anything-map (kbd "<C-tab>") 'anything-select-4th-action)
322 \end{verbatim}
323 \newpage
324 \subsection{Anything find files action shortcuts}
325 \label{sec:anything-find-files-1}
326 Instead of having to open action pannel with TAB,
327 you have some convenients shortcuts to quickly run actions.
328 Use C-c ? from an anything-find-files session to have a description.\\
330 \begin{tabular}{| l | l |}
331 \hline
332 Command & Key \\
333 \hline
334 anything-ff-run-grep & M-g s (C-u recurse)\\
335 \hline
336 anything-ff-run-rename-file & M-R (C-u Follow)\\
337 \hline
338 anything-ff-run-copy-file & M-C (C-u Follow)\\
339 \hline
340 anything-ff-run-byte-compile-file & M-B (C-u Load)\\
341 \hline
342 anything-ff-run-load-file & M-L \\
343 \hline
344 anything-ff-run-symlink-file & M-S (C-u Follow)\\
345 \hline
346 anything-ff-run-delete-file & M-D \\
347 \hline
348 anything-ff-run-switch-to-eshell & M-e \\
349 \hline
350 anything-ff-run-complete-fn-at-point & M-tab \\
351 \hline
352 anything-ff-run-switch-other-window & C-o \\
353 \hline
354 anything-ff-run-open-file-externally & C-c C-x (C-u choose)\\
355 \hline
356 anything-ff-help & C-c ? \\
357 \hline
358 anything-ff-rotate-left-persistent & M-l \\
359 \hline
360 anything-ff-rotate-right-persistent & M-r \\
361 \hline
362 anything-find-files-down-one-level & C-. or C-l \\
363 \hline
364 anything-ff-properties-persistent & M-i \\
365 \hline
366 \end{tabular}
367 \subsection{Turn in image viewer}
368 \label{sec:turn-image-viewer}
369 You can turn anything-find-files in a nice image-viewer.
371 Navigate to your image directory, then type C-u C-z on first image.
372 Now turn on `follow-mode' with C-c C-f.
373 You can now navigate in your image directory with arrow up and down or C-n C-p.
374 Don't forget also to use C-t to split you windows vertically if needed.
376 You will find also two actions to rotate image in action menu.
377 To use these actions whitout quitting, use M-l (rotate left) and M-r (rotate right).
378 Of course M-l and M-r have no effect if candidate is not an image file.\\
380 NOTE:
381 It use image-dired in background, so if image-dired don't work for some reason, this will
382 not work too.
383 Be sure to have Imagemagick package installed.\\
385 \includegraphics[width=15cm]{image-viewer1}
386 \newpage
388 \subsection{Serial rename}
389 \label{sec:serial-rename}
390 You can rename files with a new prefix name and by incremental number.
391 The marked files will be renamed with a new prefix name and starting
392 at the start-number you have choosen.\\
393 Note that the marked files are in the order of the selection you did, this allow to reorder
394 files.\\
395 If you mark files in other directories than the current one, these files will be moved or symlinked to current one.\\
397 TIP: If you have more than 100 files to serial rename, start at 100 instead of one to have your directory
398 sorted correctly.\\
400 You have to ways to serial rename:\\
401 \begin{itemize}
402 \item By renaming: All the file of others directories are moved in directory where renaming happen.\\
403 \end{itemize}
404 \begin{itemize}
405 \item By symlinking: All the files that are not files of the directory where you want to rename will be symlinked,
406 others will be renamed.\\
407 \end{itemize}
409 Example of Use:\\
410 I want to create a directory with many symlinked images coming from various directories.\\
411 1) C-x C-f (launch anything-find-files)\\
412 2) Navigate to the place of your choice and write new directory name ending with ``/'' and press RET.\\
413 3) Navigate and browse images, when you want an image mark it, you can mark all in a directory with M-a.\\
414 4) When you have marked all files, choose ``serial rename by symlinking'' in action menu.\\
415 5) Choose new name and start number.\\
416 6) Navigate to initial directory (where files will be renamed/symlinked) and RET.\\
417 7) Say yes to confirm, that's done.\\
418 8) Start viewing your pictures.\\
420 \subsection{Grep}
421 \label{sec:grep}
422 We describe here anything-do-grep, an incremental grep.
423 It is really convenient as you can start a search just after finding the place or file(s) you want to search in.
424 By the nature of incremental stuff, it is faster than original Emacs grep for searching.
426 As you type the display change (like in all other anything commands).
427 This grep is also recursive unlike the emacs implementation that use find/xargs.
429 It support wildcard and (re)use the variables `grep-find-ignored-files'
430 and `grep-find-ignored-directories'.
432 It have full tramp integration.
433 (you can grep file on a remote host or in su/sudo methods).
435 \begin{itemize}
436 \item NOTE:
437 You will find a file named anything-grep.el in extensions.
438 It is NOT needed to use with what is described here.
439 It is another implementation of grep but not incremental.
440 \end{itemize}
443 \begin{itemize}
444 \item NOTE:
445 When using it recursively, `grep-find-ignored-files' is not used unless you don't specify
446 the only extensions of files where you want to search (you will have a prompt).
447 You can now specify more than one extension to search.\\
448 e.g *.el *.py *.tex \\
449 will search only in files with these extensions.
450 \end{itemize}
452 \begin{itemize}
453 \item NOTE: Windows users need grep version
454 \begin{math}
455 \geq2.5.4
456 \end{math}
457 of Gnuwin32 on windoze.
458 This version should accept the --exclude-dir option.
459 \end{itemize}
461 \newpage
462 Grep in action on current file: \\
464 \includegraphics[width=15cm]{grep-screenshot2}
466 \subsection{Anything do grep}
467 \label{sec:anything-do-grep}
468 Start with M-x anything-do-grep bound to f5 a M-g s
469 A prefix arg will launch recursive grep.
471 \subsection{Grep from anything-find-files}
472 \label{sec:grep-from-anything}
473 From anything-find-files (f5 a C-x C-f) Open the action menu with tab and choose grep.
474 A prefix arg will launch recursive grep.\\
476 \begin{itemize}
477 \item NOTE:You can now launch grep with (C-u) M-g s without switching to the action pannel.
478 \end{itemize}
480 \subsection{Grep One file}
481 \label{sec:grep-one-file}
482 Just launch grep, it will search in file at point.
483 if file is a directory, it will search in ALL files of this directory like:
485 \begin{verbatim}
486 grep -nH -e pattern *
487 \end{verbatim}
490 \subsection{Grep Marked files}
491 \label{sec:grep-marked-files}
492 Just mark some files with
493 \begin{verbatim}
494 C-<SPACE>
495 \end{verbatim}
496 and launch grep.
497 \subsubsection{Grep marked files from differents directories}
498 \label{sec:grep-marked-files-1}
499 This is a very nice feature of anything grep implementation that allow to search in specific files located not
500 only in current directory but anywhere in your file system.
502 To use navigate in your file system and mark files with
503 \begin{verbatim}
504 C-<SPACE>
505 \end{verbatim}
506 When you have marked all files, just launch grep in action menu.
508 NOTE: Using prefix-arg (C-u) will start a recursive search with the extensions of the marked files
509 except if those are one of ``grep-find-ignored-files''.
511 \subsection{Grep Directory recursively}
512 \label{sec:grep-direct-recurs}
513 From anything-find-files, reach the root of the directory where you want to search in,
514 then hit TAB to open the action menu and choose grep with a prefix arg (i.e C-u RET).
516 if you want to use grep directly from anything-do-grep, do:
518 \begin{verbatim}
519 C-u f5 a M-g s
520 \end{verbatim}
522 You will be prompted for selecting in which category of files to search:
523 Use the wilcard syntax like *.el for example (search in only ``.el'' files).
525 \begin{itemize}
526 \item NOTE: Be sure to be at the root of directory, of course grepping recursively with cursor
527 on a filename candidate will find nothing.
529 \end{itemize}
530 \subsection{Grep Using Wildcard}
531 \label{sec:grep-using-wildcard}
532 You can use wildcard:
533 From the root of your directory, if you want for example to search files with .el extension:
534 add *.el to prompt.
536 \subsection{Grep thing at point}
537 \label{sec:grep-thing-at}
538 Before lauching anything, put your cursor on the start of symbol or sexp you will want to grep.
539 Then launch anything-do-grep or anything-find-files, and when in the grep prompt hit C-w as many time as needed.
541 \subsection{Grep persistent action}
542 \label{sec:grep-pers-acti}
543 As always, C-z will bring you in the buffer corresponding to the file you are grepping. \\
544 Well nothing new, but using C-u C-z will record this place in the mark-ring.
545 So if you want to come back later to these places no need to grep again, you will find all these
546 places in the mark-ring.\\
547 Accessing the mark-ring in Emacs is really inconvenient, fortunately, you will find in anything-config
548 ``anything-all-mark-ring'' which is a mark-ring browser (f5-a C-c SPACE).
549 \newpage
550 ``anything-all-mark-ring'' is in anything menu also, in the tool section.\\
552 \begin{itemize}
553 \item TIP: Bind ``anything-all-mark-ring'' to C-c SPACE.
554 \begin{verbatim}
555 (global-set-key (kbd "C-c <SPC>") 'anything-all-mark-rings)
556 \end{verbatim}
557 \end{itemize}
559 \begin{itemize}
560 \item NOTE: ``anything-all-mark-ring'' handle global-mark-ring also.
561 \end{itemize}
563 \subsection{Save grep session}
564 \label{sec:save-grep-session}
565 If you want to save the results of your grep session, doing ``C-x C-s'' will save your grep results
566 in a *grep* buffer.
568 \subsection{Open Files Externally}
569 \label{sec:open-files-extern}
570 You will find in action menu from anything-find-files an action to open file with external program.
571 If you have no entry in .mailcap or /etc/mailcap, you will enter an anything session to choose a program
572 to use with this kind of file.
573 It will offer to you to save setting to always open this kind of files with this program.
574 Once configured, you can however open the files of same extension with some other program by forcing anything
575 to choose program with C-u.\\
577 NOTE: You can now open files externally with ``C-c C-x'' from anything-find-files.
579 \subsection{Eshell command on files}
580 \label{sec:eshell-command-files}
581 You can run eshell-command on files or marked files, the command you use have to accept
582 one file as argument.
583 The completion is make on your eshell aliases.
584 This allow you creating personal actions for ``anything-find-files''.
586 \subsection{Why Eshell}
587 \label{sec:why-eshell}
588 \begin{itemize}
589 \item Because eshell allow you to create aliases.
590 \end{itemize}
591 \begin{itemize}
592 \item Because eshell accept shell commands but also elisp functions.
593 \end{itemize}
594 All these command should end with \$1.
595 You will have completion against all these aliases once eshell is loaded.
596 (start it once before using anything-find-files).
598 \subsection{Setup Aliases}
599 \label{sec:setup-aliases}
600 Go in eshell, an enter at prompt:
601 \begin{verbatim}
602 alias my_alias command \$1
603 \end{verbatim}
604 NOTE: don't forget to escape the \$.
606 See the documentation of Eshell for more info.
608 \subsection{Problem starting Eshell}
609 \label{sec:probl-start-eshell}
610 Eshell code is available (autoloaded) only when you have started once eshell.
611 That's annoying like many autoloaded stuff in Emacs.
613 \subsection{Dired Commands}
614 \label{sec:dired-commands}
615 To enable some of the usual commands of dired, put in .emacs.el
616 \begin{verbatim}
617 (anything-dired-bindings 1)
618 \end{verbatim}
619 Or run interactively:
620 \begin{verbatim}
621 M-x anything-dired-bindings
622 \end{verbatim}
623 This will replace in dired C, R, S, and H commands.
624 That is copy, rename, symlink, hardlink.
625 When creating a symlink, you will find relsymlink in actions menu.(TAB).
627 \subsection{Copy Files}
628 \label{sec:copy-files}
629 It is a powerfull feature of anything-find-files as you can mark files in very different places in your
630 file system and copy them in one place.
632 Dired is not able to do that, you can mark files only in current dired display and copy them somewhere.
634 So, easy to use, just mark some files, and hit copy files in the action menu.
635 That will open a new anything-find-files where you can choose destination.
636 \subsection{Rename Files}
637 \label{sec:rename-files}
638 Just mark some files, and hit rename files in the action menu.
639 That will open a new anything-find-files where you can choose destination.
640 \subsection{Symlink Files}
641 \label{sec:symlink-files}
642 Just mark some files, and hit symlink or relsymlink files in the action menu.
643 That will open a new anything-find-files where you can choose destination.
644 \subsection{Hardlink}
645 \label{sec:hardlink}
646 Just mark some files, and hit hardlink files in the action menu.
647 That will open a new anything-find-files where you can choose destination.
649 \subsection{Follow file after action}
650 \label{sec:follow-file-after}
651 A prefix arg on any of the action above, copy, rename, symlink, hardlink, will
652 allow you to follow the file.
653 For example, when you want to copy an elisp file somewhere and you want to compile it in this place,
654 hitting C-u RET will bring you in this place with the file already marked, you have just to go in action menu to
655 compile it.
657 \subsection{In Buffer File Completion}
658 \label{sec:buff-file-compl}
659 In any buffer and even in minibuffer if you have enable recursive-minibuffer
660 \begin{verbatim}
661 (setq enable-recursive-minibuffers t)
662 \end{verbatim}
663 You can have completion with C-x C-f and then hit tab to choose action Complete at point \\
664 once you have found the filename you want.
665 \subsection{Create File}
666 \label{sec:create-file}
667 Navigate to the directory where you want to create your new file, then \\
668 continue typing the name of your file and type enter. \\
669 NOTE: If your filename ends with a / you will be prompt to create a new directory.
671 \subsection{Create Directory}
672 \label{sec:create-directory}
673 Navigate to the directory where you want to create your new directory, \\
674 then continue typing the name of new directory - Parents accepted - \\
675 and end it with / type enter, you will be prompt to create your new directory (possibly with parents).
677 \subsection{Ediff files}
678 \label{sec:ediff-files}
679 Well, that is easy to use,
680 move cursor to a file, hit ediff in action menu, you will jump in
681 another anything-find-files to choose second file.
682 \subsection{Ediff merge files}
683 \label{sec:ediff-merge-files}
684 move cursor to a file, hit ediff merge in action menu, you will jump in
685 another anything-find-files to choose second file.
687 \subsection{Browse archive with avfs}
688 \label{sec:browse-archive-with}
690 If you have installed avfs (See: http://sourceforge.net/projects/avf) you can browse archives
691 in your directory .avfs once it is mounted with ``mountavfs''.
693 Just move on the archive filename and press C-z (persistent action) and you will see
694 in anything buffer the subdirectories of archive, just navigate inside as usual.
696 \subsection{Display with icons}
697 \label{sec:display-with-icons}
699 You can have a more fancy display showing icons for files and directories.
700 Just add in .emacs:
701 \begin{verbatim}
702 (setq anything-c-find-files-show-icons t)
703 \end{verbatim}
704 NOTE: This will slowdown anything-find-files unless you have a fast computer.
706 \section{Anything write buffer}
707 \label{sec:anyth-write-buff}
708 That is a replacement of standard write-buffer Emacs command with anything completion.
709 \section{Anything insert file}
710 \label{sec:anything-insert-file}
711 That is a replacement of standard insert-file Emacs command with anything completion.
713 \section{Anything M-x}
714 \label{sec:anything-m-x}
715 It is binded to f5 a M-x, you should bind it to M-x.
717 Features:\\
718 \begin{itemize}
719 \item You can use prefix arguments before or during M-x session
720 \end{itemize}
721 \begin{itemize}
722 \item C-z is a toggle documentation for this command
723 \end{itemize}
724 \begin{itemize}
725 \item The key binding of command are shown.
726 \end{itemize}
728 \section{Anything regexp}
729 \label{sec:anything-regexp}
730 This is a replacement of regexp-builder.
731 The groups are shown in a convenient way.
733 \subsection{Query replace regexp}
734 \label{sec:query-replace-regexp}
735 Write your regexp in anything-regexp, when it match what you want,
736 you can run query-replace from action menu.
737 NOTE:
738 Before running anything-regexp, you can select a region to work in, that will narrow this region
739 automatically.
740 \subsection{Save regexp as sexp}
741 \label{sec:save-regexp-as}
742 When you use this, it will save your regexp for further use in lisp code,
743 with backslash duplicated.
745 \subsection{Save regexp as string}
746 \label{sec:save-regexp-as-1}
747 Save the regexp as you wrote it.
749 \section{Anything locate}
750 \label{sec:anything-locate}
751 First be sure you have a locate program installed on your system.
752 Most GNU/Linux distro come with locate included, you update or create the data base with
753 ``updatedb'' command.
755 \subsection{Search files}
756 \label{sec:search-files}
758 To use, just launch
759 \begin{verbatim}
760 M-x anything-locate (f5 a l)
761 \end{verbatim}
763 Then enter filename at prompt.
764 It will search this pattern entered also in directory and subdirectory names, to limit your search to basename,
765 add ``-b'' after pattern.
766 The search is performed on all files known in database, they maybe not exists anymore, so to limit to
767 really existing files add after pattern ``-e''.
768 To limit you search to specific number of results, use ``-n'' after your pattern with the number of results
769 you want.
771 Example:
772 \begin{verbatim}
773 Pattern: emacs -b -e -n 12
774 \end{verbatim}
776 \subsection{Launch grep}
777 \label{sec:launch-grep}
779 When search is done, you can search in a specific file or directory with grep that you will find in action menu (TAB).\\
781 \begin{itemize}
782 \item NOTE:You can now launch grep with (C-u) M-g s without switching to the action pannel.
783 \end{itemize}
785 \subsection{Windows specificity}
786 \label{sec:windows-specificity}
788 On Windows you should use Everything program that mimic locate, is very fast and don't need to
789 update database manually.
790 To use with anything-locate, you will need his command line named ``es''.
791 Be sure to modify the PATH environment variable, to include path to the directory that contain ``es''.
792 The arguments are the same than the ones in ``locate''.
794 \section{Anything Etags}
795 \label{sec:anything-etags}
797 \subsection{Create the tag file}
798 \label{sec:create-tag-file}
801 To use etags in Emacs you have first to create a TAGS file for your project with the etags shell command.
802 If your directory contains subdirectories use someting like:(e.g .el files)
803 \begin{verbatim}
804 find . -iregex .*\.el$ | xargs etags
805 \end{verbatim}
806 Otherwise
807 \begin{verbatim}
808 etags *.el
809 \end{verbatim}
810 is enough
812 For more infos see the man page of etags.
814 \subsection{Start anything etags}
815 \label{sec:start-anything-etags}
818 Now just using f5 a e will show you all entries.
819 If the project is big it take some time to load tag file but when it is done, next search will be very fast.
820 If you modify the TAGS file, use
821 \begin{verbatim}
822 C-u C-u f5 a e
823 \end{verbatim}
824 to refresh the tag cache.
826 To search the definition at point use just
827 \begin{verbatim}
828 C-u f5 a e
829 \end{verbatim}
831 \section{Firefox bookmarks}
832 \label{sec:firefox-bookmarks}
834 You will have to set firefox to import bookmarks in his html file book-marks.html.
835 \begin{verbatim}
836 (only for firefox versions >=3)
837 \end{verbatim}
838 To achieve that, open ``about:config'' in firefox and double click on this line to enable value to true :
839 \begin{verbatim}
840 user_pref("browser.bookmarks.autoExportHTML", false);
841 \end{verbatim}
842 You should have now :
843 \begin{verbatim}
844 user_pref("browser.bookmarks.autoExportHTML", true);
845 \end{verbatim}
846 Now you can use
847 \begin{verbatim}
848 M-x anything-firefox-bookmarks
849 \end{verbatim}
850 To see your firefox bookmarks from Emacs.
851 When you are in firefox things are a little more complicated. You will
852 need wmctrl program and a script named ffbookmarks :
853 \begin{verbatim}
854 #!/bin/bash
856 wmctrl -xa emacs
857 emacsclient -e "(progn (anything-firefox-bookmarks) nil)" > /dev/null
858 wmctrl -xa firefox
859 exit 0
860 \end{verbatim}
861 Put this script somewhere in PATH and make it executable :
862 \begin{verbatim}
863 chmod +x ffbookmarks
864 \end{verbatim}
866 Firefox is not aware about this new protocol, you will have to instruct
867 it. See Firefox documentation or use firefox-protocol.el package you can get
868 here: \\
869 \url{http://mercurial.intuxication.org/hg/emacs-bookmark-extension/} \\
870 Install new protocol: \\
871 \begin{verbatim}
872 M-x firefox-protocol-installer-install
873 \end{verbatim}
874 to install new protocol ffbookmarks
875 Then install a bookmarklet in firefox : Right click on the bookmark
876 toolbar in firefox and add a new bookmark called ffbookmarks. Add this
877 instead of url: \\
878 \begin{verbatim}
879 javascript:location.href='ffbookmarks://localhost'
880 \end{verbatim}
882 Now when you click on ffbookmarks it will bring you in Emacs and allow
883 you to browse your bookmarks with anything.
885 NOTE : emacs server need to be started in the running Emacs, see Emacs
886 documentation.
888 \section{Anything for buffers}
889 \label{sec:anything-buffers}
891 \begin{verbatim}
892 M-x anything-buffer+
893 \end{verbatim}
895 \subsection{Borring buffers}
896 \label{sec:borring-buffers}
898 Will show you your buffers list without borring buffers defined by regexp in
899 ``anything-c-boring-buffer-regexp''.
900 Just use customize to set that for your need.\\
902 \subsection{Search buffers by major-mode}
903 \label{sec:search-buffers-major}
906 Once in this anything session, you can narrow your buffer list by ``major mode'', regexp as usual or the both:\\
908 Example:\\
910 I want to show all my buffer that are in emacs-lisp mode:\\
912 Pattern: lisp \\
914 will show all emacs-lisp and lisp related buffers.\\
916 Now i want to limit these buffers to the one that match ``any''\\
918 Pattern: lisp any \\
920 I want to match buffers that match ``any'' but not limited to lisp buffers:\\
922 Pattern: any \\
924 \subsection{Different colors for buffers}
925 \label{sec:diff-colors-buff}
927 \begin{itemize}
928 \item If a buffer is modified, it will showup in orange.
929 \end{itemize}
930 \begin{itemize}
931 \item If a buffer have been modified by some external program (e.g sed) in the back of emacs, it will showup in red.
932 \end{itemize}
933 \begin{itemize}
934 \item Non--buffer file, Directory and files have differents face.
935 \end{itemize}
937 \subsection{Special commands}
938 \label{sec:special-commands}
939 Not complete.\\
941 C-c ? will show you all commands available.
944 \section{Other tools}
945 \label{sec:other-tools}
947 In addition of what is described above, you will find a bunch of powerfull tools that come with anything-config.el.
948 Just browse the anything commands availables with anything-M-x.
950 Not complete.
951 \section{Usefuls extensions}
952 \label{sec:usefuls-extensions}
953 Not complete.
955 \section{Usefuls links}
956 \label{sec:usefuls-links}
958 You can have info about anything on Emacswiki (Sometime deprecated).\\
959 \url{http://www.emacswiki.org/emacs/Anything}\\
961 You can ask on the anything mailing-list by subscribing at:\\
962 \url{https://groups.google.com/group/emacs-anything?hl=en}
964 Or at gmane: gmane.emacs.anything
966 \end{document}
968 %%% Local Variables:
969 %%% mode: latex
970 %%% TeX-master: t
971 %%% End: