-
Notifications
You must be signed in to change notification settings - Fork 3
/
les.1
220 lines (220 loc) · 5.13 KB
/
les.1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
.TH LES 1 "2017-03-18"
.SH NAME
les - A pager program similar to less and more
.SH SYNOPSIS
\fBles\fP [\fB-fhmw\fP] [\fB-e\fP=\fIencoding\fP] [\fB-p\fP=\fIscript\fP] [\fB-t\fP=\fIwidth\fP] \fIfile\fP...
.SH DESCRIPTION
Les is a program for paging through files and stdin. It is similar
to the \fBless\fP(1) program but with some features added and some
removed.
.SH OPTIONS
.TP
\fB-e\fP=\fIencoding\fP
input file encoding
.TP
\fB-f\fP
load forever
.TP
\fB-h\fP
help
.TP
\fB-m\fP
input is a man page
.TP
\fB-p\fP=\fIscript\fP
lespipe script
.TP
\fB-t\fP=\fIwidth\fP
tab width (default 4)
.TP
\fB-w\fP
disable line wrap
.SH FEATURES / TAB BAR
.PP
If you open multiple files, the top line will show them all as a
list of tabs. Press t and T to cycle through them, q to close one,
and Q to close all of them.
.SH STATUS BAR
.PP
At the bottom of the screen is a status bar that shows information
like the filename, line numbers, and the file size. The color in the
background shows how far through the file you are.
.SH UNICODE
.PP
This program handles Unicode in order to get the right number of
characters on a line. This requires the program to know the number
of bytes in each character, and the screen width of the character
(characters in Unicode can take 0, 1, or 2 widths). the input file
is assumed to be UTF-8. If it isn't, then you can give the correct
encoding with the -e (encoding) option.
.SH SEARCHING
.PP
When you search, all matches will be highlighted in blue, the one
you are up to in green. If the match is on the page you are currently
viewing the page will not move. If it is less than a page away,
then it will only move as far as it needs to show the next match.
If the match is further away then it will position the screen with
the match in the center. If you move the screen away from the current
match, the next time you press n, the program will search forward
for a match from the beginning of the screen you are currently
looking at.
.PP
The number of matches is shown in the status bar.
.PP
You can recall your previous search entries by pressing up or down
at the search prompt. Search history is stored in the ~/.les_history
file.
.SH MAN PAGES
.PP
You can set your man page output to be piped through les by adding
the following to your .bashrc:
.PP
.RS
.nf
alias man="man -P \\"les -m\\""
.fi
.RE
.PP
The -m option puts the name of the man page into the status line
and recognizes backspace escapes specially.
.SH GIT DIFF
.PP
You can set les to be your git diff viewer by adding the following
to your .gitconfig:
.PP
.RS
.nf
[core]
pager = les
.fi
.RE
.SH LESPIPE SCRIPT
.PP
Files opened in les are processed through the lespipe script. This
allows the program to print out the contents of tar files or
decompress gziped files on the fly.
.PP
The default script is installed in /usr/local/share/les/lespipe,
but it can be overridden by specifying an alternate program name
with the -p option. If the script is specified as "none", then there
will be no processing of inputs.
.PP
The lespipe script is given the file name as its first argument.
If the script doesn't want to process the file, it needs to print
nothing to stdout. If the script wants to process the file, it needs
to print one line describing the type of processing, followed by
the processed content. Here is a short working example of a lespipe
script:
.PP
.RS
.nf
#!/bin/bash
if [ -d "$1" ]; then
echo directory
ls -l "$1"
elif [[ "$1" = *.gz ]]; then
echo gzip
gzcat "$1"
fi
.fi
.RE
.SH MOUSEWHEEL SCROLL
.PP
This program allows you to scroll the page using the mousewheel.
It works by putting the terminal into "keyboard transmit mode" which
makes the terminal send up and down arrows when you use the mousewheel.
.SH RECENT FILES LIST
.PP
When you close a file, that file is remembered in a recent files
list, stored in ~/.les_recents. You can view the list by pressing F2.
.SH RESUMING AT YOUR LAST POSITION
.PP
When you reopen a file that you viewed before, you will be positioned
at the line you last left off.
.SH LOADING FOREVER
.PP
If you are reading a file that grows such as a log file, you can
instruct the program to load forever with the -f option or the F
key bind. When additional data is read, your screen will move to
the end. When in load forever mode, the status bar will show "..."
in it. This is similar to the "tail -f" command.
.SH KEY BINDS
.TP
\fBd\fP
go down half a screen
.TP
\fBD,pgdn\fP
go down a screen
.TP
\fBF\fP
load forever
.TP
\fBg\fP
go to the top
.TP
\fBG\fP
go to the bottom
.TP
\fBh,left\fP
go left one third a screen
.TP
\fBH,home\fP
go left all the way
.TP
\fBj,down\fP
go down one line
.TP
\fBk,up\fP
go up one line
.TP
\fBl,right\fP
go right one third a screen
.TP
\fBL,end\fP
go right all the way
.TP
\fBm\fP
mark position
.TP
\fBM\fP
go to marked position
.TP
\fBn\fP
go to next match
.TP
\fBN\fP
go to previous match
.TP
\fBq\fP
close file
.TP
\fBQ\fP
close all files
.TP
\fBt\fP
go to next tab
.TP
\fBT\fP
go to previous tab
.TP
\fBu\fP
go up half a screen
.TP
\fBU,pgup\fP
go up a screen
.TP
\fBw\fP
toggle line wrap
.TP
\fB/\fP
search
.TP
\fBF1\fP
view help
.TP
\fBF2\fP
view recently opened files
.SH SEE ALSO
\fBless\fP(1), \fBmore\fP(1)
.SH AUTHOR
Jacob Gelbman <[email protected]>