forked from rkitover/vimpager
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvimpager.1
227 lines (227 loc) · 5.98 KB
/
vimpager.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
221
222
223
224
225
226
227
.TH VIMPAGER 1 "August 4, 2014" "vimpager user manual"
.SH NAME
.PP
vimpager - less.sh replacement
.SH SYNOPSIS
.PP
vimpager \[aq]some file\[aq]
.PP
# or (this won\[aq]t always syntax highlight as well)
.PP
cat \[aq]some file\[aq] | vimpager
.SH RUN-TIME DEPENDENCIES
.IP \[bu] 2
vim
.IP \[bu] 2
sharutils or some uudecode (optional)
.SH BUILD DEPENDENCIES
.IP \[bu] 2
sharutils or some uuencode
.IP \[bu] 2
pandoc
.SH INSTALL
.IP
.nf
\f[C]
git\ clone\ git://github.com/rkitover/vimpager
cd\ vimpager
sudo\ make\ install
\f[]
.fi
.PP
In your ~/.bashrc add the following:
.IP
.nf
\f[C]
export\ PAGER=/usr/local/bin/vimpager
alias\ less=$PAGER
alias\ zless=$PAGER
\f[]
.fi
.SH DESCRIPTION
.PP
A slightly more sophisticated replacement for less.sh that also supports
being set as the PAGER environment variable.
Displays man pages, perldocs and python documentation properly.
Works on Linux, Solaris, FreeBSD, NetBSD, OpenBSD, OSX, Cygwin and msys.
Should work on most other systems as well.
.PP
On GitHub: <http://github.com/rkitover/vimpager>
.PP
To use a different vimrc with vimpager, put your settings into a
~/.vimpagerrc or ~/.vim/vimpagerrc or a file pointed to by the
VIMPAGER_RC environment variable.
.PP
You can also have a global config file for all users in /etc/vimpagerrc,
users can override it by creating a ~/.vimpagerrc or a
~/.vim/vimpagerrc.
.PP
To disable loading plugins, put "set noloadplugins" into a vimpagerrc
file.
.PP
You can also switch on the "vimpager" variable in your vimrc to set
alternate settings for vimpager.
.PP
Put the following into your .vimrc/vimpagerrc if you want to use
gvim/MacVim for your pager window:
.IP
.nf
\f[C]
let\ vimpager_use_gvim\ =\ 1
\f[]
.fi
.PP
To turn off the feature of passing through text that is smaller than the
terminal height use this:
.IP
.nf
\f[C]
let\ vimpager_passthrough\ =\ 0
\f[]
.fi
.PP
See "PASSTHROUGH MODE" further down.
.PP
To start vim with -X (no x11 connection, a bit faster startup) put the
following into your .vimrc/vimpagerrc:
.IP
.nf
\f[C]
let\ vimpager_disable_x11\ =\ 1
\f[]
.fi
.PP
The scroll offset (:help scrolloff), may be specified by placing the
following into your .vimrc/vimpagerrc (default = 5, disable = 0):
.IP
.nf
\f[C]
let\ vimpager_scrolloff\ =\ 5
\f[]
.fi
.PP
The process tree of vimpager is available in the "vimpager_ptree"
variable, an example usage is as follows:
.IP
.nf
\f[C]
if\ exists("vimpager")
\ \ if\ exists("vimpager_ptree")\ &&\ vimpager_ptree[-2]\ ==\ \[aq]wman\[aq]
\ \ \ \ set\ ft=man
\ \ endif
endif
\f[]
.fi
.PP
To disable the use of AnsiEsc.vim to display ANSI colors in the source,
set:
.IP
.nf
\f[C]
let\ vimpager_disable_ansiesc\ =\ 1
\f[]
.fi
.PP
see the section "ANSI ESCAPE SEQUENCES AND OVERSTRIKES" for more
details.
.SH COMMAND LINE OPTIONS
.SS + | +G
.PP
Start at the end of the file, just like less.
.SS -c cmd
.PP
Run a vim command after opening the file.
.SH ANSI ESCAPE SEQUENCES AND OVERSTRIKES
.PP
If your source is using ANSI escape codes, the AnsiEsc plugin will be
used to show them, rather than the normal vim highlighting, however read
the caveats below.
If this is not possible, they will be stripped out and normal vim
highlighting will be used instead.
.PP
Overstrikes such as in man pages will always be removed.
.PP
vimpager bundles the
AnsiEsc (http://www.vim.org/scripts/script.php?script_id=4979) plugin
(it is expanded at runtime, there is nothing you have to do to enable
it.)
.PP
However, your vim must have been compiled with the \[aq]conceal\[aq]
feature enabled.
To check, try
.IP
.nf
\f[C]
:echo\ has("conceal")
\f[]
.fi
.PP
if the result is \[aq]1\[aq] you have conceal, if it\[aq]s \[aq]0\[aq]
you do not, and the AnsiEsc plugin will not be enabled.
.PP
If you\[aq]re on a Mac, the system vim does not enable this feature,
install vim from Homebrew.
.PP
To disable the use of AnsiEsc.vim, set:
.IP
.nf
\f[C]
let\ vimpager_disable_ansiesc\ =\ 1
\f[]
.fi
.PP
in your .vimrc.
.SH PASSTHROUGH MODE
.PP
If the text sent to the pager is smaller than the terminal window, then
it will be displayed without vim as text.
If it has ansi codes, they will be preserved, depending on your
"vimpager_disable_ansiesc" setting, otherwise the text will be
highlighted with vimcat.
.PP
You can turn this off by putting
.IP
.nf
\f[C]
let\ vimpager_enable_passthrough\ =\ 0
\f[]
.fi
.PP
Passthrough mode requires a POSIX shell with arithmetic expansion, if
there is one on your system and it is not detected please submit an
issue with the path and your OS version.
.SH CYGWIN/MSYS/MSYS2 NOTES
.PP
vimpager works correctly with the native Windows gvim, just put it in
your PATH and set the vimpager_use_gvim option as described above.
.SH LICENSE AND COPYRIGHT
.PP
Copyright (c) 2014, Rafael Kitover <[email protected]> and contributors
(see the list of CONTRIBUTORS at the bottom of the \[aq]vimpager\[aq]
file.)
.PP
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
.PP
Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
.PP
Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
.PP
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER ``AS IS\[aq]\[aq] AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
.SH AUTHORS
Rafael Kitover <[email protected]>.