The original tip (below) was for a "more"-style pager. It is kept here because it explains the principles nicely. First, create a vimrc like the following – I called mine ~/.vimrc.more " No compatibility – necessary for mappings to work. set nocompatible " Status line set laststatus=0 set cmdheight=1 set nomodifiable " Only in version 6.0 set readonly " My xterms have a navy-blue background, so I need this line too. set background=dark " Turn syntax on syntax enable " No menu bar and tool bar set guioptions=aiMr " Key bindings. nmap b nmap q :q! nmap nmap " To type the following line, type *two* C-V's followed by two spaces. This " is how you map the spacebar. nmap ^V
| Attributes | Values |
|---|
| rdfs:label
| - Using vim as a syntax-highlighting pager
|
| rdfs:comment
| - The original tip (below) was for a "more"-style pager. It is kept here because it explains the principles nicely. First, create a vimrc like the following – I called mine ~/.vimrc.more " No compatibility – necessary for mappings to work. set nocompatible " Status line set laststatus=0 set cmdheight=1 set nomodifiable " Only in version 6.0 set readonly " My xterms have a navy-blue background, so I need this line too. set background=dark " Turn syntax on syntax enable " No menu bar and tool bar set guioptions=aiMr " Key bindings. nmap b nmap q :q! nmap nmap " To type the following line, type *two* C-V's followed by two spaces. This " is how you map the spacebar. nmap ^V
|
| Version
| |
| dbkwik:vim/property/wikiPageUsesTemplate
| |
| Previous
| |
| Text
| |
| Author
| |
| Complexity
| |
| Created
| |
| ID
| - 121(xsd:integer)
- 1723(xsd:integer)
|
| NEXT
| |
| Rating
| |
| abstract
| - The original tip (below) was for a "more"-style pager. It is kept here because it explains the principles nicely. First, create a vimrc like the following – I called mine ~/.vimrc.more " No compatibility – necessary for mappings to work. set nocompatible " Status line set laststatus=0 set cmdheight=1 set nomodifiable " Only in version 6.0 set readonly " My xterms have a navy-blue background, so I need this line too. set background=dark " Turn syntax on syntax enable " No menu bar and tool bar set guioptions=aiMr " Key bindings. nmap b nmap q :q! nmap nmap " To type the following line, type *two* C-V's followed by two spaces. This " is how you map the spacebar. nmap ^V Then, to use this .vimrc, add an alias. If you're using tcsh, the syntax will be something like: alias vmore "vim -u ~/.vimrc.more -" Then you can type <i>program</i> | vmore to view <i>program</i>'s output in this "pager". Spacebar will move down, 'b' will move back up, and 'q' quits. You can add mappings for other keys if you want to, also. Those who like to use Vim as a viewer might want to see Using Vim as a man-page viewer under Unix.
|