Closed linrongbin16 closed 7 months ago
The builtin nvim buffer previewer has much better syntax highlighting (since it's native nvim buffer), but the performance is unacceptable for me when scrolling up/down (in the left side).
This PR will need a lot of improvements to make it better, not only the performance, also the whole structure is ugly now.
https://github.com/linrongbin16/fzfx.nvim/assets/6496887/56320d6b-6970-4177-8c7f-2da1b81e2ca9
Also, I noticed bat can custom new themes: https://github.com/sharkdp/bat?tab=readme-ov-file#adding-new-themes.
I am thinking retrieve RGB color codes from vim syntax highlighting, and create a custom theme for bat. Just like already did for fzf theme.
bat theme uses the .tmTheme
: https://www.sublimetext.com/docs/color_schemes_tmtheme.html
performance is good (on macOS) now, but still laggy on Windows. It should be related to Windows cmd.exe /C echo
.
maybe could try to detect if there's external echo
command, and use it first?
Windows user can use the improved bat theme in #557 .
Attention: 376 lines
in your changes are missing coverage. Please review.
Comparison is base (
29d2217
) 80.13% compared to head (4d371c6
) 76.60%.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Now the performance is quite good as well, even in Windows it's good.
I think I could cancel the other improve bat theme PR #557 , we may not need it.
Still something need to do:
--border
option as provider's window border.Massive effort! 🥳 Would you expose some highlight groups or pull everything from the loaded colourscheme?
Some bits seem to be a little off, e.g. cursorline
in previewer from :FzfxLiveGrep
...and in nVim:
I have tried commenting-out fzf_color_opts
, but to no effect.
Massive effort! 🥳 Would you expose some highlight groups or pull everything from the loaded colourscheme?
Some bits seem to be a little off, e.g.
cursorline
in previewer from:FzfxLiveGrep
...and in nVim:
I have tried commenting-out
fzf_color_opts
, but to no effect.
this PR doesn't support 'FzfxLiveGrep' for now, it only affect the 'FzfxFiles' command.
it's only the first step, others will come after this PR get merged.
relate: #491 .
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.