I60R / page

Use neovim as pager
MIT License
207 stars 4 forks source link

Feature Request: cat mode #35

Closed MatthiasGrandl closed 1 year ago

MatthiasGrandl commented 1 year ago

As a replacement for bat and cat, it would be nice to have a "cat mode". nvimpager already has this, although it has a few problems, like cat mode not honoring tabstop settings and not working with some plugins like treesitter.

I think a good cat mode would be super usefull, because treesitter syntax highlighting is just so much better than what bat has to offer.

I60R commented 1 year ago

I think it's doable to allow page file.type just echo file when it's too short without spawning neovim. But in this case syntax highlighting could be achieved only through bat.

That said, I have no idea how to enable treesitter highlighting on echoed text

I60R commented 1 year ago

Just drafted a new release where page -O -- file will echo file if it's too short with syntax highlighting enabled through bat

I60R commented 1 year ago

Also, did you heard about syncat (uses tree-sitter)

MatthiasGrandl commented 1 year ago

Well the point is I want to avoid using bat and have neovim do all the heavy lifting.

Yeah I have seen syncat. It might be a good alternative, but it seems configuration heavy and since neovim is already configured, I thought it would be nice to use it instead.

I60R commented 1 year ago

Sorry, I see no way to get neovim's highlighting outside of neovim. Perhaps it's possible to somehow leverage treesitter as syncat does, through, the outcome most likely wouldn't be worth the effort.

MatthiasGrandl commented 1 year ago

Fair enough, thanks for evaluating the idea!