Feature-rich terminal pager ov
- 1. Feature
- 2. Install
- 3. Basic usage
- 4. Usage
- 6. Command option
- 7. Key bindings
- 8. Customize
- 9. VS
- 10. Work together
- 11. Contributing
1. Feature
- Quickly opens files larger than memory.
- Supports fixed header lines and columns.
- Optimized for tabular text with column mode and customizable column colors.
- Fully customizable shortcut keys and styles.
- Follow mode for real-time updates (like
tail -f/tail -F). - Exec mode to display command output dynamically.
- Watch mode to monitor file changes periodically.
- Advanced search: incremental, regex, and filter functions.
- Multi-color highlighting for multiple words.
- Supports Unicode and East Asian Width characters.
- Handles compressed files (gzip, bzip2, zstd, lz4, xz).
1.1. Not supported
- Does not support syntax highlighting for file types (source code, markdown, etc.)
2. Install
2.1. deb package
You can download the package from releases.
curl -L -O https://github.com/noborus/ov/releases/download/vx.x.x/ov_x.x.x-1_amd64.deb
sudo dpkg -i ov_x.x.x-1_amd64.deb
2.2. rpm package
You can download the package from releases.
sudo rpm -ivh https://github.com/noborus/ov/releases/download/vx.x.x/ov_x.x.x-1_amd64.rpm
2.3. MacPorts (macOS)
sudo port install ov
2.4. Homebrew(macOS or Linux)
brew install ov
2.5. winget(windows)
winget install -e --id noborus.ov
2.6. pkg (FreeBSD)
pkg install ov
2.7. Arch Linux
You can install ov using an AUR helper.
Choose an AUR package:
- https://aur.archlinux.org/packages/ov (build and install from latest stable source)
- https://aur.archlinux.org/packages/ov-bin (install pre-compiled binary)
- https://aur.archlinux.org/packages/ov-git (build and install from latest git commit)
2.8. nix (nixOS, Linux, or macOS)
ov is available as a nix package. You can install it with
nix profile install nixpkgs#ov
if you use flakes, or using nix-env otherwise:
nix-env -iA nixpkgs.ov
2.9. conda-forge (Linux, windows, or macOS)
ov is available as a conda-forge package. You can install it with
conda install ov -c conda-forge
or
pixi global install ov
2.10. Binary
You can download the binary from releases.
curl -L -O https://github.com/noborus/ov/releases/download/vx.x.x/ov_x.x.x_linux_amd64.zip
unzip ov_x.x.x_linux_amd64.zip
sudo install ov /usr/local/bin
2.11. go install
It will be installed in $GOPATH/bin by the following command.
go install github.com/noborus/ov@latest
Or to install the latest commit from master:
go install github.com/noborus/ov@master
2.12. Build from source
First of all, clone this repo with either git clone or gh repo clone, then cd to the directory, for example:
git clone https://github.com/noborus/ov.git
cd ov
Next, to install to $GOPATH/bin, run the make install command.
make install
Or, install it in a PATH location for other users to use (For example, in /usr/local/bin).
make
sudo install ov /usr/local/bin
2.13. Completion
You can generate completion scripts for bash, zsh, fish, and powershell.
2.13.1. bash
ov --completion bash > /etc/bash_completion.d/ov
2.13.2. zsh
ov --completion zsh > /usr/share/zsh/site-functions/_ov
For zinit users.
zinit load 'https://github.com/noborus/ov/blob/master/ov.plugin.zsh'
2.13.3. fish
ov --completion fish > ~/.config/fish/completions/ov.fish
2.13.4. powershell
ov --completion powershell | Out-String | Invoke-Expression
3. Basic usage
ov supports open file name or standard input.
ov filename
cat filename|ov
You can also explicitly specify standard input as -.
cat filename | ov -
Used by other commands by setting the environment variable PAGER.
export PAGER=ov
4. Usage
See the ov site for more use cases and examples.
[!NOTE]
(default key key) indicates the key that can be specified even after starting the same function as the command line option.
4.1. Config
You can set style and key bindings in the configuration file.
ov will look for a configuration file in the following paths in descending order:
$XDG_CONFIG_HOME/ov/config.yaml
$HOME/.config/ov/config.yaml
$HOME/.ov.yaml
On Windows:
%USERPROFILE%/.config/ov/config.yaml
%USERPROFILE%/.ov.yaml
Create a config.yaml file in one of the above directories. If the file is in the user home directory, it should be named .ov.yaml.
v0.53.0 and later
You can generate a default configuration with:
ov --generate-config > ~/.config/ov/config.yaml
On Windows (PowerShell):
ov --generate-config > $env:USERPROFILE/.config/ov/config.yaml
[!NOTE]
If you likelesskey bindings, generate it with--generate-config=less.
ov --generate-config=less > ~/.config/ov/config.yaml
4.2. Header
The --header (-H) (default key H) option fixedly displays the specified number of lines.
ov --header 1 README.md
Related styling: Header and HeaderBorder.
4.2.1. Skip
When used with the --skip-lines (default key Ctrl+s) option, it hides the number of lines specified by skip and then displays the header.
ov --skip-lines 1 --header 1 README.md
4.3. Vertical header
The --vertical-header (-y) (default key y) option fixedly displays the specified number of characters.
ov --vertical-header=4 README.md
If you want to specify by column instead of character, see Header Column.
Related styling: VerticalHeader and VerticalHeaderBorder.
4.4. Column mode
Specify the delimiter with --column-delimiter(default key is d) and set it to --column-mode(default key is c) to highlight the column.
ov --column-delimiter "," --column-mode test.csv
Regular expressions can be used for the --column-delimiter.
Enclose in '/' when using regular expressions.
[!TIP]
Use regex delimiters like/\s+/for variable whitespace or/[,;]/for multiple delimiter characters.
ps aux | ov -H1 --column-delimiter "/\s+/" --column-rainbow --column-mode
Related styling: ColumnHighlight,ColumnRainbow.
4.5. Header column
The --header-column (-Y) (default key is Y) option fixedly displays the specified number of columns when column-mode is enabled.
ov --column-mode --column-delimiter="," --header-column=2 test.csv
When in column-mode, pressing F will switch to fixed display for the selected columns up to that point.
Related styling: VerticalHeader and VerticalHeaderBorder.
4.6. Column rainbow mode
You can also color each column individually in column mode.
Specify --column-rainbow(default key is Ctrl+r) in addition to the --column-mode option.
Color customization is possible. Please specify 7 or more colors in config.yaml.
Style:
ColumnRainbow:
- Foreground: "white"
- Foreground: "aqua"
- Foreground: "lightsalmon"
- Foreground: "lime"
- Foreground: "blue"
- Foreground: "yellowgreen"
- Foreground: "red"
Style specifications other than Foreground can also be specified.
Style:
ColumnRainbow:
- Foreground: "white"
Background: "red"
- Foreground: "aqua"
Underline: true
- Foreground: "#ff7f00"
Background: "blue"
Bold: true
- Foreground: "lime"
Italic: true
- Foreground: "blue"
Dim: true
- Foreground: "yellowgreen"
- Foreground: "red"
Related styling: ColumnRainbow.
4.7. Column width
The --column-width option is designed for command output with irregular spaces, such as ps aux, df, etc. (default key Alt+o).
It automatically detects and separates columns without needing a specific delimiter.
ps aux|ov -H1 --column-width --column-rainbow
This column-width feature is implemented using guesswidth.
4.8. Wrap
Supports switching between wrapping and not wrapping lines.
The option is --wrap=char, specify --wrap=none (default key w, W) if you do not want to wrap.
4.8.1. word wrap mode
Added in v0.52.0
Word wrap has been added and the method of specification has changed.
-wor-w=char(default): Wrap lines at screen width, breaking anywhere.-w=word: Wrap lines at screen width, breaking at word boundaries.-w=none: Disable line wrapping.
Alt+w.
Added in v0.55.0
--break-indent applies only in -w=word mode. Wrapped-line indentation can
be set with --break-indent or the default key Ctrl+Alt+n. Use 0 for no
indentation, a positive number for a fixed width, L to match the source line's
leading whitespace, or L+N/L-N to adjust that indentation. +N and -N are
shorthand for the relative forms.
4.8.2. Display markers
Added in v0.55.0
Display markers can be enabled with --sign-mode or the default key
Ctrl+Alt+m. The default value is 0 (no markers). Add the bit values to
enable markers. When wrapping is enabled, 1 displays a break marker (β³) at
the start of a wrapped line and 2 displays a continue marker (β΅) where a
line continues. When wrapping is disabled, 4 displays a truncation marker
(β¦) when a line is cut off.
| Value | Markers enabled | Display example |
|-------|-----------------|-----------------|
| 0 | None | long line |
| 1 | β³ | β³ wrapped continuation |
| 2 | β΅ | line continues β΅ |
| 3 | β³ and β΅ | line continues β΅β³ wrapped continuation |
| 4 | ⦠| truncated line⦠|
| 5 | Ⳡand ⦠| Ⳡwrapped continuation or truncated line⦠|
| 6 | ⡠and ⦠| line continues ⡠or truncated line⦠|
| 7 | β³, β΅, and β¦ | All applicable markers above |
The β³ and β΅ markers are shown when line wrapping is enabled; β¦ is shown
when wrapping is disabled and a line is truncated. Marker characters and styles
can be customized with BreakSign, ContinueSign, TruncSign and their
corresponding Style entries under General in the config file.
4.9. Alternate-Rows
Alternate row styles with the --alternate-rows(-C) (default key C) option
The style can be set with Style customization.
ov --alternate-rows test.csv
Related styling: Alternate.
4.10. Sidebar
Added in v0.51.0
ov now supports a sidebar feature, allowing you to display additional information alongside the main content.
The sidebar can show:
- Help (default key
Alt + h) - Mark list (default key
Alt + m) - Document list (default key
Alt + l) - Section list (default key
Alt + u) - Style list (default key
Alt + y) (Added in v0.54.0)
Sidebar scrolling is independent of the main content. Default keys are:
- up(default key
shift+up) - down(default key
shift+down) - left(default key
shift+left) - right(default key
shift+right)
help, marks, documents, sections, styles).
ov --sidebar-mode=sections --section-delimiter "^#" README.md
You can specify the initial sidebar mode via CLI with --sidebar-mode=string or by setting it in the config file.
You can set the sidebar width using SidebarWidth. This can be specified as a percentage (e.g., 20%) or as a fixed width in columns (e.g., 30).
Example:
SidebarMode: "marks" # Open sidebar with this content. Options: "help", "marks", "documents", "sections", "styles", "none".
SidebarWidth: 30 # Width of the sidebar. Can be specified in percentage or fixed width (e.g., "30" for 30 columns).
4.11. Section
You can specify a section delimiter using --section-delimiter (default key Alt+d).
This allows you to move between sections (default keys space and ^).
The specified line will also be treated as a section header and will remain fixed at the specified position until the next section appears at the specified position.
The start of the section can be adjusted with --section-start(default key Ctrl+F3, Alt+s).
The --section-delimiter is written in a regular expression (for example: "^#").
(Line breaks are not included in matching lines).
For example, if you specify "^diff" for a diff that contains multiple files, you can move the diff for each file.
The number of lines in section-header can be changed.
You can specify the number of lines using the --section-header-num option or key input(default key F7).
The specified section can be viewed in the section list in the Sidebar(default key Alt+u).
4.11.1. section example
This is an example of using the git pager.
[pager]
diff = "ov -F --section-delimiter '^diff'"
log = "ov -F --section-delimiter '^commit' --section-header-num 3"
Related styling: SectionLine.
4.11.2. hide other sections
If you specify --hide-other-section(default key Alt+-), only the current section is displayed.
ov --section-delimiter "^#" --hide-other-section README.md
This is just hidden, so it will be displayed when you move to the next section.
4.12. Multiple files
ov can also open multiple files.
ov file1 file2
You can include standard input in the file list by specifying -.
command | ov - file1 file2
Multiple files are each opened as a document and can be navigated using the Next Document ] key (default), Previous Document key (default).
Specified multiple files can also be displayed in the document list in the [Sidebar(default key alt + l).
Related Styling: Customizing the bottom status line.
4.13. Follow mode
--follow-mode(-f)(default key Ctrl+f) prints appended data and moves to the bottom line (like tail -f).
ov --follow-mode /var/log/syslog
(while :; do echo random-$RANDOM; sleep 0.1; done;)|./ov --follow-mode
4.13.1. Follow name
[!TIP]
Use--follow-nameinstead of--follow-modewhen files might be rotated (like log files). This ensures you continue following the new file even if the original is moved or deleted.
You can specify the file name to follow with --follow-name(like tail -F).
Monitor file names instead of file descriptors.
ov --follow-name /var/log/nginx/access.log
4.13.2. Follow all mode
--follow-all(-A)(default key Ctrl+a) is the same as follow mode, it switches to the last updated file if there are multiple files.
ov --follow-all /var/log/nginx/access.log /var/log/nginx/error.log
4.13.3. Follow section mode
Use the --follow-section(default key F2) option to follow by section.
Follow mode is line-by-line, while follow section mode is section-by-section.
Follow section mode displays the bottom section.
The following example is displayed from the header (#) at the bottom.
ov --section-delimiter "^#" --follow-section README.md
[!NOTE]
Watch mode is a mode in which--follow-sectionand--section-delimiter "^\f"are automatically set.
4.13.4. Sticky follow
Follow mode uses Sticky follow by default. In Sticky follow mode, when you move up from the bottom, follow mode temporarily pauses. Follow mode resumes automatically when you return to the bottom of the file.
This behavior allows you to:
- Scroll up to examine previous content without losing your position
- Automatically resume following new content when you return to the bottom
- Maintain context while monitoring live files
When follow mode is paused, you'll see visual indicators to help you understand the current state:
||appears at the beginning of the status line to indicate that follow mode is paused- The line where follow mode was paused is highlighted with the
PauseLinestyle
DisableStickyFollow: true in your configuration file:
General:
DisableStickyFollow: true
Related styling: PauseLine.
4.14. Exec mode
Exec mode captures the output of a command and displays it in ov.
It works similarly to watch, but with advanced paging features.
Use the --exec (-e) option to run the command and display stdout/stderr separately.
[!TIP]
When using--exec, you must insert--to separate ov's options from the command you want to run.
Everything after -- is interpreted as the command and its arguments.
ov --exec -- ls -l
Shows the stderr screen as soon as an error occurs, when used with --follow-all.
ov --follow-all --exec -- make
In exec mode (other than Windows) the output is opened by opening a pty.
Therefore, the command is likely to be printed in color.
ov --exec -- eza -l
It is useful to use the --notify-eof option together with exec mode to get notified when the command finishes.
This is especially helpful for long-running commands like make.
ov --notify-eof --exec -- make
4.15. Search
Search by forward search / key(default) or the backward search ? key(default).
Search can be toggled between incremental search, regular expression search, and case sensitivity.
Displayed when the following are enabled in the search input prompt:
| Function | display | (Default)key | command option | config file | |---------------------------|---------|--------------|------------------------|--------------------| | Incremental search | (I) | Alt+i | --incsearch | Incsearch | | Regular expression search | (R) | Alt+r | --regexp-search | RegexpSearch | | Case-sensitive | (Aa) | Alt+c | -i, --case-sensitive | CaseSensitive | | Smart case-sensitive | (S) | Alt+s | --smart-case-sensitive | SmartCaseSensitive |
Specify true/false in config file.
``config.yaml
CaseSensitive: false
RegexpSearch: false
Incsearch: true
SmartCaseSensitive: true
Related styling: SearchHighlight
4.15.1. <a name='pattern'></a>Pattern
The pattern option allows you to specify a search at startup.console ov --pattern install README.md
console ov --filter "install" README.md#### 4.15.2. <a name='filter'></a>Filter&Filter input is possible using the
key(default). The filter input creates a new document only for the lines that match the filter.]Move next document
and previous documentkey(default) allow you to move between the filter document and the original document.KThe
(shift+k) key (default) closes all documents created by the filter.--filterYou can also specify a filter using the command line option
.
The filter is a regular expression.console
ov --filter "^#" README.md
console ov --non-match-filter info /var/log/syslogYou can also filter for lines that do not match the specified pattern.!If you press
on&while inputting a filter, non-matching lines will be targeted.--non-match-filterThe command line option for this can be specified with
.
console $ ps aux|ov -H1 --filter postgres --quit-if-one-screen USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND postgres 1589 0.0 0.0 221992 29952 ? Ss Jul24 0:02 /usr/lib/postgresql/14/bin/postgres -D /var/lib/postgresql/14/main -c config_file=/etc/postgresql/14/main/postgresql.conf postgres 1624 0.0 0.0 222104 9544 ? Ss Jul24 0:00 postgres: 14/main: checkpointer postgres 1626 0.0 0.0 221992 8392 ? Ss Jul24 0:00 postgres: 14/main: background writer postgres 1627 0.0 0.0 221992 11464 ? Ss Jul24 0:00 postgres: 14/main: walwriter postgres 1628 0.0 0.0 222560 9928 ? Ss Jul24 0:01 postgres: 14/main: autovacuum launcher postgres 1629 0.0 0.0 76728 7112 ? Ss Jul24 0:01 postgres: 14/main: stats collector postgres 1631 0.0 0.0 222420 8904 ? Ss Jul24 0:00 postgres: 14/main: logical replication launcher noborus 193766 0.0 0.0 1603756 7552 pts/0 Rl+ 10:37 0:00 ov -H1 -F --filter postgresIf you specify both afilteroption and the [Quit if one screen option, the command will display the results of the filter and then quit if the results fit on one screen.
### 4.16. <a name='caption'></a>Caption
You can specify a caption instead of the file name in status line to display it.
console
ls -alF|ov --caption "ls -alF"
It can also be specified as an environment variable.console
export OV_CAPTION="ls -alF"
ls -alF|ov
console ov --watch 1 /proc/meminfo### 4.17. <a name='mark'></a>MarkmMark the display position with the
key(default). The mark is decorated withMarkLineandMarkStyleWidth.MMarks can be erased individually with the
key(default). It is also possible to delete all marks with thectrl + deletekey(default).alt + mThe specified marks can be displayed in the mark list in the Sidebar(default key
).MarkLine.*4.17.1. <a name='mark-by-pattern'></a>mark by pattern
You can use mark by pattern to mark all lines that match the search(default key
). This will enter pattern input mode and, when you pressEnter, mark all lines that match the pattern.--mark-by-patternUse
to mark matching lines whenovstarts.>4.17.2. <a name='specifying-a-mark'></a>Specifying a mark
Use the
next and<previous (default) key to move to the marked position. You can also enter mark specify mode with,(default) and select a mark by number. There are two input styles: enter the number directly, or enter a relative offset like+N/-Nfrom the current mark. When you press,, the mark list sidebar opens automatically along with number input mode.ov4.18. <a name='watch'></a>Watch
has a watch mode that reads the file every N seconds and adds it to the end. When you reach EOF, add '\f' instead. Use the--watch(-T) option. Go further to the last section. The default is 'section-delimiter', so the last loaded content is displayed.for example.
yaml ClipboardMethod: "OSC52"### 4.19. <a name='mouse-support'></a>Mouse supportovThe
supports mouse input for text selection, scrolling, and other interactions. This can be disabled with the option--disable-mouse(default keys for toggling mouse support areCtrl+Alt+r).OSC52If mouse support is enabled, tabs and line breaks will be interpreted correctly when copying.
If your terminal supports
, it is recommended to useOSC52for clipboard operations(default). SetClipboardMethodtoOSC52in the configuration file (config.yaml):OSC52> [!TIP] > Use
method if you're working over SSH or in terminal multiplexers like tmux/screen where traditional clipboard tools might not work.
yaml ClipboardMethod: "system"This method is useful in environments whereOSC52is supported by the terminal.OSC52If your terminal does not support
, or if you do not want to useOSC52, setClipboardMethodtosystemto use atotto/clipboard for clipboard operations.xclipIn Linux/Unix environments, this requires the
orxselcommand.
yamlGeneral: VScrollLines: 3Selecting the range with the mouse and then left-clicking will copy it to the clipboard.ovPasting in
is done with the middle button. In other applications, it is pasted from the clipboard (often by pressing the right-click).Shift + wheel4.19.1. <a name='text-selection'></a>Text selection
The mouse supports intelligent text selection for improved productivity:
These selection methods work seamlessly with the clipboard functionality. After making a selection with double or triple click, the selected text is automatically copied to the clipboard.
- Single click: Place cursor and start text selection by dragging
- Double click: Select the word under the cursor
- Triple click: Select the entire line under the cursor
4.19.2. <a name='wheel-scroll'></a>Wheel scroll
When mouse support is enabled, you can use the mouse wheel for navigation:
- Vertical scrolling: Use the mouse wheel to scroll up and down
- Horizontal scrolling: Use
to scroll left and rightAlt+Click4.19.3. <a name='scroll-amount-configuration'></a>Scroll amount configuration
You can customize the scroll amounts using command-line options or configuration file settings:
4.19.4. <a name='anchor-and-extend-selection'></a>Anchor and extend selection
Added in v0.50.0
You can now use "Anchor and Extend Selection" with the mouse:
- Set Anchor: Left-click to set an anchor point.
- Extend Selection: After setting an anchor, use
or right-click to extend the selection from the anchor to the clicked position and copy the selected range.VScrollLinesClear Anchor: If no selection is created, double-click will clear the anchor. Anchor Highlight: When there is no selection, the anchor point is visually highlighted (reverse style). This feature enables flexible, editor-like selection and copy operations using the mouse.Vertical Scroll Amount:
- Command-line: Not directly configurable (uses system default)
- Config file: Set
in theGeneralsection
Horizontal Scroll Amount:
Command-line: --hscroll-width (e.g., --hscroll-width "20%" or --hscroll-width "10")
Config file: Set HScrollWidth in the General section
yaml
General:
HScrollWidth: "10%" # Percentage of screen width
# or
HScrollWidth: "20" # Specific number of columns
console ov --multi-color "ERROR,WARN,INFO,DEBUG,not,^.{24}" access.log### 4.20. <a name='multi-color-highlight'></a>Multi color highlight.This feature styles multiple words individually.
key(default) enters multi-word input mode. Enter multiple words (regular expressions) separated by spaces.error info warn debugFor example,
will color errors red, info cyan, warn yellow, and debug magenta.--multi-colorIt can also be specified with the command line option
(-M)(default key.). For command line options, pass them separated by ,(comma).For example:
!multi-color.png
Color customization is possible. Please specify 7 or more colors in config.yaml.
yaml
Style:
MultiColorHighlight:
- Foreground: "red"
Reverse: true
- Foreground: "aqua"
Underline: true
- Foreground: "yellow"
Background: "blue"
- Foreground: "fuchsia"
- Foreground: "lime"
- Foreground: "blue"
- Foreground: "#c0c0c0"
console ov --column-mode --align test.csvRelated styling:MultiColorHighlight.--plain4.21. <a name='plain'></a>Plain
Disables the decoration of the text, such as color and style, and displays it in plain text. Use Plain when you want to remove all decorations at once. If you only want to disable specific styles, use Suppress styles instead. The option is
(or-p) (default keyCtrl+e).es4.22. <a name='converter'></a>Converter
Converter selects the engine to convert and display the text. Usually, the escape sequence is interpreted and displayed by
(default).rawdisplays as it is without interpreting the escape sequence.--converterYou can specify the
option with[es|raw|align], and you can also specify the--raw,--align(Align) option as a shortcut option.raw> [!NOTE] >
also displays the character string of the escape sequence, > but be aware that Plain hides the decoration after interpreting the escape sequence.--align4.23. <a name='align'></a>Align
The
option adjusts column widths to improve readability for irregularly formatted tabular data, such as CSV files with misaligned columns.Example:
csv
c1,c2,c3
a,b,c
aaaaaaaaaaaaaaaaaaaa,bb,cc
aa,bbbbbbbbbbbbbb,cc
aa,bb,cccccccccccccccccccccc
yaml ShrinkChar: '.'After applying --align:sAlign can also shrink column.
4.23.1. <a name='shrink'></a>Shrink
Align allows columns to be shrunk and stretched by toggling with the (default key
).To change the character displayed when columns are shrunk, set ShrinkChar in the configuration file:
console ov --section-delimiter "^#" --jump-target section README.md#### 4.23.2. <a name='right-align'></a>Right align--jump-targetColumns displayed by alignment are left-justified. Columns can be right-aligned (default key Alt+a).
4.24. <a name='jump-target'></a>Jump target
You can specify the lines to be displayed in the search results. This function is similar to
ofless. Positive numbers are displayed downwards by the number of lines from the top(1). Negative numbers are displayed up by the number of lines from the bottom(-1). . (dot) can be used to specify a percentage. .5 is the middle of the screen(.5). You can also specify a percentage, such as (50%).--jump-targetThis option can be specified with
(or-j) (default keyj).sectionIf
is specified as the--jump-target, the display will start from the beginning of the section as much as possible and the jump-target will be changed.
console ov --view-mode csv test.csvRelated styling:JumpTargetLine.--view-mode4.25. <a name='view-mode'></a>View mode
You can also use a combination of modes using the
(default keyp) option. In that case, you can set it in advance and specify the combined mode at once.--view-mode csvFor example, if you write the following settings in ov.yaml, the csv mode will be set with
.
ov.yaml
Mode:
p:
Header: 2
AlternateRows: true
ColumnMode: true
LineNumMode: false
Wrap: "character"
ColumnDelimiter: "|"
ColumnRainbow: true
m:
Header: 3
AlternateRows: true
ColumnMode: true
LineNumMode: false
Wrap: "character"
ColumnDelimiter: "|"
csv:
Header: 1
AlternateRows: true
ColumnMode: true
LineNumMode: false
Wrap: "character"
ColumnDelimiter: ","
ColumnRainbow: true
sh ov --config ov.yaml --list-view-modes#### 4.25.1. <a name='view-mode-sidebar'></a>View mode sidebarpAdded in v0.52.0
When you press
to enter view mode selection, a sidebar automatically opens and displays the list of available view modes with their index numbers. You can select a mode either by name or by its number.--list-view-modes4.25.2. <a name='list-view-modes'></a>List view modes
The
option outputs a list of available view modes defined in the configuration file.
Example output:plaintext
general
markdown
mysql
psql
console ov -X README.mdThis is useful for checking predefined view modes and their configurations.--exit-write4.26. <a name='output-on-exit'></a>Output on exit
,-X(default keyQ) option prints the current screen on exit. This looks like the display remains on the console after the ov is over.By default, it outputs the amount of the displayed screen with all decorations, such as search highlights, as it appears on the screen.
If you want to revert to the previous behavior (outputting the original text without decorations), set IsWriteOriginal: true in the configuration file.yaml
IsWriteOriginal: true
yaml QuitSmall: trueYou can change how much is written using--exit-write-beforeand--exit-write-after(default keyCtrl+q).--exit-write-before--exit-write-beforespecifies the number of lines before the current position(top of screen).--exit-write-before 3will output from 3 lines before.--exit-write-afterspecifies the number of lines after the current position (top of screen).--exit-write-before 3 --exit-write-after 3outputs 6 lines.--quit-if-one-screen4.27. <a name='quit-if-one-screen'></a>Quit if one screen
The
,-Foption allows the program to exit immediately if the content fits within one screen. This can be useful when you only want to view small files or when you want to quickly check the content without scrolling.QuitSmallIf you want to enable this option by default, set
totruein the configuration file.
console suspended ov (use 'fg' to resume)### 4.28. <a name='suspend'></a>SuspendCtrl+zYou can suspend ov with
(default key). Normally, you can resume from suspend by typingfg.
console suspended ov (use 'exit' to resume)On Windows or if the environment variableOV_SUBSHELLis set,exitinstead offg. The process actually starts a subshell without suspending.
env OVEDIT="vim +%d %f"### 4.29. <a name='edit'></a>EditAlt+vYou can edit the currently displayed file with your preferred editor by pressing the default key
.OVEDITIf the file is not a regular file (for example, when viewing input from a pipe or standard input), a temporary file is created and passed to the editor for editing. This ensures that you can still edit the content even if the original input is not seekable.
The editor command is determined by the
orEDITORenvironment variable, or by theEditorsetting in the configuration file.%fYou can use
and%das arguments in the editor command:%fwill be replaced with the current file name.%dwill be replaced with the current line number. For example:
ov:prompt (Save)file:savefile.txtThis will open the current file invimat the specified line number.save buffer4.30. <a name='save'></a>Save
If the file input is via a pipe, you can save it by pressing the
(defaultS) key.This will put you in input mode, so enter the file name. Only the buffer currently in memory is saved.
ov:prompt overwrite? (O)overwrite, (A)append, (N)cancelIf the file name already exists, selectOverwrite,Append, orCancel.
consoleov --ruler README.md ov --ruler=2 README.md### 4.31. <a name='ruler'></a>Ruler--rulerThe
option displays a ruler at the top of the screen to help you see the column positions. (default keyAlt+Shift+F9)--ruleror--ruler=1: Displays a relative ruler that moves with horizontal scrolling.--ruler=2: Displays an absolute ruler that does not move with horizontal scrolling.--ruler=0: Disables the ruler (default).
console ov --force-screen filename > output.txt!ov-ruler.pngRuler.ov4.32. <a name='redirect-output'></a>Redirect output
By default,
does not show the screen when output is redirected. To force display, use the--force-screenoption:
console export GOMEMLIMIT=100MiB### 4.33. <a name='suppress-styles'></a>Suppress stylesovAdded in v0.54.0
Syntax highlighting and other styles (including those represented by escape sequences) can be enabled or disabled individually. This is especially useful when
is used as a pager from syntax-highlighting tools such asbat. Unlike Plain, this feature does not remove all decoration at once; it lets you selectively suppress only the styles you do not want.oAfter startup, press
(default key) to enterToggle styles:input mode. In this mode, the sidebar shows a numbered list of available styles (indices start at 0). Specify styles by the numbers shown in the sidebar labels.1,3,5
- Use commas to select multiple items:
4-9Use hyphens for ranges: 1,3-5,9You can combine both forms: Special commands are also available inToggle styles:input:o: disable all stylesa: enable all stylesi: invert all styles You can combine special commands and numeric selections in one input. For example:o1-3disables all styles, then enables styles 1 through 3i2inverts all styles, then toggles style 2 again !ov-styles.png--memory-limit5. <a name='how-to-reduce-memory-usage'></a>How to reduce memory usage
Since v0.30.0 it no longer loads everything into memory. The first chunk from the beginning to the 10,000th line is loaded into memory and never freed. Therefore, files with less than 10,000 lines do not change behavior.
The
option can be used to limit the chunks loaded into memory. Memory limits vary by file type.GOMEMLIMITAlso, go may use a lot of memory until the memory is freed by GC. Also consider setting the environment variable
.
console ov --memory-limit-file 3 /var/log/syslog### 5.1. <a name='regular-file-(seekable)'></a>Regular file (seekable)--memory-limitNormally large (10,000+ lines) files are loaded in chunks when needed. It also frees chunks that are no longer needed. If
is not specified, it will be limited to 100.
yaml MemoryLimitFile: 3SpecifyMemoryLimitin the configuration file.
console cat /var/log/syslog | ov --memory-limit 10You can also use the--memory-limit-fileoption and theMemoryLimitFilesetting for those who think regular files are good memory saving.--memory-limit5.2. <a name='other-files,-pipes(non-seekable)'></a>Other files, pipes(Non-seekable)
Non-seekable files and pipes cannot be read again, so they must exist in memory.
If you specify the upper limit of chunks with
orMemoryLimit, it will read up to the upper limit first, but after that, when the displayed position advances, the old chunks will be released. Unlimited if--memory-limitis not specified.
It is recommended to put a limit in the config file as you may receive output larger than memory.yaml
MemoryLimit: 1000
``
6. Command option
| Short | Long | Purpose | |-------|--------------------------------------------|-----------------------------------------------------------------------------------------------------------------------| | -l, | --align | align the output columns for better readability | | -C, | --alternate-rows | highlight even and odd rows in alternating colors | | | --break-indent string | indent width for wrapped lines (default "0") | | | --caption string | override the status line file name with a custom label | | -i, | --case-sensitive | case-sensitive in search | | -d, | --column-delimiter character | column delimiter character (default ",") | | -c, | --column-mode | split content into columns at the delimiter | | | --column-rainbow | colorize each column with a distinct color | | | --column-width | column mode using fixed-width fields instead of a delimiter | | | --completion string | generate completion script [bash\|zsh\|fish\|powershell] | | | --config file | config file (default is $XDG_CONFIG_HOME/ov/config.yaml) | | | --converter string | content processing mode [es\|raw\|align\|wordwrap] (default "es") | | | --debug | debug mode | | | --disable-column-cycle | keep column cursor from wrapping to the first column | | | --disable-mouse | disable mouse support | | -e, | --exec | run command and display its output; use '--' to separate ov flags from command arguments (e.g., 'ov --exec -- ls -l') | | -X, | --exit-write | output the current screen when exiting | | -a, | --exit-write-after int | extra lines below the current view to output on exit | | -b, | --exit-write-before int | extra lines above the current view to output on exit | | | --filter string | show only lines matching this pattern | | -A, | --follow-all | follow multiple files and show the most recently updated one | | -f, | --follow-mode | monitor file and display new content as it is written | | | --follow-name | follow by file name mode; survives log rotation | | | --follow-section | follow mode: jump to the most recently updated section
... (README truncated for length)