Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/notomo/reacher.nvim

Displayed range search buffer
https://github.com/notomo/reacher.nvim

neovim neovim-plugin

Last synced: 1 day ago
JSON representation

Displayed range search buffer

Awesome Lists containing this project

README

        

# reacher.nvim

This plugin introduces displayed range search buffer.
(Required neovim nightly)

## Example

```lua
-- search in the current window
vim.keymap.set({ "n", "x" }, "gs", [[lua require("reacher").start()]])

-- search in the all windows in the current tab
vim.keymap.set({ "n", "x" }, "gS", [[lua require("reacher").start_multiple()]])

-- search in the current line
vim.keymap.set({ "n", "x" }, "gl", function()
require("reacher").start({
first_row = vim.fn.line("."),
last_row = vim.fn.line("."),
})
end)

local group = "reacher_setting"
vim.api.nvim_create_augroup(group, {})
vim.api.nvim_create_autocmd({ "FileType" }, {
group = group,
pattern = { "reacher" },
callback = function()
vim.keymap.set({ "n", "i" }, "", [[lua require("reacher").finish()]], { buffer = true })
vim.keymap.set({ "n", "i" }, "", [[lua require("reacher").cancel()]], { buffer = true })

vim.keymap.set("n", "gg", [[lua require("reacher").first()]], { buffer = true })
vim.keymap.set("n", "G", [[lua require("reacher").last()]], { buffer = true })
vim.keymap.set("n", "j", [[lua require("reacher").next()]], { buffer = true })
vim.keymap.set("n", "k", [[lua require("reacher").previous()]], { buffer = true })

vim.keymap.set("i", "", [[lua require("reacher").next()]], { buffer = true })
vim.keymap.set("i", "", [[lua require("reacher").previous()]], { buffer = true })
vim.keymap.set("i", "", [[lua require("reacher").forward_history()]], { buffer = true })
vim.keymap.set("i", "", [[lua require("reacher").backward_history()]], { buffer = true })
end,
})
```