Skip to content

feat: show on WinEnter #16

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 27 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# specs.nvim 👓

Show where your cursor moves when jumping large distances (e.g between windows). Fast and lightweight, written completely in Lua.

![demo](https://user-images.githubusercontent.com/28115337/111098526-90923e00-853b-11eb-8e7c-c5892d64c180.gif)
Expand All @@ -13,57 +14,71 @@ Show where your cursor moves when jumping large distances (e.g between windows).
![showcase1](https://user-images.githubusercontent.com/28115337/112546702-aca2a480-8db1-11eb-9cfb-8a068b06abf7.gif)

## Install

Using [packer.nvim](https://github.com/wbthomason/packer.nvim):

```lua
use {'edluffy/specs.nvim'}
```

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

```vimscript
Plug 'edluffy/specs.nvim'
```

## Usage

If you are using init.vim instead of init.lua, remember to wrap block below with `lua << EOF` and `EOF`

```lua
require('specs').setup{
require('specs').setup{
show_jumps = true,
show_on_win_enter = false, -- Shows every time you switch windows
min_jump = 30,
popup = {
delay_ms = 0, -- delay before popup displays
inc_ms = 10, -- time increments used for fade/resize effects
inc_ms = 10, -- time increments used for fade/resize effects
blend = 10, -- starting blend, between 0-100 (fully transparent), see :h winblend
width = 10,
winhl = "PMenu",
fader = require('specs').linear_fader,
resizer = require('specs').shrink_resizer
},
ignore_filetypes = {},
ignore_filetypes = {
TelescopePrompt = true,
},
ignore_buftypes = {
nofile = true,
prompt = true,
},
}
```

- `:lua require('specs').toggle()`
- Toggle Specs on/off
- Toggle Specs on/off

Faders:
- linear_fader `▁▂▂▃▃▄▄▅▅▆▆▇▇██`
- exp_fader `▁▁▁▁▂▂▂▃▃▃▄▄▅▆▇`

- pulse_fader `▁▂▃▄▅▆▇█▇▆▅▄▃▂▁`
- linear_fader `▁▂▂▃▃▄▄▅▅▆▆▇▇██`
- exp_fader `▁▁▁▁▂▂▂▃▃▃▄▄▅▆▇`

- pulse_fader `▁▂▃▄▅▆▇█▇▆▅▄▃▂▁`

- empty_fader `▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁`
- empty_fader `▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁`

Resizers:

- shrink_resizer `░░▒▒▓█████▓▒▒░░`

- slide_resizer `████▓▓▓▒▒▒▒░░░░`
- slide_resizer `████▓▓▓▒▒▒▒░░░░`

- empty_resizer `███████████████`
- empty_resizer `███████████████`

You can implement your own custom fader/resizer functions for some pretty cool effects:

```lua
require('specs').setup{
require('specs').setup{
popup = {
-- Simple constant blend effect
fader = function(blend, cnt)
Expand Down Expand Up @@ -96,6 +111,7 @@ vim.api.nvim_set_keymap('n', 'N', 'N:lua require("specs").show_specs()<CR>', { n
```

## Planned Features

- [ ] More builtin faders + resizers
- [ ] Colorizers
- [ ] Optional highlight on text yank
Loading