https://github.com/wsdjeg/flygrep.nvim
Neovim plugin to search text in floating window asynchronously
https://github.com/wsdjeg/flygrep.nvim
neovim-plugin
Last synced: 2 months ago
JSON representation
Neovim plugin to search text in floating window asynchronously
- Host: GitHub
- URL: https://github.com/wsdjeg/flygrep.nvim
- Owner: wsdjeg
- License: gpl-3.0
- Created: 2023-06-20T13:45:33.000Z (about 2 years ago)
- Default Branch: master
- Last Pushed: 2025-04-22T06:26:08.000Z (2 months ago)
- Last Synced: 2025-04-22T07:38:28.772Z (2 months ago)
- Topics: neovim-plugin
- Language: Lua
- Homepage:
- Size: 78.1 KB
- Stars: 10
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
- awesome-neovim-sorted - wsdjeg/flygrep.nvim
- awesome-neovim-sorted - wsdjeg/flygrep.nvim
- awesome-neovim - wsdjeg/flygrep.nvim - Search text in a floating window asynchronously. (Search / Powershell)
- trackawesomelist - wsdjeg/flygrep.nvim (⭐8) - Search text in a floating window asynchronously. (Recently Updated / [Feb 04, 2025](/content/2025/02/04/README.md))
README
# flygrep.nvim
> _flygrep.nvim_ is a plugin to search text in neovim floating window asynchronously
[](https://spacevim.org)
[](LICENSE)
* [Intro](#intro)
* [Requirements](#requirements)
* [Installation](#installation)
* [Usage](#usage)
* [Configuration](#configuration)
* [Key Bindings](#key-bindings)
* [Feedback](#feedback)## Intro
`flygrep.nvim` is a neovim plugin that can be used to search code asynchronously in real time.
## Requirements
- [neovim](https://github.com/neovim/neovim): >= v0.10.0
- [ripgrep](https://github.com/BurntSushi/ripgrep): If you are using other searching tool, you need to set command option of flygrep.## Installation
- use [nvim-plug](https://github.com/wsdjeg/nvim-plug)
```lua
require('plug').add({
{
'wsdjeg/flygrep.nvim',
config = function()
require('flygrep').setup()
end,depends = { { 'wsdjeg/job.nvim' } },
},
})
``````
Plug 'wsdjeg/flygrep.nvim'
```## Usage
- `:FlyGrep`: open flygrep in current directory
- `:lua require('flygrep').open(opt)`: opt supports following keys,
- cwd: root directory of searching job
- input: default input text in prompt windowsearch text in buffer directory:
```lua
require('flygrep').open({
cwd = vim.fn.fnamemodify(vim.fn.bufname(), ':p:h'),
})
```search text under the cursor:
```lua
require('flygrep').open({
input = vim.fn.expand('')
})
```## Configuration
```lua
require('flygrep').setup({
color_templete = {
a = {
fg = '#2c323c',
bg = '#98c379',
ctermfg = 16,
ctermbg = 114,
bold = true,
},
b = {
fg = '#abb2bf',
bg = '#3b4048',
ctermfg = 145,
ctermbg = 16,
bold = false,
},
},
timeout = 200,
command = {
execute = 'rg',
default_opts = {
'--no-heading',
'--color=never',
'--with-filename',
'--line-number',
'--column',
'-g',
'!.git',
},
recursive_opt = {},
expr_opt = { '-e' },
fixed_string_opt = { '-F' },
default_fopts = { '-N' },
smart_case = { '-S' },
ignore_case = { '-i' },
hidden_opt = { '--hidden' },
},
matched_higroup = 'IncSearch',
enable_preview = false,
window = {
width = 0.8, -- flygrep screen width, default is vim.o.columns * 0.8
height = 0.8, -- flygrep screen height, default is vim.o.lines * 0.8
col = 0.1, -- flygrep screen start col, default is vim.o.columns * 0.1
row = 0.1, -- flygrep screen start row, default is vim.o.lines * 0.1
},
})
```## Key Bindings
| Key bindings | descretion |
| -------------------- | ---------------------------------- |
| `` | open cursor item |
| `` or `` | next item |
| `` or `` | previous item |
| `` | open item in split window |
| `` | open item in vertical split window |
| `` | open item in new tabpage |
| `` | toggle preview window |
| `` | toggle display hidden files |## Feedback
If you encounter any bugs or have suggestions, please file an issue in the [issue tracker](https://github.com/wsdjeg/flygrep.nvim/issues)