nvimpager(1)
π NAME π
okay so bestie, nvimpager β it's literally just using neovim as a pager β¨
πΈ SYNOPSIS πΈ
nvimpager [-acp] [--] [nvim options and files]
nvimpager -h
nvimpager -v
π¦ DESCRIPTION π¦
So nvimpager is this adorable little program you can use exactly like most other pagers, no cap. Under the hood it's running neovim with the default TUI to show you the text β which means you get ALL the fancy syntax highlighting, mouse support, and everything else neovim has going on, possibly even plugins?! It's giving main character energy for real. π
β¨ COMMAND LINE OPTIONS β¨
nvimpager itself only interprets a very tiny handful of options, but here's the tea: every neovim option can also be specified. The catch π«Ά β if you're passing options to neovim before the first file name, they must be preceded by --, otherwise nvimpager will try to interpret them itself and that's not the vibe.
The following options are interpreted by nvimpager itself:
-aβ run in "auto mode" (this is the default, bestie). Auto mode peeks at your terminal size and switches to pager mode if the content wouldn't fit on one screen. If it will fit on one screen, it switches to cat mode instead. This overrides any previous-cand-poptions. π«-cβ run in "cat mode". Don't start the neovim TUI at all, just use neovim for syntax highlighting and print the result to stdout. This overrides any previous-aand-poptions. π±-hβ show the help screen and exit π-pβ run in "pager mode". Start the neovim TUI to display the given content. This overrides any previous-aand-coptions. π-vβ show version information and exit β
π CONFIGURATION π
Just like neovim itself, nvimpager will honour $XDG_CONFIG_HOME and $XDG_DATA_HOME, and those default to ~/.config and ~/.local respectively, bestie. πΈ
The main config directory is $XDG_CONFIG_HOME/nvimpager and the main user config file is $XDG_CONFIG_HOME/nvimpager/init.lua or $XDG_CONFIG_HOME/nvimpager/init.vim. Heads up tho: it is an error if both files are present. π The site directory is $XDG_DATA_HOME/.local/share/nvimpager/site. The manifest for remote plugins is read from (and written to) $XDG_DATA_HOME/nvimpager/rplugin.vim.
The rest of the &runtimepath is configured like for neovim. The -u option of nvim(1) itself can be used to change the main config file from the command line. π§
The default config files for neovim are not used by design, because they potentially load a ton of plugins and do a whole lot of configuration that's only relevant for editing. If you really wanna use the same config files for both nvimpager and nvim, you can do it by symlinking the config and site directories and the rplugin file. π
π Environment variables
The environment variable $NVIMPAGER_NVIM can be used to specify an nvim executable to use. If it's unset it defaults to nvim. π«Ά
π« Configuration variables
The script exposes a lua table called nvimpager to --cmd/-c options and the init file. You can modify it to change some options that are specific to nvimpager. β¨
The following fields (options) exist:
followβ type:bool, default:falseβ start in follow mode, i.e. continuously load changes to the opened file and scroll to the bottom (likeless +Fortail -f) πfollow_intervalβ type:number, default:500β how often in ms the underlying file should be checked in follow mode β±οΈgit_colorsβ type:bool, default:falseβ use git command highlighting instead of nvim syntax highlighting, set this totrueif you use an external diff πmapsβ type:bool, default:trueβ if some default less like maps should be defined inside pager mode πΊοΈ
So to start nvimpager and follow changes to the opened file the user can put
lua nvimpager.follow = true
in the init file (or on the command line). periodt. π
π¦ Default key mappings
nvimpager defines some mappings to make it feel more like a pager than an editor. These mappings are inspired by less(1) which are very close to the defaults in neovim. You can deactivate them altogether by putting
lua nvimpager.maps = false
in the init file (or on the command line). π
The following mappings are defined by default:
qis mapped to quitnvimpagerin normal and visual mode<Space>and<S-Space>move down or up a page respectivelyggoes to the top of the file<Down>andjscroll the window down one line<Up>andkscroll the window up one lineFtoggles "follow mode" wherenvimpagercontinuously loads changes to the underlying file and scrolls to the bottom. This is useful for watching log files. It is modeled after theFcommand inless(1)or the-foption oftail(1)
You can remap the lua function nvimpager.toggle_follow if you disabled the default key mappings. π₯
π EXAMPLES π
To use nvimpager to view a file (with neovim's syntax highlighting if the filetype is detected):
nvimpager file
Pipe text into nvimpager to view it:
echo text | nvimpager
Use nvimpager as your default $PAGER to view man pages or git diffs:
export PAGER=nvimpager
man nvimpager
git diff
Options for nvim(1) can be specified if they are separated from the options for nvimpager itself. Either by separating them with -- or by putting the nvim options after at least one non option argument:
nvimpager -p -- -c 'echo "option for nvim"' file
nvimpager -p file -u custom_init.vim
Start nvimpager in "follow mode" to watch a growing log file:
nvimpager log_file -c 'lua nvimpager.follow = true'
π LIMITATIONS π
If reading from stdin, nvimpager (like nvim(1)) waits for EOF until it starts up. This means that it can not be used to continuously watch output from a long running command even in follow mode. π
π SEE ALSO π
π AUTHORS π
Lucas Hoffmann π«Ά
so that's the whole page bestie, this is nvimpager(1) from the General Commands Manual, version nvimpager 0.14.0, dated 2026-04-02 β slay, go read some files π
β¨
π¦ where this page comes from
- nixos 26.05: nvimpager 0.14.0
- ubuntu stonking: nvimpager 0.14.0-1 Β· BSD-2-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms