anything.el (anything-mark-current-line): cleaner
[anything-config.git] / doc / anything.tex
blob18490429712b4bcb7eee84216ae1624dc1a56e5d
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}\\
56 You will find there tarballs of differents versions.\\
58 To get it with git:
59 \begin{verbatim}
60 git clone git://repo.or.cz/anything-config.git
61 \end{verbatim}
62 NOTE: Files are published on Emacswiki, but be aware that it is \underline{unsafe} to get files from Emacswiki,\\
63 thus, anything is not maintained anymore on Emacswiki, so files found there should be deprecated.\\
65 Once you have the anything directory, `cd' to it and run `make'.\\
66 Add it now to your `load-path':
67 \begin{verbatim}
68 (add-to-list 'load-path "/path/to/anything/directory")
69 \end{verbatim}
72 Manual installation:\\
74 You need 3 files:
75 \begin{itemize}
76 \item 1) anything.el
77 \end{itemize}
78 Contain the anything engine.
80 \begin{itemize}
81 \item 2) anything-config.el
82 \end{itemize}
83 Contain all the sources and preconfigured functions ready to use.
85 \begin{itemize}
86 \item 3) anything-match-plugin.el
87 \end{itemize}
88 Allow matching multi pattern search when entering a space in prompt.
90 Once downloaded these files, put them in your `load-path' and byte-compile them.
91 If you don't know what is your load-path do C-h v load-path.
93 \section{Config}
94 \label{sec:config}
95 Edit your ~/.emacs.el file and add:
97 \begin{verbatim}
98 (require 'anything-config)
99 \end{verbatim}
102 NOTE:
103 It is not recommended to use the variable `anything-sources', please use instead the preconfigured anything command
104 you will find in anything-config.el or build your own.
106 Be aware also that making your own anything commands with a lot of sources involved can be very costly and slowdown
107 anything a lot.
109 \section{General anything commands}
110 \label{sec:gener-anyth-comm}
111 Anything allow you to have few binding to remember unlike all others Emacs applications.\\
112 Thus, all bindings are auto documented.
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.\\
144 NOTE: Some anything commands have a special keymap, you can access infos on these keymap with `C-c ?',
145 it should be documented in mode-line.
147 \section{Overview of preconfigured anything commands}
148 \label{sec:overv-comm-avail}
149 For starting with anything, a set of commands have been set for you in anything menu.
150 The bindings of all these commands are prefixed with `f5-a'.
152 To discover more anything commands run from menu anything all commands (anything-execute-anything-command).
153 Or run anything-M-x (f5-a M-x) and type anything.
155 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
156 original keybinding.
158 \section{Anything Find Files}
159 \label{sec:anything-find-files}
160 `anything-find-files' provide you a way to navigate in your system file easily.
161 All the actions you can do on files from here are described in this section.
163 It is binded in menu, and in `anything-command-map' to f5-a C-x C-f. \\
164 We will assume you have binded `anything-find-files' to C-x C-f.
165 To do that put in your .emacs.el:
166 \begin{verbatim}
167 (global-set-key (kbd "C-x C-f") 'anything-find-files)
168 \end{verbatim}
169 It is well integrated with tramp, you can enter any tramp filename and it will complete.
170 (e.g /su::, /sudo::, /ssh:host:, ... etc)
172 Called with a prefix arg, (C-u) anything-find-files will show you also history of last visited directories.
174 \subsection{Navigation}
175 \label{sec:navigation}
176 Anything-find-files is not by default on ~/ but on default-directory or
177 thing-at-point as it use ffap.If you are on a url, a mail adress
178 etc.. it will do the right thing.
180 So anything-find-files work like find-file (C-x C-f), but if you use it
181 with anything-match-plugin.el, you have to add a space and then the next
182 part of pattern you want to match:
184 Example:
186 \begin{verbatim}
187 Find Files or url: ~/
188 That show all ~/ directory.
190 Find Files or url: ~/des
191 will show all what begin with "des"
193 Find Files or url: ~/ esk
194 (Notice the space after ~/) will show all what contain esk.
196 Find Files or url: ~/ el$
197 Will show all what finish with el
199 \end{verbatim}
200 You can move in the anything buffer with C-n C-p or arrow keys, when you
201 are on a file, you can hit C-z to show only this file-name in the
202 anything buffer.
203 On a directory, C-z will switch to this directory to continue searching
204 in it.
205 On a symlink C-z will expand to the true name of symlink.(moving your
206 mouse cursor over a symlink will show the true name of it).
208 So it is quite easy to navigate in your files with anything-find-files.
210 Forget to mention C-. that go to root of current dir or to precedent
211 level of dir.
212 So for example you can hit C-z and then come back immediatly where you
213 were with C-. instead of erasing minibuffer input with DEL.
214 On non graphic display, it is bound to C-l.\\
215 If `anything-ff-lynx-style-map' is non--nil, you will be able to use `left' instead of C-l and `right' instead of C-z.
217 If you like it, you can safely bind it to C-x C-f to replace the standard
218 find-file:
220 \begin{verbatim}
221 (global-set-key (kbd "C-x C-f") 'anything-find-files)
222 \end{verbatim}
224 NOTE:
225 Starting anything-find-files with C-u will show you a little history of the last visited directories.
228 \subsection{Jump with nth commands}
229 \label{sec:jump-with-nth}
230 Take advantage of the second, third and 4th actions in anything.
231 Instead of opening action menu with TAB, just hit:
233 C-e for 2th action\\
234 C-j for 3th action\\
236 You can bind 4th action to some key like this:
237 \begin{verbatim}
238 (define-key anything-map (kbd "<C-tab>") 'anything-select-4th-action)
239 \end{verbatim}
240 \newpage
241 \subsection{Anything find files action shortcuts}
242 \label{sec:anything-find-files-1}
243 Instead of having to open action pannel with TAB,
244 you have some convenients shortcuts to quickly run actions.
245 Use C-c ? from an anything-find-files session to have a description.\\
247 \begin{tabular}{| l | l |}
248 \hline
249 Command & Key \\
250 \hline
251 anything-ff-run-grep & M-g s (C-u recurse)\\
252 \hline
253 anything-ff-run-rename-file & M-R (C-u Follow)\\
254 \hline
255 anything-ff-run-copy-file & M-C (C-u Follow)\\
256 \hline
257 anything-ff-run-byte-compile-file & M-B (C-u Load)\\
258 \hline
259 anything-ff-run-load-file & M-L \\
260 \hline
261 anything-ff-run-symlink-file & M-S (C-u Follow)\\
262 \hline
263 anything-ff-run-delete-file & M-D \\
264 \hline
265 anything-ff-run-switch-to-eshell & M-e \\
266 \hline
267 anything-ff-run-complete-fn-at-point & M-tab \\
268 \hline
269 anything-ff-run-switch-other-window & C-o \\
270 \hline
271 anything-ff-run-open-file-externally & C-c C-x (C-u choose)\\
272 \hline
273 anything-ff-help & C-c ? \\
274 \hline
275 anything-ff-rotate-left-persistent & M-l \\
276 \hline
277 anything-ff-rotate-right-persistent & M-r \\
278 \hline
279 anything-find-files-down-one-level & C-. or C-l \\
280 \hline
281 anything-ff-properties-persistent & M-i \\
282 \hline
283 \end{tabular}
284 \subsection{Turn in image viewer}
285 \label{sec:turn-image-viewer}
286 You can turn anything-find-files in a nice image-viewer.
288 Navigate to your image directory, then type C-u C-z on first image.
289 Now turn on `follow-mode' with C-c C-f.
290 You can now navigate in your image directory with arrow up and down or C-n C-p.
291 Don't forget also to use C-t to split you windows vertically if needed.
293 You will find also two actions to rotate image in action menu.
294 To use these actions whitout quitting, use M-l (rotate left) and M-r (rotate right).
295 Of course M-l and M-r have no effect if candidate is not an image file.\\
297 Don't forget to use `C-t' to split windows vertically, and then
298 \begin{verbatim}
299 `C-}' and `C-{'
300 \end{verbatim}
301 to narrow/enlarge anything window.\\
303 NOTE:
304 It use image-dired in background, so if image-dired don't work for some reason, this will
305 not work too.
306 Be sure to have Imagemagick package installed.\\
308 \includegraphics[width=15cm]{image-viewer1}
309 \newpage
311 \subsection{Serial rename}
312 \label{sec:serial-rename}
313 You can rename files with a new prefix name and by incremental number.
314 The marked files will be renamed with a new prefix name and starting
315 at the start-number you have choosen.\\
316 Note that the marked files are in the order of the selection you did, this allow to reorder
317 files.\\
318 If you mark files in other directories than the current one, these files will be moved or symlinked to current one.\\
320 TIP: If you have more than 100 files to serial rename, start at 100 instead of one to have your directory
321 sorted correctly.\\
323 You have to ways to serial rename:\\
324 \begin{itemize}
325 \item By renaming: All the file of others directories are moved in directory where renaming happen.\\
326 \end{itemize}
327 \begin{itemize}
328 \item By symlinking: All the files that are not files of the directory where you want to rename will be symlinked,
329 others will be renamed.\\
330 \end{itemize}
332 Example of Use:\\
333 I want to create a directory with many symlinked images coming from various directories.\\
334 1) C-x C-f (launch anything-find-files)\\
335 2) Navigate to the place of your choice and write new directory name ending with ``/'' and press RET.\\
336 3) Navigate and browse images, when you want an image mark it, you can mark all in a directory with M-a.\\
337 4) When you have marked all files, choose ``serial rename by symlinking'' in action menu.\\
338 5) Choose new name and start number.\\
339 6) Navigate to initial directory (where files will be renamed/symlinked) and RET.\\
340 7) Say yes to confirm, that's done.\\
341 8) Start viewing your pictures.\\
343 \subsection{Grep}
344 \label{sec:grep}
345 We describe here anything-do-grep, an incremental grep.
346 It is really convenient as you can start a search just after finding the place or file(s) you want to search in.
347 By the nature of incremental stuff, it is faster than original Emacs grep for searching.
349 As you type the display change (like in all other anything commands).
350 This grep is also recursive unlike the emacs implementation that use find/xargs.
352 It support wildcard and (re)use the variables `grep-find-ignored-files'
353 and `grep-find-ignored-directories'.
355 It have full tramp integration.
356 (you can grep file on a remote host or in su/sudo methods).
358 \begin{itemize}
359 \item NOTE:
360 You will find a file named anything-grep.el in extensions.
361 It is NOT needed to use with what is described here.
362 It is another implementation of grep but not incremental.
363 \end{itemize}
366 \begin{itemize}
367 \item NOTE:
368 When using it recursively, `grep-find-ignored-files' is not used unless you don't specify
369 the only extensions of files where you want to search (you will have a prompt).
370 You can now specify more than one extension to search.\\
371 e.g *.el *.py *.tex \\
372 will search only in files with these extensions.
373 \end{itemize}
375 \begin{itemize}
376 \item NOTE: Windows users need grep version
377 \begin{math}
378 \geq2.5.4
379 \end{math}
380 of Gnuwin32 on windoze.
381 This version should accept the --exclude-dir option.
382 \end{itemize}
384 \newpage
385 Grep in action on current file: \\
387 \includegraphics[width=15cm]{grep-screenshot2}
389 \subsection{Anything do grep}
390 \label{sec:anything-do-grep}
391 Start with M-x anything-do-grep bound to f5 a M-g s
392 A prefix arg will launch recursive grep.
394 \subsection{Grep from anything-find-files}
395 \label{sec:grep-from-anything}
396 From anything-find-files (f5 a C-x C-f) Open the action menu with tab and choose grep.
397 A prefix arg will launch recursive grep.\\
399 \begin{itemize}
400 \item NOTE:You can now launch grep with (C-u) M-g s without switching to the action pannel.
401 \end{itemize}
403 \subsection{Grep One file}
404 \label{sec:grep-one-file}
405 Just launch grep, it will search in file at point.
406 if file is a directory, it will search in ALL files of this directory like:
408 \begin{verbatim}
409 grep -nH -e pattern *
410 \end{verbatim}
413 \subsection{Grep Marked files}
414 \label{sec:grep-marked-files}
415 Just mark some files with
416 \begin{verbatim}
417 C-<SPACE>
418 \end{verbatim}
419 and launch grep.
420 \subsubsection{Grep marked files from differents directories}
421 \label{sec:grep-marked-files-1}
422 This is a very nice feature of anything grep implementation that allow to search in specific files located not
423 only in current directory but anywhere in your file system.
425 To use navigate in your file system and mark files with
426 \begin{verbatim}
427 C-<SPACE>
428 \end{verbatim}
429 When you have marked all files, just launch grep in action menu.
431 NOTE: Using prefix-arg (C-u) will start a recursive search with the extensions of the marked files
432 except if those are one of ``grep-find-ignored-files''.
434 \subsection{Grep Directory recursively}
435 \label{sec:grep-direct-recurs}
436 From anything-find-files, reach the root of the directory where you want to search in,
437 then hit TAB to open the action menu and choose grep with a prefix arg (i.e C-u RET).
439 if you want to use grep directly from anything-do-grep, do:
441 \begin{verbatim}
442 C-u f5 a M-g s
443 \end{verbatim}
445 You will be prompted for selecting in which category of files to search:
446 Use the wilcard syntax like *.el for example (search in only ``.el'' files).
448 \begin{itemize}
449 \item NOTE: Be sure to be at the root of directory, of course grepping recursively with cursor
450 on a filename candidate will find nothing.
452 \end{itemize}
453 \subsection{Grep Using Wildcard}
454 \label{sec:grep-using-wildcard}
455 You can use wildcard:
456 From the root of your directory, if you want for example to search files with .el extension:
457 add *.el to prompt.
459 \subsection{Grep thing at point}
460 \label{sec:grep-thing-at}
461 Before lauching anything, put your cursor on the start of symbol or sexp you will want to grep.
462 Then launch anything-do-grep or anything-find-files, and when in the grep prompt hit C-w as many time as needed.
464 \subsection{Grep persistent action}
465 \label{sec:grep-pers-acti}
466 As always, C-z will bring you in the buffer corresponding to the file you are grepping. \\
467 Well nothing new, but using C-u C-z will record this place in the mark-ring.
468 So if you want to come back later to these places no need to grep again, you will find all these
469 places in the mark-ring.\\
470 Accessing the mark-ring in Emacs is really inconvenient, fortunately, you will find in anything-config
471 ``anything-all-mark-ring'' which is a mark-ring browser (f5-a C-c SPACE).
472 \newpage
473 ``anything-all-mark-ring'' is in anything menu also, in the tool section.\\
475 \begin{itemize}
476 \item TIP: Bind ``anything-all-mark-ring'' to C-c SPACE.
477 \begin{verbatim}
478 (global-set-key (kbd "C-c <SPC>") 'anything-all-mark-rings)
479 \end{verbatim}
480 \end{itemize}
482 \begin{itemize}
483 \item NOTE: ``anything-all-mark-ring'' handle global-mark-ring also.
484 \end{itemize}
486 \subsection{Save grep session}
487 \label{sec:save-grep-session}
488 If you want to save the results of your grep session, doing ``C-x C-s'' will save your grep results
489 in a *grep* buffer.
491 \subsection{Open Files Externally}
492 \label{sec:open-files-extern}
493 You will find in action menu from anything-find-files an action to open file with external program.
494 If you have no entry in .mailcap or /etc/mailcap, you will enter an anything session to choose a program
495 to use with this kind of file.
496 It will offer to you to save setting to always open this kind of files with this program.
497 Once configured, you can however open the files of same extension with some other program by forcing anything
498 to choose program with C-u.\\
500 NOTE: You can now open files externally with ``C-c C-x'' from anything-find-files.
502 \subsection{Eshell command on files}
503 \label{sec:eshell-command-files}
504 You can run eshell-command on files or marked files, the command you use have to accept
505 one file as argument.
506 The completion is make on your eshell aliases.
507 This allow you creating personal actions for ``anything-find-files''.
509 \subsection{Why Eshell}
510 \label{sec:why-eshell}
511 \begin{itemize}
512 \item Because eshell allow you to create aliases.
513 \end{itemize}
514 \begin{itemize}
515 \item Because eshell accept shell commands but also elisp functions.
516 \end{itemize}
517 All these command should end with \$1.
518 You will have completion against all these aliases once eshell is loaded.
519 (start it once before using anything-find-files).
521 \subsection{Setup Aliases}
522 \label{sec:setup-aliases}
523 Go in eshell, an enter at prompt:
524 \begin{verbatim}
525 alias my_alias command \$1
526 \end{verbatim}
527 NOTE: don't forget to escape the \$.
529 See the documentation of Eshell for more info.
531 \subsection{Problem starting Eshell}
532 \label{sec:probl-start-eshell}
533 Eshell code is available (autoloaded) only when you have started once eshell.
534 That's annoying like many autoloaded stuff in Emacs.\\
536 Here how to start Eshell at emacs startup:\\
538 Add this to your .emacs:
539 \begin{verbatim}
540 (add-hook 'emacs-startup-hook #'(lambda ()
541 (let ((default-directory (getenv "HOME")))
542 (command-execute 'eshell)
543 (bury-buffer))))
545 \end{verbatim}
547 \subsection{Dired Commands}
548 \label{sec:dired-commands}
549 To enable some of the usual commands of dired, put in .emacs.el
550 \begin{verbatim}
551 (anything-dired-bindings 1)
552 \end{verbatim}
553 Or run interactively:
554 \begin{verbatim}
555 M-x anything-dired-bindings
556 \end{verbatim}
557 This will replace in dired C, R, S, and H commands.
558 That is copy, rename, symlink, hardlink.
559 When creating a symlink, you will find relsymlink in actions menu.(TAB).
561 \subsection{Copy Files}
562 \label{sec:copy-files}
563 It is a powerfull feature of anything-find-files as you can mark files in very different places in your
564 file system and copy them in one place.
566 Dired is not able to do that, you can mark files only in current dired display and copy them somewhere.
568 So, easy to use, just mark some files, and hit copy files in the action menu.
569 That will open a new anything-find-files where you can choose destination.
570 \subsection{Rename Files}
571 \label{sec:rename-files}
572 Just mark some files, and hit rename files in the action menu.
573 That will open a new anything-find-files where you can choose destination.
574 \subsection{Symlink Files}
575 \label{sec:symlink-files}
576 Just mark some files, and hit symlink or relsymlink files in the action menu.
577 That will open a new anything-find-files where you can choose destination.
578 \subsection{Hardlink}
579 \label{sec:hardlink}
580 Just mark some files, and hit hardlink files in the action menu.
581 That will open a new anything-find-files where you can choose destination.
583 \subsection{Follow file after action}
584 \label{sec:follow-file-after}
585 A prefix arg on any of the action above, copy, rename, symlink, hardlink, will
586 allow you to follow the file.
587 For example, when you want to copy an elisp file somewhere and you want to compile it in this place,
588 hitting C-u RET will bring you in this place with the file already marked, you have just to go in action menu to
589 compile it.
591 \subsection{In Buffer File Completion}
592 \label{sec:buff-file-compl}
593 In any buffer and even in minibuffer if you have enable recursive-minibuffer
594 \begin{verbatim}
595 (setq enable-recursive-minibuffers t)
596 \end{verbatim}
597 You can have completion with C-x C-f and then hit tab to choose action Complete at point \\
598 once you have found the filename you want.
599 \subsection{Create File}
600 \label{sec:create-file}
601 Navigate to the directory where you want to create your new file, then \\
602 continue typing the name of your file and type enter. \\
603 NOTE: If your filename ends with a / you will be prompt to create a new directory.
605 \subsection{Create Directory}
606 \label{sec:create-directory}
607 Navigate to the directory where you want to create your new directory, \\
608 then continue typing the name of new directory - Parents accepted - \\
609 and end it with / type enter, you will be prompt to create your new directory (possibly with parents).
611 \subsection{Ediff files}
612 \label{sec:ediff-files}
613 Well, that is easy to use,
614 move cursor to a file, hit ediff in action menu, you will jump in
615 another anything-find-files to choose second file.
616 \subsection{Ediff merge files}
617 \label{sec:ediff-merge-files}
618 move cursor to a file, hit ediff merge in action menu, you will jump in
619 another anything-find-files to choose second file.
621 \subsection{Browse archive with avfs}
622 \label{sec:browse-archive-with}
624 If you have installed avfs (See: http://sourceforge.net/projects/avf) you can browse archives
625 in your directory .avfs once it is mounted with ``mountavfs''.
627 Just move on the archive filename and press C-z (persistent action) and you will see
628 in anything buffer the subdirectories of archive, just navigate inside as usual.
630 \subsection{Display with icons}
631 \label{sec:display-with-icons}
633 You can have a more fancy display showing icons for files and directories.
634 Just add in .emacs:
635 \begin{verbatim}
636 (setq anything-c-find-files-show-icons t)
637 \end{verbatim}
638 NOTE: This will slowdown anything-find-files unless you have a fast computer.
640 \section{Anything write buffer}
641 \label{sec:anyth-write-buff}
642 That is a replacement of standard write-buffer Emacs command with anything completion.
643 \section{Anything insert file}
644 \label{sec:anything-insert-file}
645 That is a replacement of standard insert-file Emacs command with anything completion.
647 \section{Anything M-x}
648 \label{sec:anything-m-x}
649 It is binded to f5 a M-x, you should bind it to M-x.
651 Features:\\
652 \begin{itemize}
653 \item You can use prefix arguments before or during M-x session
654 \end{itemize}
655 \begin{itemize}
656 \item C-z is a toggle documentation for this command
657 \end{itemize}
658 \begin{itemize}
659 \item The key binding of command are shown.
660 \end{itemize}
662 \section{Anything regexp}
663 \label{sec:anything-regexp}
664 This is a replacement of regexp-builder.
665 The groups are shown in a convenient way.
667 \subsection{Query replace regexp}
668 \label{sec:query-replace-regexp}
669 Write your regexp in anything-regexp, when it match what you want,
670 you can run query-replace from action menu.
671 NOTE:
672 Before running anything-regexp, you can select a region to work in, that will narrow this region
673 automatically.
674 \subsection{Save regexp as sexp}
675 \label{sec:save-regexp-as}
676 When you use this, it will save your regexp for further use in lisp code,
677 with backslash duplicated.
679 \subsection{Save regexp as string}
680 \label{sec:save-regexp-as-1}
681 Save the regexp as you wrote it.
683 \section{Anything locate}
684 \label{sec:anything-locate}
685 First be sure you have a locate program installed on your system.
686 Most GNU/Linux distro come with locate included, you update or create the data base with
687 ``updatedb'' command.
689 \subsection{Search files}
690 \label{sec:search-files}
692 To use, just launch
693 \begin{verbatim}
694 M-x anything-locate (f5 a l)
695 \end{verbatim}
697 Then enter filename at prompt.
698 It will search this pattern entered also in directory and subdirectory names, to limit your search to basename,
699 add ``-b'' after pattern.
700 The search is performed on all files known in database, they maybe not exists anymore, so to limit to
701 really existing files add after pattern ``-e''.
702 To limit you search to specific number of results, use ``-n'' after your pattern with the number of results
703 you want.
705 Example:
706 \begin{verbatim}
707 Pattern: emacs -b -e -n 12
708 \end{verbatim}
710 \subsection{Launch grep}
711 \label{sec:launch-grep}
713 When search is done, you can search in a specific file or directory with grep that you will find in action menu (TAB).\\
715 \begin{itemize}
716 \item NOTE:You can now launch grep with (C-u) M-g s without switching to the action pannel.
717 \end{itemize}
719 \subsection{Windows specificity}
720 \label{sec:windows-specificity}
722 On Windows you should use Everything program that mimic locate, is very fast and don't need to
723 update database manually.
724 To use with anything-locate, you will need his command line named ``es''.
725 Be sure to modify the PATH environment variable, to include path to the directory that contain ``es''.
726 The arguments are the same than the ones in ``locate''.
728 \section{Anything Etags}
729 \label{sec:anything-etags}
731 \subsection{Create the tag file}
732 \label{sec:create-tag-file}
735 To use etags in Emacs you have first to create a TAGS file for your project with the etags shell command.
736 If your directory contains subdirectories use someting like:(e.g .el files)
737 \begin{verbatim}
738 find . -iregex .*\.el$ | xargs etags
739 \end{verbatim}
740 Otherwise
741 \begin{verbatim}
742 etags *.el
743 \end{verbatim}
744 is enough
746 For more infos see the man page of etags.
748 \subsection{Start anything etags}
749 \label{sec:start-anything-etags}
752 Now just using f5 a e will show you all entries.
753 If the project is big it take some time to load tag file but when it is done, next search will be very fast.
754 If you modify the TAGS file, use
755 \begin{verbatim}
756 C-u C-u f5 a e
757 \end{verbatim}
758 to refresh the tag cache.
760 To search the definition at point use just
761 \begin{verbatim}
762 C-u f5 a e
763 \end{verbatim}
765 \section{Firefox bookmarks}
766 \label{sec:firefox-bookmarks}
768 You will have to set firefox to import bookmarks in his html file book-marks.html.
769 \begin{verbatim}
770 (only for firefox versions >=3)
771 \end{verbatim}
772 To achieve that, open ``about:config'' in firefox and double click on this line to enable value to true :
773 \begin{verbatim}
774 user_pref("browser.bookmarks.autoExportHTML", false);
775 \end{verbatim}
776 You should have now :
777 \begin{verbatim}
778 user_pref("browser.bookmarks.autoExportHTML", true);
779 \end{verbatim}
780 Now you can use
781 \begin{verbatim}
782 M-x anything-firefox-bookmarks
783 \end{verbatim}
784 To see your firefox bookmarks from Emacs.
785 When you are in firefox things are a little more complicated. You will
786 need wmctrl program and a script named ffbookmarks :
787 \begin{verbatim}
788 #!/bin/bash
790 wmctrl -xa emacs
791 emacsclient -e "(progn (anything-firefox-bookmarks) nil)" > /dev/null
792 wmctrl -xa firefox
793 exit 0
794 \end{verbatim}
795 Put this script somewhere in PATH and make it executable :
796 \begin{verbatim}
797 chmod +x ffbookmarks
798 \end{verbatim}
800 Firefox is not aware about this new protocol, you will have to instruct
801 it. See Firefox documentation or use firefox-protocol.el package you can get
802 here: \\
803 \url{http://mercurial.intuxication.org/hg/emacs-bookmark-extension/} \\
804 Install new protocol: \\
805 \begin{verbatim}
806 M-x firefox-protocol-installer-install
807 \end{verbatim}
808 to install new protocol ffbookmarks
809 Then install a bookmarklet in firefox : Right click on the bookmark
810 toolbar in firefox and add a new bookmark called ffbookmarks. Add this
811 instead of url: \\
812 \begin{verbatim}
813 javascript:location.href='ffbookmarks://localhost'
814 \end{verbatim}
816 Now when you click on ffbookmarks it will bring you in Emacs and allow
817 you to browse your bookmarks with anything.
819 NOTE : emacs server need to be started in the running Emacs, see Emacs
820 documentation.
822 \section{Anything for buffers}
823 \label{sec:anything-buffers}
825 \begin{verbatim}
826 M-x anything-buffer+
827 \end{verbatim}
829 \subsection{Borring buffers}
830 \label{sec:borring-buffers}
832 Will show you your buffers list without borring buffers defined by regexp in
833 ``anything-c-boring-buffer-regexp''.
834 Just use customize to set that for your need.\\
836 \subsection{Search buffers by major-mode}
837 \label{sec:search-buffers-major}
840 Once in this anything session, you can narrow your buffer list by ``major mode'', regexp as usual or the both:\\
842 Example:\\
844 I want to show all my buffer that are in emacs-lisp mode:\\
846 Pattern: lisp \\
848 will show all emacs-lisp and lisp related buffers.\\
850 Now i want to limit these buffers to the one that match ``any''\\
852 Pattern: lisp any \\
854 I want to match buffers that match ``any'' but not limited to lisp buffers:\\
856 Pattern: any \\
858 \subsection{Different colors for buffers}
859 \label{sec:diff-colors-buff}
861 \begin{itemize}
862 \item If a buffer is modified, it will showup in orange.
863 \end{itemize}
864 \begin{itemize}
865 \item If a buffer have been modified by some external program (e.g sed) in the back of emacs, it will showup in red.
866 \end{itemize}
867 \begin{itemize}
868 \item Non--buffer file, Directory and files have differents face.
869 \end{itemize}
871 \subsection{Special commands}
872 \label{sec:special-commands}
873 Not complete.\\
875 C-c ? will show you all commands available.
878 \section{Other tools}
879 \label{sec:other-tools}
881 In addition of what is described above, you will find a bunch of powerfull tools that come with anything-config.el.
882 Just browse the anything commands availables with anything-M-x.
884 Not complete.
886 \section{Anything completion mode}
887 \label{sec:anyth-compl-mode}
888 `anything-completion-mode' aka `ac-mode' will enable anything completion in all
889 Emacs commands using `completing-read' or `read-file-name'.\\
890 To use it:
891 \begin{verbatim}
892 M-x ac-mode
893 \end{verbatim}
894 Turn it on in .emacs with:
895 \begin{verbatim}
896 (ac-mode 1)
897 \end{verbatim}
898 Customize with:\\
899 `anything-completing-read-handlers-alist'
901 See C-h v `anything-completing-read-handlers-alist' for more infos.
903 Not complete.
905 \section{Usefuls extensions}
906 \label{sec:usefuls-extensions}
907 Not complete.
909 \section{Usefuls links}
910 \label{sec:usefuls-links}
912 You can have info about anything on Emacswiki (Sometime deprecated).\\
913 \url{http://www.emacswiki.org/emacs/Anything}\\
915 You can ask on the anything mailing-list by subscribing at:\\
916 \url{https://groups.google.com/group/emacs-anything?hl=en}
918 Or at gmane: gmane.emacs.anything
920 \end{document}
922 %%% Local Variables:
923 %%% mode: latex
924 %%% TeX-master: t
925 %%% End: