Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Config option for pager mode always #77

Open
mike-lloyd03 opened this issue Nov 23, 2022 · 2 comments
Open

Config option for pager mode always #77

mike-lloyd03 opened this issue Nov 23, 2022 · 2 comments
Labels
waiting waiting for a reply or more info

Comments

@mike-lloyd03
Copy link

It would be great if there were a configuration option for forcing pager mode rather than having to use the -p flag. Setting the PAGER variable with a flag isn't possible and you also can set an environment variable to a custom function. The workaround I have in place is a script like this:

#!/bin/bash

nvimpager -p <&0

And setting PAGER to that script which is not desirable.

Something like:

lua nvimpager.force_pager_mode = true

and maybe an equivalent command for cat mode would be great.

Thanks for nvimpager!

@lucc
Copy link
Owner

lucc commented Nov 23, 2022

This is not possible with the current design of nvimpager:

In pager mode nvim is started normally with a TUI, in cat mode nvim is started with the --headless flag. But when you set an option in lua or vimscript (wither by --cmd, -c or -u) it will only be available after the nvim process has started. We can not change the headless mode after starting nvim.

I hope to change the architecture after neovim/neovim#7438 is fixed (the first step is neovim/neovim#18375). It might be possible then.

@lucc lucc added the waiting waiting for a reply or more info label Nov 23, 2022
@mike-lloyd03
Copy link
Author

I'm actually putting together a janky PR right now. Let me know what you think once it's up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
waiting waiting for a reply or more info
Projects
None yet
Development

No branches or pull requests

2 participants