vimcat - vim based syntax highlighter
vimcat [options] file1 [file2 ...]
Prints a file to stdout, syntax-highlighting it using vim as a backend.
On GitHub: http://github.com/rkitover/vimpager
To use a different vimrc with vimcat, put your settings into a ~/.vimcatrc.
To disable loading plugins, put "set noloadplugins" into a ~/.vimcatrc file.
If output is not a terminal, it will simply run cat, so using vimcat in pipe commands is safe. If you actually need the ANSI codes, use -o .
vimcat defaults to syntax on and set bg=dark. If you need bg=light do something like this:
alias vimcat="vimcat -c 'set bg=light'"
To use with less, add the following to your ~/.bashrc
:
export LESS='-R'
export LESSOPEN='|vimcat -o - %s'
Print summary of options.
Print the version information.
Display line numbers.
Run a vim command after opening the file. Multiple -c arguments are supported.
Run a vim command when entering vim before anything else. Multiple --cmd arguments are supported.
Use an alternate .vimrc or .vimcatrc.
Write output to output_file instead of the terminal. This works when vimcat is not run on a terminal as well.
If output_file is "-" then output is written to STDOUT. An extra newline will not be output if there isn't one at the end of the file with this option, but will be in normal operation with a terminal.
Squeeze multiple blank lines into one.
Enable debugging output for the shell script part of vimcat.
Set to non-zero value to not silence vim when sourcing the viml and running the highlighting code. Only useful for developers.