Skip to content

Commit

Permalink
docs: fix some styling
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisgrieser committed Dec 25, 2024
1 parent a1cd010 commit 1699969
Showing 1 changed file with 15 additions and 13 deletions.
28 changes: 15 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<img alt="badge" src="https://dotfyle.com/plugins/chrisgrieser/nvim-rip-substitute/shield"/></a>

Search and replace in the current buffer with incremental preview, a convenient
UI, and modern regex syntax.
UI, and modern regex syntax.

<https://github.com/chrisgrieser/nvim-rip-substitute/assets/73286100/4afad8d8-c0d9-4ba6-910c-0510d4b9b669>

Expand Down Expand Up @@ -44,30 +44,31 @@ UI, and modern regex syntax.
- **Quality-of-Life features**: automatic prefill of the escaped cursorword,
adaptive popup window width, toggle `--fixed-strings`, …
- Syntax comparison:
```txt
# all three are equivalent

# vim's :substitute
:% s/\(foo\)bar\(\.\)\@!/\1baz/gI
```"txt
# all three are equivalent
# vim's :substitute (very magic mode)
:% s/\v(foo)bar(\.)@!/\1baz/gI
# vim's :substitute
:% s/\(foo\)bar\(\.\)\@!/\1baz/gI
# rip-substitute
(foo)bar(?!\.)
$1baz
```
# vim's :substitute (very magic mode)
:% s/\v(foo)bar(\.)@!/\1baz/gI
# rip-substitute
(foo)bar(?!\.)
$1baz
```

## Installation
**Requirements**
- nvim >= 0.10
- [ripgrep](https://github.com/BurntSushi/ripgrep) with `pcre2` support
+ `brew install ripgrep` (already includes `pcre2` by default)
+ `cargo install ripgrep --features pcre2`
- Alternatively, you can also use this plugin without `pcre2` by setting
`regexOptions.pcre2 = false` in the config. However, some features like
lookaheads are not supported then.
- nvim >= 0.10
- optional: `:TSInstall regex` (adds syntax highlighting)
- *Optional:* `:TSInstall regex` (adds syntax highlighting)

```lua
-- lazy.nvim
Expand Down Expand Up @@ -158,6 +159,7 @@ require("rip-substitute").setup {
## Usage
**lua function**

```lua
vim.keymap.set(
{ "n", "x" },
Expand Down

0 comments on commit 1699969

Please sign in to comment.