2021-03-14 19:34:19 +00:00
|
|
|
# specs.nvim 👓
|
2021-03-25 21:34:25 +00:00
|
|
|
Show where your cursor moves when jumping large distances (e.g between windows). Fast and lightweight, written completely in Lua.
|
2021-03-14 19:34:19 +00:00
|
|
|
|
2021-03-15 03:09:08 +00:00
|
|
|

|
2021-03-23 23:31:18 +00:00
|
|
|
|
2021-03-25 21:34:25 +00:00
|
|
|

|
|
|
|

|
|
|
|

|
|
|
|

|
|
|
|

|
|
|
|

|
|
|
|

|
|
|
|

|
2021-03-23 23:31:18 +00:00
|
|
|
|
2021-03-14 19:34:19 +00:00
|
|
|
## 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`
|
2021-03-15 03:36:16 +00:00
|
|
|
```lua
|
2021-03-14 19:34:19 +00:00
|
|
|
require('specs').setup{
|
|
|
|
show_jumps = true,
|
|
|
|
min_jump = 30,
|
|
|
|
popup = {
|
2021-03-17 18:12:48 +00:00
|
|
|
delay_ms = 0, -- delay before popup displays
|
|
|
|
inc_ms = 10, -- time increments used for fade/resize effects
|
|
|
|
blend = 10, -- starting blend, between 0-100 (fully transparent), see :h winblend
|
2021-03-14 19:34:19 +00:00
|
|
|
width = 10,
|
2021-03-23 23:31:18 +00:00
|
|
|
winhl = "PMenu",
|
2021-03-14 19:34:19 +00:00
|
|
|
fader = require('specs').linear_fader,
|
|
|
|
resizer = require('specs').shrink_resizer
|
2021-04-02 14:44:54 -06:00
|
|
|
},
|
|
|
|
ignore_filetypes = {},
|
|
|
|
ignore_buftypes = {
|
|
|
|
nofile = true,
|
|
|
|
},
|
2021-03-14 19:34:19 +00:00
|
|
|
}
|
|
|
|
```
|
2021-03-30 23:32:53 +01:00
|
|
|
|
2021-05-05 15:46:06 +01:00
|
|
|
- `:lua require('specs').toggle()`
|
|
|
|
- Toggle Specs on/off
|
|
|
|
|
2021-03-30 23:32:53 +01:00
|
|
|
Faders:
|
|
|
|
- linear_fader `▁▂▂▃▃▄▄▅▅▆▆▇▇██`
|
|
|
|
- exp_fader `▁▁▁▁▂▂▂▃▃▃▄▄▅▆▇`
|
|
|
|
|
|
|
|
- pulse_fader `▁▂▃▄▅▆▇█▇▆▅▄▃▂▁`
|
|
|
|
|
|
|
|
- empty_fader `▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁`
|
|
|
|
|
|
|
|
Resizers:
|
|
|
|
- shrink_resizer `░░▒▒▓█████▓▒▒░░`
|
|
|
|
|
|
|
|
- slide_resizer `████▓▓▓▒▒▒▒░░░░`
|
|
|
|
|
|
|
|
- empty_resizer `███████████████`
|
|
|
|
|
2021-03-17 18:12:48 +00:00
|
|
|
You can implement your own custom fader/resizer functions for some pretty cool effects:
|
|
|
|
```lua
|
|
|
|
require('specs').setup{
|
|
|
|
popup = {
|
|
|
|
-- Simple constant blend effect
|
|
|
|
fader = function(blend, cnt)
|
|
|
|
if cnt > 100 then
|
|
|
|
return 80
|
|
|
|
else return nil end
|
|
|
|
end,
|
|
|
|
-- Growing effect from left to right
|
|
|
|
resizer = function(width, ccol, cnt)
|
|
|
|
if width-cnt > 0 then
|
|
|
|
return {width+cnt, ccol}
|
|
|
|
else return nil end
|
|
|
|
end,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
```
|
2021-10-11 17:52:19 +00:00
|
|
|
|
|
|
|
### Keybinds
|
|
|
|
|
|
|
|
You can invoke specs from anywhere by using `:lua require('specs').show_specs()`
|
|
|
|
Add a keybind for this to make it easy to find your cursor at any time.
|
|
|
|
|
|
|
|
```lua
|
|
|
|
-- Press <C-b> to call specs!
|
|
|
|
vim.api.nvim_set_keymap('n', '<C-b>', ':lua require("specs").show_specs()', { noremap = true, silent = true })
|
|
|
|
|
|
|
|
-- You can even bind it to search jumping and more, example:
|
|
|
|
vim.api.nvim_set_keymap('n', 'n', 'n:lua require("specs").show_specs()<CR>', { noremap = true, silent = true })
|
|
|
|
vim.api.nvim_set_keymap('n', 'N', 'N:lua require("specs").show_specs()<CR>', { noremap = true, silent = true })
|
|
|
|
```
|
|
|
|
|
2021-03-31 23:51:28 +01:00
|
|
|
## Planned Features
|
|
|
|
- [ ] More builtin faders + resizers
|
|
|
|
- [ ] Colorizers
|
|
|
|
- [ ] Optional highlight on text yank
|