added 'grep_project' command (shortcut to 'grep' with empty query)

main
bhagwan 3 years ago
parent 5e899dc046
commit b462ba2cc6

@ -147,6 +147,7 @@ vim.api.nvim_set_keymap('n', '<c-P>',
| `grep_cword` | search word under cursor |
| `grep_cWORD` | search WORD under cursor |
| `grep_visual` | search visual selection |
| `grep_project` | search all project lines (fzf.vim's `:Rg`) |
| `grep_curbuf` | live grep current buffer |
| `live_grep` | live grep current project |
| `live_grep_resume` | live grep continue last search |

@ -172,6 +172,7 @@ SEARCH *fzf-lua-search*
| `grep_cword` | search word under cursor |
| `grep_cWORD` | search WORD under cursor |
| `grep_visual` | search visual selection |
| `grep_project` | search all project lines (fzf.vim's `:Rg`) |
| `grep_curbuf` | live grep current buffer |
| `live_grep` | live grep current project |
| `live_grep_resume` | live grep continue last search |

@ -100,6 +100,7 @@ M.grep_cword = require'fzf-lua.providers.grep'.grep_cword
M.grep_cWORD = require'fzf-lua.providers.grep'.grep_cWORD
M.grep_visual = require'fzf-lua.providers.grep'.grep_visual
M.grep_curbuf = require'fzf-lua.providers.grep'.grep_curbuf
M.grep_project = require'fzf-lua.providers.grep'.grep_project
M.git_files = require'fzf-lua.providers.git'.files
M.git_status = require'fzf-lua.providers.git'.status
M.git_commits = require'fzf-lua.providers.git'.commits

@ -340,6 +340,12 @@ M.grep_visual = function(opts)
return M.grep(opts)
end
M.grep_project = function(opts)
if not opts then opts = {} end
if not opts.search then opts.search = '' end
return M.grep(opts)
end
M.grep_curbuf = function(opts)
if not opts then opts = {} end
opts.rg_opts = config.globals.grep.rg_opts .. " --with-filename"

Loading…
Cancel
Save