Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/junegunn/vim-fnr

:performing_arts: Find-N-Replace helper free of regular expressions
https://github.com/junegunn/vim-fnr

Last synced: 28 days ago
JSON representation

:performing_arts: Find-N-Replace helper free of regular expressions

Awesome Lists containing this project

README

        

vim-fnr
=======

Find-N-Replace in Vim with live preview (experimental)

Installation
------------

Use your favorite plugin manager. vim-fnr requires
[vim-pseudocl](https://github.com/junegunn/vim-pseudocl).

With [vim-plug](https://github.com/junegunn/vim-plug):

```vim
Plug 'junegunn/vim-pseudocl'
Plug 'junegunn/vim-fnr'
```

Usage
-----

- Normal mode
- `r`
- Substitution in the range
- `R`
- Substitution of the word under the cursor in the entire document
- Visual mode
- `r`
- Substitution in the selected range
- `R`
- Substitution of the selected string in the entire document
- Command line
- `:FNR`

The command is repeatable with `.` key if you have installed
[repeat.vim](http://github.com/tpope/vim-repeat).

### Special keys

- `Tab`
- `i` - case-insensitive match
- `w` - word-boundary match (`\`)
- `g` - substitute all occurrences
- `c` - confirm each substitution
- `Tab` or `Enter` to return
- `CTRL-N` or `CTRL-P`
- Auto-completion

Options
-------

```vim
" Defaults
let g:fnr_flags = 'gc'
let g:fnr_hl_from = 'Todo'
let g:fnr_hl_to = 'IncSearch'
```

Custom mappings
---------------

```vim
nmap r (FNR)
xmap r (FNR)
nmap R (FNR%)
xmap R (FNR%)
```

License
-------

MIT