Open kaliberr44 opened 1 month ago
As a side note in cat
mode these also seem not to work:
vim.opt.shiftwidth = 2 -- Size of an indent
vim.opt.tabstop = 2 -- Number of spaces tabs count for
nvimpager -c
nvimpager -p
So maybe it is a problem of not loading config in cat
mode?
Shiftwidth is a setting that only has an effect when editing, so it is not relevant for nvimpager (any mode). Tabstop is not yet supported in cat mode, this is tracked in #35.
You can check if the config file is loaded in cat mode by just adding some debug statement to the config file:
print("config loaded")
vim.cmd.quitall()
Are you sure you want to append to rtp with the comma? I think it should be (the docs say it works like :set rtp+=
vim.opt.runtimepath:append("~/.local/share/nvim/lazy/github-nvim-theme")
Can you minimize your config to the smallest version that produces the error?
You can debug the bash part of nvimpager with bash -x nvimpager $args
. Does the pager mode do something different than the cat mode at this point?
You can check if the config file is loaded in cat mode by just adding some debug statement to the config file:
print("config loaded") vim.cmd.quitall()
This works for both cat and pager mode, thank you.
Are you sure you want to append to rtp with the comma? I think it should be (the docs say it works like :set rtp+=
vim.opt.runtimepath:append("~/.local/share/nvim/lazy/github-nvim-theme")
I did remove the comma, but that did not help.
Here is the minimal config with chosen syntax colouring:
vim.opt.runtimepath:append("~/.local/share/nvim/lazy/github-nvim-theme")
vim.cmd("colorscheme github_dark_dimmed")
Still the same issue:
❯ bash -x nvimpager -p ~/.config/yazi/plugins/nvimpager.yazi/init.lua
+ RUNTIME=/opt/homebrew/Cellar/nvimpager/0.13.0/share/nvimpager/runtime
+ PARENT=782
+ TMPFILE=
+ export RUNTIME
+ export PARENT
+ export TMPFILE
+ export NVIM_APPNAME=nvimpager
+ NVIM_APPNAME=nvimpager
+ mode=auto
+ nvim=nvim
+ getopts achpv flag
+ case $flag in
+ mode=pager
+ getopts achpv flag
+ shift 1
+ [[ 1 -eq 0 ]]
+ [[ ! -t 1 ]]
+ files=()
+ [[ 1 -gt 0 ]]
+ [[ -f /Users/kaliberr44/.config/yazi/plugins/nvimpager.yazi/init.lua ]]
+ files+=("$1")
+ shift
+ [[ 0 -gt 0 ]]
+ [[ -z '' ]]
+ [[ 1 -eq 0 ]]
+ [[ -n '' ]]
+ args=(-R --cmd 'set rtp+=$RUNTIME | lua nvimpager = require("nvimpager"); nvimpager.stage1()' -c 'lua nvimpager.stage2()')
+ [[ pager = cat ]]
+ [[ pager = auto ]]
+ exec -a nvimpager nvim -R --cmd 'set rtp+=$RUNTIME | lua nvimpager = require("nvimpager"); nvimpager.stage1()' -c 'lua nvimpager.stage2()' /Users/kaliberr44/.config/yazi/plugins/nvimpager.yazi/init.lua
❯ bash -x nvimpager -c ~/.config/yazi/plugins/nvimpager.yazi/init.lua
+ RUNTIME=/opt/homebrew/Cellar/nvimpager/0.13.0/share/nvimpager/runtime
+ PARENT=782
+ TMPFILE=
+ export RUNTIME
+ export PARENT
+ export TMPFILE
+ export NVIM_APPNAME=nvimpager
+ NVIM_APPNAME=nvimpager
+ mode=auto
+ nvim=nvim
+ getopts achpv flag
+ case $flag in
+ mode=cat
+ getopts achpv flag
+ shift 1
+ [[ 1 -eq 0 ]]
+ [[ ! -t 1 ]]
+ files=()
+ [[ 1 -gt 0 ]]
+ [[ -f /Users/kaliberr44/.config/yazi/plugins/nvimpager.yazi/init.lua ]]
+ files+=("$1")
+ shift
+ [[ 0 -gt 0 ]]
+ [[ -z '' ]]
+ [[ 1 -eq 0 ]]
+ [[ -n '' ]]
+ args=(-R --cmd 'set rtp+=$RUNTIME | lua nvimpager = require("nvimpager"); nvimpager.stage1()' -c 'lua nvimpager.stage2()')
+ [[ cat = cat ]]
+ args+=(--headless)
+ exec -a nvimpager nvim -R --cmd 'set rtp+=$RUNTIME | lua nvimpager = require("nvimpager"); nvimpager.stage1()' -c 'lua nvimpager.stage2()' --headless /Users/kaliberr44/.config/yazi/plugins/nvimpager.yazi/init.lua
This looks all good. You will have to debug what is actually going on inside nvimpager/neovim.
Some ideas:
:scriptnames
inside nvimpager, is your colorscheme loaded?:GithubThemeCompile
?:scriptnames
shows that is loaded.
Even with minimal config (1 line):
vim.cmd("colorscheme retrobox")
something is off. In pager mode it looks OK:
in cat mode there is colour change but it is completely wrong:
With no config at all - it is the same. No colouring in cat mode and in pager it is fine.
I can see the same problem with the background color but for me the foreground color seems to work:
I'm 99% sure that it did work like a month ago, without any config change. So maybe an update of nvimpager
or nvim
or kitty
did that.
I'm 99% sure that it did work like a month ago, without any config change. So maybe an update of
nvimpager
ornvim
orkitty
did that.
I'm confused. Did you ever figure this out? I'm also trying to use nvimpager in cat mode for the previews with yazi, but I'm not having any luck. nvimpager doesn't show the correct syntax highlighting in any of the modes. Maybe I'm doing something wrong.
I'm pretty sure it worked before, but right now
cat mode
is not colorising output (neithernvimpager "$1"
).nvimpager -p "$1"
works correctly with all the syntax colouring.nvimpager
config:Sample file for syntax color check: