How do I change Vim's internal pager to something else?
Asked Answered
A

2

18

Whenever I execute a command like :imap, Vim fires up some sort of (internal?) pager that doesn't support searching through the output. Is there any way to configure Vim to use a different pager?

Alderson answered 15/9, 2013 at 21:20 Comment(1)
A
15

No, but you can capture the output with the :redir command and then paste it into a buffer to search, filter, or whatever you like. For example,

:redir @a
:imap
:redir END
:new
:put a
Administer answered 16/9, 2013 at 3:20 Comment(0)
U
0

Here is working solution:

Redirect the output of a Vim or external command into a scratch buffer

Description of this script is in this answer for question:

Can listings in the awful 'more' be displayed, instead, in a vim window?

Described and used scratch buffer is similar to less command. Navigation and search function is available in it.


Checked in Vim with clipboard support:

VIM - Vi IMproved 8.1 (2018 May 18, compiled Dec 07 2023 15:42:49) Included patches: 1-213, 1840, 214-579, 1969, 580-1848, 4975, 5023, 2110, 1849-1854, 1857, 1855-1857, 1331, 1858, 1858-1859, 1873, 1860-1969, 1992, 1970-1992, 2010, 1993-2068, 2106, 2069-2106, 2108, 2107-2109, 2109-2111, 2111-2112, 2112-2269, 3612, 3625, 3669, 3741, 1847 under Ubuntu 20.04

sudo apt install vim
sudo apt install vim-gtk3

apt - How do I install vim-gnome on Ubuntu 19.10?

Uncouth answered 19/3 at 18:32 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.