Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 86 lines (86 sloc) 2.025 kb
9f1c6f0f »
2011-12-10 Import Elvis 2.2_0 (written by Steve Kirkendall)
1 .TH FMT 1 "" "" "User commands"
2 .SH NAME
3 fmt \- adjust line-length for paragraphs of text
4 .SH SYNOPSIS
5 .ad l
6 .B fmt
7 .RB [ \-w
8 .I width
9 |
10 .BR \-\fIwidth ]
11 .RB [ \-s ]
12 .RB [ \-c ]
13 .RB [ \-i
14 .IR chars ]
15 .RB [ \-C ]
16 .RB [ \-M ]
17 .RI [ file ]...
18 .ad b
19 .SH VERSION
20 This page describes the
2fe6e177 »
2011-12-10 Import Elvis 2.2_1 (written by Steve Kirkendall)
21 .B Elvis 2.2_1
9f1c6f0f »
2011-12-10 Import Elvis 2.2_0 (written by Steve Kirkendall)
22 version of
23 .BR fmt .
24 See
25 .BR elvis (1).
26 .SH DESCRIPTION
27 .B fmt
28 is a simple text formatter.
29 It inserts or deletes newlines, as necessary, to make all lines in a
30 paragraph be approximately the same width.
31 It preserves indentation and word spacing.
32 .PP
33 If you don't name any files on the command line,
34 then
35 .B fmt
36 will read from stdin.
37 .PP
38 It is typically used from within
39 .BR vi (1)
40 or
41 .BR elvis (1)
42 to adjust the line breaks
43 in a single paragraph.
44 To do this, move the cursor to the top of the paragraph,
45 type "!}fmt", and
46 hit <Return>.
47 .SH OPTIONS
48 .IP "\fB\-w\fP \fIwidth\fP or \fB\-\fP\fIwidth\fP"
49 Use a line width of \fIwidth\fP characters instead of the default
50 of 72 characters.
51 .IP \fB\-s\fP
52 Don't join lines shorter than the line width to fill paragraphs.
53 .IP \fB\-c\fP
54 Try to be smarter about crown margins.
55 Specifically, this tells
56 .B fmt
57 to expect the first line of each paragraph to have a different
58 indentation than subsequent lines.
59 If text from the first input line is wrapped onto the second output line, then
60 .B fmt
61 will scan ahead to figure out what indentation it should use for the second
62 output line, instead of reusing the first line's indentation.
63 .IP "\fB\-i\fP \fIchars\fP"
64 Allow the indentation text to include any character from
65 .IR chars ,
66 in addition to spaces and tabs.
67 You should quote the
68 .I chars
69 list to protect it from the shell.
70 .IP "\fB\-C\fP and \fB\-M\fP"
71 These are shortcuts for combinations of other flags.
72 .RB \" \-C \"
73 is short for
74 .RB \" "\-c \-i'/*'" \"
75 and is useful for reformatting C/C++ comments.
76 .RB \" \-M \"
77 is short for
78 .RB \" \-i'>' \"
79 and is useful for reformatting email messages.
80 .SH "SEE ALSO"
81 .BR vi (1),
82 .BR elvis (1)
83 .SH AUTHOR
84 Steve Kirkendall
85 .br
86 kirkenda@cs.pdx.edu
Something went wrong with that request. Please try again.