https://github.com/leafoftree/vim-blink
Blink to anywhere in INSERT or NORMAL mode
https://github.com/leafoftree/vim-blink
blink edit plugin point vim
Last synced: 7 months ago
JSON representation
Blink to anywhere in INSERT or NORMAL mode
- Host: GitHub
- URL: https://github.com/leafoftree/vim-blink
- Owner: leafOfTree
- Created: 2019-10-24T09:35:46.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2021-05-13T04:06:57.000Z (almost 5 years ago)
- Last Synced: 2025-04-08T04:29:54.422Z (11 months ago)
- Topics: blink, edit, plugin, point, vim
- Language: Vim script
- Homepage:
- Size: 17.6 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# vim-blink
Blink to anywhere in INSERT or NORMAL mode
## Installation
- [VundleVim][1]
Plugin 'leafOfTree/vim-blink'
- [vim-pathogen][2]
cd ~/.vim/bundle
git clone https://github.com/leafOfTree/vim-blink --depth 1
- [vim-plug][3]
Plug 'leafOfTree/vim-blink'
:PlugInstall
- Or manually, clone this plugin to `path/to/this_plugin`, and add it to `rtp` in vimrc
set rtp+=path/to/this_plugin
Please stay up to date. Feel free to open an issue or a pull request
## Usage
Add config
```vim
let g:blink_point = {
\'javascript': '(|), {|}, \[|\], {\n\s*|\n\s*}, >|<, ''|'', "|"'
\}
```
Open a javascript file and then in INSERT or NORMAL mode, press c-n or c-p
## Configuration
### Blink point
A `pattern` to define where to go. It is a string separated by `,`. The cursor position is marked by `|`
#### `g:blink_point`
Filetype specific `pattern`. The format is `{ key: filetype, value: pattern }`
- Default: `undefined`
- Example:
```vim
let g:blink_point = {
\'vue': ':\s*|;, ^<|\(script\|style\|template\)',
\'jsx': '(|), {|}, \[|\], >|<, "|", ''|'', \s|[)}]',
\'text': '(|.*), [a-c]|[d-g]',
\}
```
#### `g:blink_point_default`
Default `pattern`
- Default: `'(|), {|}, \[|\], {\n\s*|\n\s*}, >|<, ''|'', "|"'`
- Example:
```vim
let g:blink_point_default = '(|), {|}, \[|\], ".*|"'
```
For more details about vim `pattern`, see `:h pattern`
### Mapping
#### `g:blink_mapping_prev`
Mapping to blink to previous point
- Default: ``
- Example:
```vim
let g:blink_mapping_prev = ''
```
#### `g:blink_mapping_next`
Mapping to blink to next point
- Default: ``
- Example:
```vim
let g:blink_mapping_next = ''
```
### Mode
#### `g:blink_disable_insert`
Disable blink in INSERT mode
- Default: `0`
- Example:
```vim
let g:blink_disable_insert = 1
```
#### `g:blink_disable_normal`
Disable blink in NORMAL mode
- Default: `0`
- Example:
```vim
let g:blink_disable_normal = 1
```
### Function
The function used by the mappings is `blink#BlinkToEditPoint(flags, normal)`
```vim
inoremap =blink#BlinkToEditPoint("wb", 0)
inoremap =blink#BlinkToEditPoint("w", 0)
nnoremap :call blink#BlinkToEditPoint("wb", 1)
nnoremap :call blink#BlinkToEditPoint("w", 1)
```
[1]: https://github.com/VundleVim/Vundle.vim
[2]: https://github.com/tpope/vim-pathogen
[3]: https://github.com/junegunn/vim-plug