1 % Reference Card for Dired
2 % Copyright (C) 2000. 2001 Free Software Foundation, Inc.
4 % This file is part of GNU Emacs.
6 % GNU Emacs is free software; you can redistribute it and/or modify
7 % it under the terms of the GNU General Public License as published by
8 % the Free Software Foundation; either version 2, or (at your option)
11 % GNU Emacs is distributed in the hope that it will be useful,
12 % but WITHOUT ANY WARRANTY; without even the implied warranty of
13 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 % GNU General Public License for more details.
16 % You should have received a copy of the GNU General Public License
17 % along with GNU Emacs; see the file COPYING. If not, write to
18 % the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19 % Boston, MA 02110-1301, USA.
21 % This file can be printed with 1, 2, or 3 columns per page (see below).
22 % Specify how many you want here. Nothing else needs to be changed.
25 \newcount\columnsperpage
29 % This file is intended to be processed by plain TeX (TeX82).
30 % The reference card looks OK with 2 columns per page, portrait mode.
31 % I haven't tried it with 3 columns per page.
33 % This is a bit of a dirty hack on the GNU Emacs reference card
34 % to produce a Dired reference card instead.
36 % I (Evgeny Roubinchtein, eroubinc@u.washington.edu) put this together
37 % because I wanted a Dired reference card,
38 % but couldn't find anything on the 'net.
39 % Based mostly off Dired's describe-mode.
42 \def\versionnumber{0.1}
44 \def\version{May
\year\ v
\versionnumber}
46 \def\shortcopyrightnotice{\vskip 1ex plus
2 fill
47 \centerline{\small \copyright\
\year\ Free Software Foundation, Inc.
48 Permissions on back. v
\versionnumber}}
51 \vskip 1ex plus
2 fill
\begingroup\small
52 \centerline{Copyright
\copyright\
\year\ Free Software Foundation, Inc.
}
53 \centerline{designed by Stephen Gildea,
\version}
54 \centerline{for GNU Emacs version
19 on Unix systems
}
55 \centerline{Updated for Dired in May
2000 by Evgeny Roubinchtein
}
57 Permission is granted to make and distribute copies of
58 this card provided the copyright notice and this permission notice
59 are preserved on all copies.
61 For copies of the GNU Emacs manual, write to the Free Software
62 Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston,
67 % make \bye not \outer so that the \def\bye in the \else clause below
68 % can be scanned without complaint.
69 \def\bye{\par\vfill\supereject\end}
71 \newdimen\intercolumnskip %horizontal space between columns
72 \newbox\columna %boxes to hold columns already built
75 \def\ncolumns{\the\columnsperpage}
77 \message{[\ncolumns\space
78 column
\if 1\ncolumns\else s
\fi\space per page
]}
80 \def\scaledmag#1{ scaled
\magstep #1}
82 % This multi-way format was designed by Stephen Gildea October 1986.
83 % Note that the 1-column format is fontfamily-independent.
84 \if 1\ncolumns %one-column format uses normal size
88 \font\titlefont=
\fontname\tenbf \scaledmag3
89 \font\headingfont=
\fontname\tenbf \scaledmag2
90 \font\smallfont=
\fontname\sevenrm
91 \font\smallsy=
\fontname\sevensy
94 \def\makefootline{\baselineskip10pt\hsize6.5in
\line{\the\footline}}
95 \else %2 or 3 columns uses prereduced size
100 \font\titlefont=cmbx10
\scaledmag2
101 \font\headingfont=cmbx10
\scaledmag1
117 \normalbaselineskip=
.8\normalbaselineskip
118 \normallineskip=
.8\normallineskip
119 \normallineskiplimit=
.8\normallineskiplimit
120 \normalbaselines\rm %make definitions take effect
124 \footline{\hss\rm\folio\hss}
125 \def\makefootline{\vskip 2in
\hsize=
6.86in
\line{\the\footline}}
130 \errhelp{You must set
\columnsperpage equal to
1,
2, or
3.
}
131 \errmessage{Illegal number of columns per page
}
134 \intercolumnskip=
.46in
136 \output=
{% %see The TeXbook page 257
137 % This next line is useful when designing the layout.
138 %\immediate\write16{Column \folio\abc\space starts with \firstmark}
139 \if \maxcolumn\abc \multicolumnformat \global\def\abc{a
}
141 \global\setbox\columna\columnbox \global\def\abc{b
}
142 %% in case we never use \columnb (two-column mode)
143 \global\setbox\columnb\hbox to -
\intercolumnskip{}
145 \global\setbox\columnb\columnbox \global\def\abc{c
}\fi\fi}
146 \def\multicolumnformat{\shipout\vbox{\makeheadline
147 \hbox{\box\columna\hskip\intercolumnskip
148 \box\columnb\hskip\intercolumnskip\columnbox}
149 \makefootline}\advancepageno}
150 \def\columnbox{\leftline{\pagebody}}
152 \def\bye{\par\vfill\supereject
153 \if a
\abc \else\null\vfill\eject\fi
154 \if a
\abc \else\null\vfill\eject\fi
158 % we won't be using math mode much, so redefine some of the characters
159 % we might want to talk about
167 \hyphenation{mini-buf-fer
}
168 \hyphenation{de-le-tion
}
171 \parskip 1ex plus
.5ex minus
.5ex
173 \def\small{\smallfont\textfont2=
\smallsy\baselineskip=
.8\baselineskip}
175 % newcolumn - force a new column. Use sparingly, probably only for
176 % the first column of a page, which should have a title anyway.
177 \outer\def\newcolumn{\vfill\eject}
179 % title - page title. Argument is title text.
180 \outer\def\title#1{{\titlefont\centerline{#1}}\vskip 1ex plus
.5ex
}
182 % section - new major section. Argument is section name.
183 \outer\def\section#1{\par\filbreak
184 \vskip 3ex plus
2ex minus
2ex
{\headingfont #1}\mark{#1}%
185 \vskip 2ex plus
1ex minus
1.5ex
}
189 % beginindentedkeys...endindentedkeys - key definitions will be
190 % indented, but running text, typically used as headings to group
191 % definitions, will not.
192 \def\beginindentedkeys{\keyindent=
1em
}
193 \def\endindentedkeys{\keyindent=
0em
}
196 % paralign - begin paragraph containing an alignment.
197 % If an \halign is entered while in vertical mode, a parskip is never
198 % inserted. Using \paralign instead of \halign solves this problem.
199 \def\paralign{\vskip\parskip\halign}
201 % \<...> - surrounds a variable name in a code example
202 \def\<
#1>
{{\it #1\/
}}
204 % kbd - argument is characters typed literally. Like the Texinfo command.
205 \def\kbd#1{{\tt#1}\null} %\null so not an abbrev even if period follows
207 % beginexample...endexample - surrounds literal text, such a code example.
208 % typeset in a typewriter font with line breaks preserved
209 \def\beginexample{\par\leavevmode\begingroup
210 \obeylines\obeyspaces\parskip0pt\tt}
211 {\obeyspaces\global\let =\
}
212 \def\endexample{\endgroup}
214 % key - definition of a key.
215 % \key{description of key}{key-name}
216 % prints the description left-justified, and the key-name in a \kbd
217 % form near the right margin.
218 \def\key#1#2{\leavevmode\hbox to
\hsize{\vtop
219 {\hsize=
.75\hsize\rightskip=
1em
220 \hskip\keyindent\relax#1}\kbd{#2}\hfil}}
223 \setbox\metaxbox\hbox{\kbd{M-x
}}
225 \metaxwidth=
\wd\metaxbox
227 % metax - definition of a M-x command.
228 % \metax{description of command}{M-x command-name}
229 % Tries to justify the beginning of the command name at the same place
230 % as \key starts the key name. (The "M-x " sticks out to the left.)
231 \def\metax#1#2{\leavevmode\hbox to
\hsize{\hbox to
.75\hsize
232 {\hskip\keyindent\relax#1\hfil}%
233 \hskip -
\metaxwidth minus
1fil
236 % threecol - like "key" but with two key names.
237 % for example, one for doing the action backward, and one for forward.
238 \def\threecol#1#2#3{\hskip\keyindent\relax#1\hfil&
\kbd{#2}\hfil\quad
239 &
\kbd{#3}\hfil\quad\cr}
241 % I cannot figure out how to make all dired-x
242 % commands fit on a page in two-column format
248 \title{Dired Reference Card
}
250 \centerline{(based on Dired in GNU Emacs
21.x)
}
251 \centerline{Commands marked with
\dx{} require dired-x
}
253 % trim this down to fit everything on one page
255 % In dired, you can edit a list of the files in a directory (and optionally
256 % its subdirectories in the `ls -lR' format).
258 % Editing a directory means that you can visit, rename, copy, compress,
259 % load, byte-compile files. You can change files' attributes, run shell
260 % commands on files, or insert subdirectories into the edit buffer. You can
261 % "flag" files for deletion or "mark" files for later commands, either one
262 % file at a time or by all files matching certain criteria (e.g., files that
263 % match a certain regexp).
265 % You move throughout the buffer using the usual cursor motion commands.
266 % Letters no longer insert themselves, but execute commands instead. The
267 % digits (0-9) are prefix arguments.
269 % Most commands operate either on all marked files or on the current file if
270 % no files are marked. Use a numeric prefix argument to operate on the next
271 % ARG files (or previous ARG if ARG $<$ 0). Use the prefix argument `1' to
272 % operate on the current file only. Prefix arguments override marks. Commands
273 % which run a sub-process on a group of files will display a list of files
274 % for which the sub-process failed. Typing y will try to tell
275 % you what went wrong.
277 % When editing several directories in one buffer, each directory acts as a
278 % page, so C-x [ and C-x ] can be used to move between directories.
280 \section{Entering and Exiting Dired
}
282 \key{run dired
}{C-x d
}
283 \key{dired the directory of the file you are editing
}{C-x C-j
\dx}
286 \section{Motion Commands
}
288 \key{move up to previous line
}{p
}
289 \key{move down to next line
}{n
}
290 \key{move up to previous directory line
}{<
}
291 \key{move down to next directory line
}{>
}
292 \key{move to next marked file
}{M-\
}}
293 \key{move to previous marked file
}{M-\
{}
294 \key{move up to previous subdirectory
}{M-C-p
}
295 \key{move down to next subdirectory
}{M-C-n
}
296 \key{move to parent directory
}{^
}
297 \key{move to first child subdirectory
}{M-C-d
}
299 \section{Mouse Commands
}
300 \metax{visit file
}{Mouse_Button_2
}
301 \metax{popup menu
}{Control-Mouse_Button_3
}
303 \section{Immediate Actions on Files
}
305 \key{visit current file
}{f
}
306 \key{view current file
}{v
}
307 \key{visit current file in other window
}{o
}
308 \key{visit current file in other frame
}{w
}
309 \key{display current file
}{C-u o
}
310 \key{create a new subdirectory
}{+
}
311 \key{compare file at point with the one at mark
}{=
}
313 \section{Marking and Unmarking Files
}
315 \key{mark a file or subdirectory for later commands
}{m
}
316 \key{unmark a file or all files of a subdirectory
}{u
}
317 \key{unmark all marked files in a buffer
}{M-delete
}
318 \key{mark files with a given extension
}{* .
}
319 \key{mark all directories
}{* /
}
320 \key{mark all symlinks
}{* @
}
321 \key{mark all executables
}{* *
}
322 \key{invert marking
}{* t
}
323 \key{mark all files in the current subdir
}{* s
}
324 \key{mark file names matching a regular expression
}{* \%
}
325 \key{change the marks to a different character
}{* c
}
326 \key{mark files for which Elisp expression returns t
}{* (
\dx}
328 \section{Getting Help
}
331 \key{dired summary (short help) and error log
}{?
}
333 \section{Commands on Files Marked or Specified by the Prefix
}
335 \key{copy file(s)
}{C
}
336 \key{rename a file or move files to another directory
}{R
}
337 \key{change ownership of file(s)
}{O
}
338 \key{change the group of the file(s)
}{G
}
339 \key{change mode of file(s)
}{M
}
340 \key{print file(s)
}{P
}
341 \key{convert filename(s) to lower case
}{\% l
}
342 \key{convert filename(s) to upper case
}{\% u
}
343 \key{delete marked (as opposed to flagged) files
}{X
}
344 \key{uuencode or uudecode file(s)
}{U
}
345 \key{compress or uncompress file(s)
}{Z
}
346 \key{run info on file
}{I
\dx}
347 \key{make symbolic link(s)
}{S
}
348 \key{make relative symbolic links
}{Y
}
349 \key{make hard link(s)
}{H
}
350 \key{search files for a regular expression
}{A
}
351 \key{query replace regular expression
}{Q
}
352 \key{byte-compile files
}{B
}
354 \key{shell command on file(s)
}{!
}
356 \section{Flagging Files for Deletion
}
357 \leftline{\bf Unmark commands remove delete flags
}
358 \key{flag file for deletion
}{d
}
359 \key{backup and remove deletion flag
}{delete
}
360 \key{flag all backup files (file names ending in \~
{})
}{\~
{}}
361 \key{flag all auto-save files
}{\#
}
362 \key{flag various intermediate files
}{\&
}
363 \key{flag numeric backups (ending in .\~
{}1\~
{}, .\~
{}2\~
{}, etc.)
}{.
}
364 \key{execute the deletions requested (flagged files)
}{x
}
365 \key{flag files matching a regular expression
}{\% d
}
367 \section{Modifying the Dired Buffer
}
369 \key{insert a subdirectory into this buffer
}{i
}
370 \key{remove marked files from the listing
}{k
}
371 \key{remove a subdir listing
}{C-u k
}
372 \key{re-read all directories (retains all marks)
}{g
}
373 \key{toggle sorting of current subdir by name/date
}{s
}
374 \key{edit ls switches
}{C-u s
}
375 \key{recover marks, hidden lines, and such
}{C-_
}
376 \key{hide all subdirectories
}{M-\$
}
377 \key{hide or unhide subdirectory
}{\$
}
379 \section{Regular Expression Commands
}
381 \key{mark filenames matching a regular expression
}{\% m
}
382 \key{copy marked files by regexp
}{\% C
}
383 \key{rename marked files by regexp
}{\% R
}
386 \key{symlink, with relative paths
}{\% Y
}
387 \key{mark for deletion
}{\% d
}
389 \section{Dired and Find
}
390 \metax{dired file(s) whose name matches a pattern
}{M-x find-name-dired
}
391 \metax{dired file(s) that contain pattern
}{M-x find-grep-dired
}
392 \metax{dired file(s) based on
\kbd{find
} output
}{M-x find-dired
}
398 % arch-tag: 483e7bb4-4576-4733-9fca-0eae1c861484