fv

Purpose

File viewer. Can do syntax highlighting for COBOL and shell scripts. Can cope with a maximum file size of 200,000 lines or 2MB, whichever is lower. Searching can be by string or regular expression. Can have up to five windows on a file which can be toggled between. Can be used at the end of a pipe to view standard output.

Syntax

fv [ filename ]

Description

If the file name is not supplied, it will be requested unless fv is being used at the end of a pipe to display standard input.

Shows a window onto a file in character format. The window can be moved both vertically and horizontally in the file. The display consists of lines of hex, interpreted as hex, interspersed with the same segment of line with the printable characters shown. Where a non-space character is unprintable, it will be displayed as a blue underscore.

Functions

Key Action
Escape Exit
F1 Show help screen
F2 to F5 Toggle between screens (see below)
F6 Options for syntax highlighting
F10 Reload file and go back to start
F11 Load another file
F, / Search - can be either a simple search or a regular expression
G Go to line number - "-" goes to start of file, "+" to end
Line number can be put in before "G", as per vi
Cursor left, cursor right Page left or right
L, <, R, > Page left or right
[, ] Word left or right
Home, End Go to start or end of line. If End is pressed, the end of line status will be maintained while scrolling up or down until a horizontal cursor movement is made.
E Execute vi on the file starting at the current position, then reload it
M View the file with more, then reload it
! Execute a shell command
? Show file name and current directory

You can have up to five windows on the file, called screens 1-5. These are selected by pressing keys F2-F5 for screens 2-5. If a key F2-F5 is pressed when on the corresponding screen, the view will toggle to screen 1. For example, if you're on screen 2 and press F4, you'll be taken to screen 4 - if you then press F4 again, you'll be toggled into screen 1. This avoids confusion as F1 is used for the help screen. It makes sense to me, anyway.

Script

COBOL source