Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jake-stewart/regex-vars.nvim
search in neovim with variable expansion
https://github.com/jake-stewart/regex-vars.nvim
Last synced: 11 days ago
JSON representation
search in neovim with variable expansion
- Host: GitHub
- URL: https://github.com/jake-stewart/regex-vars.nvim
- Owner: jake-stewart
- Created: 2023-11-11T09:05:27.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2023-11-25T01:51:54.000Z (12 months ago)
- Last Synced: 2024-08-01T18:24:12.190Z (4 months ago)
- Language: Lua
- Size: 9.77 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
- my-neovim-pluginlist - jake-stewart/regex-vars.nvim - stewart/regex-vars.nvim) ![](https://img.shields.io/github/last-commit/jake-stewart/regex-vars.nvim) ![](https://img.shields.io/github/commit-activity/y/jake-stewart/regex-vars.nvim) (Coding / Regex)
README
regex-vars.nvim
===============![demo](https://github.com/jake-stewart/regex-vars.nvim/assets/83528263/7bde0744-f035-43e1-b82d-9d70fe8edc02)
allows defining variables which are expanded during search. for example, you
could make a `:email:` variable which you type and automatically expands to an
email regex.it supports `incsearch` and respects your `'magic'`, `'ignorecase'`, `'smartcase'`, settings.
it also changes the functionality of typing `/` (or `?` if backwards). default
functionality is to use previous search if empty or end the search. the new behaviour
is to automatically escape these characters. if you wish to use the previous
search, you can still leave the search empty or use ``.### setup
```lua
local rv = require("regex-vars")rv.setup({
[rv.escape(":foo:")] = "bar",
})
```### usage
with the example config, `:foo:` is mapped to `bar`. you can use `/` or `?` to
search and `:foo:` in your search will be replaced with `bar`.