Closed linrongbin16 closed 7 months ago
Attention: 134 lines
in your changes are missing coverage. Please review.
Comparison is base (
e5df3c5
) 77.19% compared to head (4fa4ee2
) 76.23%.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
The colors looks better, but not precisely enough.
update: the color looks better and better, it seems all we need to do, is trying to convert vim syntax color codes into the sublime tmTheme
.
There's an issue that makes this PR works bad.
For lua keyword local
, now this PR will create colors from vim highlighting Keyword
to tmTheme keyword
.
But treesitter will create highlighting @variable.lua
and change the colors for keyword local
. So the tmTheme is not working correctly on some highlightings.
see:
I feel like it's technically impossible to map neovim's highlightings to tmTheme, they seem not compatible.
update:
I find more docs, they have much better explaination on tm themes, so I will continue try again to improve the colors precision in this PR:
Is this necessary in light of https://github.com/linrongbin16/fzfx.nvim/pull/556 ?..
Use native nVim highlights == avoid the penalty of translation to tmTheme.
Is this necessary in light of #556 ?..
Use native nVim highlights == avoid the penalty of translation to tmTheme.
yes, they are two alternative solutions to preview file contents.
The #556 should be first priority, but if I am confident that the tmTheme is mapping precisely, I may also merge this PR.
This is only for bat, #556 is for nvim buffer. They are not conflict.
The nvim buffer has best color support, while bat has best performance. If I could make the performance of #556 as good as bat, I could drop this PR.
The https://github.com/linrongbin16/fzfx.nvim/pull/556 should be first priority, but if I am confident that the tmTheme is mapping precisely, I may also merge this PR.
That's interesting. Would it be possible to export "converted" nVIm theme to a tmTHeme file?
This way users can put the resulting file in ~/.config/bat/themes
, run bat cache --build
and enjoy the consistent highlighting in their favourite text editor and terminal.
The #556 should be first priority, but if I am confident that the tmTheme is mapping precisely, I may also merge this PR.
That's interesting. Would it be possible to export "converted" nVIm theme to a tmTHeme file?
This way users can put the resulting file in
~/.config/bat/themes
, runbat cache --build
and enjoy the consistent highlighting in their favourite text editor and terminal.
that's exactly I am doing in this PR.
but the docs about tmTheme is quite limited, and I am not an expert about tmTheme.
For now it looks 85% close to nvim highlighting.
But I improved the performance in #556 again yesterday, maybe this PR could be close.
that's exactly I am doing in this PR. For now it looks 85% close to nvim highlighting.
This would be huge! Please keep it, at least as a function that user can call independently to generate a bat
theme from their nVim colourscheme. Happy to test on my heavily modified Kanagawa theme.
Hope there's experts who knows well on both tmTheme and Neovim highlights and save me.
I will merge this into main branch now. it's so difficult to make the highlights 100% same between nvim and bat previewer.
The tmTheme
.tmTheme
: https://www.sublimetext.com/docs/color_schemes_tmtheme.htmlTheme Implementations
Regresion test
Platforms
Tasks
CTRL-J
/CTRL-K
to move down/up and preview contents.CTRL-U
/CTRL-R
to switch between restricted/unrestricted mode, and the lines count is consistent when press multiple times.V
/W
/P
/R
variants (visual selection, cursor word, yank text, resume last).ESC
to quit,ENTER
to open file, and open thetest/hello world.txt
,test/goodbye world/goodbye.lua
files.fd
andfind
works.CTRL-J
/CTRL-K
to move down/up and preview contents.CTRL-U
/CTRL-R
to switch between restricted/unrestricted mode, and the lines count is consistent when press multiple times.-w
to match word only, use-g *.lua
to search only lua files.V
/W
/P
/R
variants (visual selection, cursor word, yank text, resume last).ESC
to quit,ENTER
to open file, and open thetest/hello world.txt
,test/goodbye world/goodbye.lua
files.rg
andgrep
works.CTRL-J
/CTRL-K
to move down/up and preview contents.CTRL-D
to delete buffers, and delete thetest/hello world.txt
,test/goodbye world/goodbye.lua
buffers.V
/W
/P
/R
variants (visual selection, cursor word, yank text, resume last).ESC
to quit,ENTER
to open file.CTRL-J
/CTRL-K
to move down/up and preview contents.CTRL-U
/CTRL-W
to switch between workspace/current folder mode.V
/W
/P
/R
variants (visual selection, cursor word, yank text, resume last).ESC
to quit,ENTER
to open file.CTRL-J
/CTRL-K
to move down/up and preview contents.V
/W
/P
/R
variants (visual selection, cursor word, yank text, resume last).ESC
to quit,ENTER
to open file.CTRL-J
/CTRL-K
to move down/up and preview contents.CTRL-U
/CTRL-W
to switch between workspace/current folder mode.V
/W
/P
/R
variants (visual selection, cursor word, yank text, resume last).ESC
to quit,ENTER
to open file.delta
works.CTRL-J
/CTRL-K
to move down/up and preview contents.CTRL-R
/CTRL-O
to switch between local/remote branches.V
/W
/P
/R
variants (visual selection, cursor word, yank text, resume last).ESC
to quit,ENTER
to checkout branch.CTRL-J
/CTRL-K
to move down/up and preview contents.CTRL-U
/CTRL-A
to switch between git repo commits/current buffer commits.V
/W
/P
/R
variants (visual selection, cursor word, yank text, resume last).ESC
to quit,ENTER
to copy commit hash.delta
works.CTRL-J
/CTRL-K
to move down/up and preview contents.V
/W
/P
/R
variants (visual selection, cursor word, yank text, resume last).ESC
to quit,ENTER
to copy commit hash.delta
works.CTRL-J
/CTRL-K
to move down/up and preview contents.CTRL-U
/CTRL-W
to switch between workspace/current buffer diagnostics.V
/W
/P
/R
variants (visual selection, cursor word, yank text, resume last).ESC
to quit,ENTER
to open file.CTRL-J
/CTRL-K
to move down/up and preview contents.ESC
to quit,ENTER
to open file.CTRL-J
/CTRL-K
to move down/up and preview contents.ESC
to quit,ENTER
to open file.CTRL-J
/CTRL-K
to move down/up and preview contents.CTRL-U
/CTRL-E
/CTRL-A
to switch between user/ex/all vim commands.V
/W
/P
/R
variants (visual selection, cursor word, yank text, resume last).ESC
to quit,ENTER
to feed vim command.CTRL-J
/CTRL-K
to move down/up and preview contents.CTRL-O
/CTRL-I
/CTRL-A
/CTRL-V
to switch between normal/insert/visual/all vim key mappings.V
/W
/P
/R
variants (visual selection, cursor word, yank text, resume last).ESC
to quit,ENTER
to feed vim keys.CTRL-J
/CTRL-K
to move down/up and preview contents.CTRL-U
/CTRL-R
to switch between filter/include hidden files mode.ALT-L
/ALT-H
to cd into folder and cd upper folder.V
/W
/P
/R
variants (visual selection, cursor word, yank text, resume last).ESC
to quit,ENTER
to open file, and open thetest/hello world.txt
,test/goodbye world/goodbye.lua
files.eza
/lsd
/ls
works.