lucc / nvimpager

Use nvim as a pager to view manpages, diffs, etc with nvim's syntax highlighting
Other
372 stars 20 forks source link

How to gracefully handle a huge file input using pager mode? #16

Closed kevinhwang91 closed 5 years ago

kevinhwang91 commented 5 years ago

env: PAGER=nvimpager Some command like journactl opens a huge input file making nvim freeze until it completely loads. I make a trick alias journalctl='PAGER=less journalctl' to avoid the problem by using less instead of nvimpager. Is there a graceful way to handle this problem?

lucc commented 5 years ago

What you describe is a know limitation of nvimpager (and nvim/vim and any program using these to display text). I listed it as a known bug since the beginning.

For systemd/journalctl specifically there is the environment variable SYSTEMD_PAGER which will override PAGER. I think such an approach is to be preferred over aliases as it is more robust.

If you are interested: There is a neovim issue where they also discuss the problem that neovim has to wait for EOF if the buffer is read from stdin: https://github.com/neovim/neovim/issues/9462

kevinhwang91 commented 5 years ago

Thank you for your answer and solution!