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

feat(live_grep): add buffer mode #327

Merged
merged 6 commits into from
Oct 27, 2023
Merged

Conversation

linrongbin16
Copy link
Owner

@linrongbin16 linrongbin16 commented Oct 27, 2023

Regresion test

Platforms

  • windows
  • macOS
  • linux

Tasks

  • FzfxFiles
    • Press CTRL-N/CTRL-P to move down/up and preview contents.
    • Press CTRL-U/CTRL-R to switch between restricted/unrestricted mode, and the lines count is consistent when press multiple times.
    • Use V/W/P variants (visual selection, cursor word, yank text).
    • Press ESC to quit, ENTER to open file, and open the test/hello world.txt, test/goodbye world/goodbye.lua files.
    • Both fd and find works.
  • FzfxLiveGrep
    • Press CTRL-N/CTRL-P to move down/up and preview contents.
    • Press CTRL-U/CTRL-R to switch between restricted/unrestricted mode, and the lines count is consistent when press multiple times.
    • Use -w to match word only, use -g *.lua to search only lua files.
    • Use V/W/P variants (visual selection, cursor word, yank text).
    • Press ESC to quit, ENTER to open file, and open the test/hello world.txt, test/goodbye world/goodbye.lua files.
    • Both rg and grep works.
  • FzfxBuffers
    • Press CTRL-N/CTRL-P to move down/up and preview contents.
    • Press CTRL-D to delete buffers, and delete the test/hello world.txt, test/goodbye world/goodbye.lua buffers.
    • Use V/W/P variants (visual selection, cursor word, yank text).
    • Press ESC to quit, ENTER to open file.
  • FzfxGFiles
    • Press CTRL-N/CTRL-P to move down/up and preview contents.
    • Press CTRL-U/CTRL-W to switch between workspace/current folder mode.
    • Use V/W/P variants (visual selection, cursor word, yank text).
    • Press ESC to quit, ENTER to open file.
  • FzfxGBranches
    • Press CTRL-N/CTRL-P to move down/up and preview contents.
    • Press CTRL-R/CTRL-O to switch between local/remote branches.
    • Use V/W/P variants (visual selection, cursor word, yank text).
    • Press ESC to quit, ENTER to checkout branch.
  • FzfxGCommits
    • Press CTRL-N/CTRL-P to move down/up and preview contents.
    • Press CTRL-U/CTRL-A to switch between git repo commits/current buffer commits.
    • Use V/W/P variants (visual selection, cursor word, yank text).
    • Press ESC to quit, ENTER to copy commit hash.
  • FzfxGBlame
    • Press CTRL-N/CTRL-P to move down/up and preview contents.
    • Use V/W/P variants (visual selection, cursor word, yank text).
    • Press ESC to quit, ENTER to copy commit hash.
  • FzfxLspDiagnostics
    • Press CTRL-N/CTRL-P to move down/up and preview contents.
    • Press CTRL-U/CTRL-W to switch between workspace/current buffer diagnostics.
    • Use V/W/P variants (visual selection, cursor word, yank text).
    • Press ESC to quit, ENTER to open file.
  • FzfxLspDefinitions, FzfxLspTypeDefinitions, FzfxLspReferences, FzfxLspImplementations
    • Press CTRL-N/CTRL-P to move down/up and preview contents.
    • Go to definitions/references (this is the most 2 easiest use case when developing this lua plugin with lua_ls).
    • Press ESC to quit, ENTER to open file.
  • FzfxCommands
    • Press CTRL-N/CTRL-P to move down/up and preview contents.
    • Press CTRL-U/CTRL-E/CTRL-A to switch between user/ex/all vim commands.
    • Use V/W/P variants (visual selection, cursor word, yank text).
    • Press ESC to quit, ENTER to feed vim command.
  • FzfxKeyMaps
    • Press CTRL-N/CTRL-P to move down/up and preview contents.
    • Press CTRL-O/CTRL-I/CTRL-A/CTRL-V to switch between normal/insert/visual/all vim key mappings.
    • Use V/W/P variants (visual selection, cursor word, yank text).
    • Press ESC to quit, ENTER to feed vim keys.
  • FzfxFileExplorer
    • Press CTRL-N/CTRL-P to move down/up and preview contents.
    • Press CTRL-U/CTRL-R to switch between filter/include hidden files mode.
    • Press ALT-L/ALT-H to cd into folder and cd upper folder.
    • Press ESC to quit, ENTER to open file, and open the test/hello world.txt, test/goodbye world/goodbye.lua files.
    • Both eza and ls works.

@linrongbin16
Copy link
Owner Author

linrongbin16 commented Oct 27, 2023

relate issue: #317

The buffer mode is a variant from unrestricted mode, for example:

image

The launching command is:

  • for rg: rg --column -n --no-heading --color=always -S -uu '' lua/fzfx/config.lua
  • for grep: grep --color=always -n -H -r '' lua/fzfx/config.lua

Also removed the -- flag in rg/grep launch command for other modes.

@codecov
Copy link

codecov bot commented Oct 27, 2023

Codecov Report

Attention: 36 lines in your changes are missing coverage. Please review.

Files Coverage Δ
lua/fzfx/config.lua 52.55% <40.98%> (-0.16%) ⬇️

... and 1 file with indirect coverage changes

📢 Thoughts on this report? Let us know!.

@linrongbin16 linrongbin16 merged commit df1851d into main Oct 27, 2023
7 of 8 checks passed
@linrongbin16 linrongbin16 deleted the feat-live-grep-buffer-mode branch October 27, 2023 04:35
This was referenced Oct 27, 2023
This was referenced Mar 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant