Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/backdround/improved-search.nvim
Adds search abilities
https://github.com/backdround/improved-search.nvim
Last synced: 2 months ago
JSON representation
Adds search abilities
- Host: GitHub
- URL: https://github.com/backdround/improved-search.nvim
- Owner: backdround
- License: mit
- Created: 2023-10-10T21:47:13.000Z (9 months ago)
- Default Branch: main
- Last Pushed: 2023-12-21T18:27:33.000Z (6 months ago)
- Last Synced: 2024-01-24T09:32:02.169Z (5 months ago)
- Language: Lua
- Homepage:
- Size: 32.2 KB
- Stars: 46
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Lists
- awesome-neovim - backdround/improved-search.nvim - Add search abilities. (Search / PHP)
- awesome-neovim - backdround/improved-search.nvim - Add search abilities. (Search / Markdown and LaTeX)
README
# Improved-search.nvim
It's a Neovim plugin that improves the search experience.It provides:
- **stable** **jump** to next / previous search pattern (regardless of the last
search direction)
- search the **word** under the **cursor** without moving (like `*` or `#`)
- search operator:
- search text selected in **visual** **mode** (visual selection +
operator)
- search text provided by **a** **motion** (operator + motion)
- it all works for a **multiline** search.### Preview
#### Search selected text#### Current word search in place
#### Stable next / previous
---
### Configuration example
```lua
local search = require("improved-search")-- Search next / previous.
vim.keymap.set({"n", "x", "o"}, "n", search.stable_next)
vim.keymap.set({"n", "x", "o"}, "N", search.stable_previous)-- Search current word without moving.
vim.keymap.set("n", "!", search.current_word)-- Search selected text in visual mode
vim.keymap.set("x", "!", search.in_place) -- search selection without moving
vim.keymap.set("x", "*", search.forward) -- search selection forward
vim.keymap.set("x", "#", search.backward) -- search selection backward-- Search by motion in place
vim.keymap.set("n", "|", search.in_place)
-- You can also use search.forward / search.backward for motion selection.
```---
### Functions and operators
| function / operator | modes | description |
| --- | --- | --- |
| stable_next | n, x, o | Search next pattern (regardless of a previous search direction)|
| stable_previous | n, x, o | Search previous pattern (regardless of a previous search direction)|
| current_word[_strict] | n | Search current word in-place |
| in_place[_strict] | n, x, o | In-place search operator |
| forward[_strict] | n, x, o | Forward search operator |
| backward[_strict] | n, x, o | Backward search operator |- `_strict` postfix means that a search operator / function uses a pattern with
word boundaries. In other words, the pattern is encapsulated with `\<` and `\>`.---
### Limitations:
- Search text that is selected by **visual block mode** isn't work as expected.