Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/mhinz/vim-halo

:innocent: Visual highlight for your cursor.
https://github.com/mhinz/vim-halo

async blink cursor halo highlight neovim vim vim-plugin

Last synced: about 1 hour ago
JSON representation

:innocent: Visual highlight for your cursor.

Awesome Lists containing this project

README

        

# vim-halo

Highlight the cursor by putting blinking shapes around it.

By default, the shape is a halo and the cursor blinks three times. This can be
used to quickly find the cursor after switching buffers etc. Moving the cursor
will stop the blinking immediately.

![vim-halo in action](https://raw.githubusercontent.com/mhinz/vim-halo/master/demo.gif)

## Usage

There is only one function `halo#run()`, which takes one optional argument, a
dictionary.

The dictionary takes up to 3 keys:

- **hlgroup**: Highlight group as *string*. Default is `Halo` which links to
`IncSearch`.
- **shape**: Shape as a *string*. Can by any of `halo1`, `halo2`, `cross1`,
`cross2`, `cross2halo1`, `rectangle2`, or `line`. Default is `halo1`.
- **intervals**: A *list of numbers*. Calling `halo#run()` immediately shows a
visual highlight. The numbers denote the alternating times visual highlights
are shown and hidden. Thus an odd number of elements is sensible. Given an
even number, the last element is ignored. Default is `[100,100,100,100,100]`.

```
:call halo#run()
:call halo#run({'shape': 'cross2halo1'})
:call halo#run({'intervals': [100, 300, 600, 300, 100]})
:call halo#run({'intervals': [200,200,200], 'hlgroup': 'IncSearch'})
```

## Examples

Every time you change buffers:

```vim
autocmd BufEnter * call halo#run()
```

When navigating the quickfix or location list:

```vim
nnoremap [q :cprevious \| call halo#run()
nnoremap ]q :cnext \| call halo#run()
nnoremap [Q :cfirst \| call halo#run()
nnoremap ]Q :clast \| call halo#run()

nnoremap [l :lprevious \| call halo#run()
nnoremap ]l :lnext \| call halo#run()
nnoremap [L :lfirst \| call halo#run()
nnoremap ]L :llast \| call halo#run()
```

Use colors from another highlight group:

```vim
highlight link Halo Search
```

Or define your own colors:

```vim
highlight Halo guifg=white guibg=#F92672 ctermfg=white ctermbg=197
```

## Disclaimer

Only the `line` shape works works with wrapped lines!