Show where your cursor moves when jumping large distances (e.g between windows). Fast and lightweight, written completely in Lua.
Using packer.nvim:
use {'JuanS3/specs.nvim'}
Using vim-plug:
Plug 'JuanS3/specs.nvim'
Using LazyVim:
-- Add this inside your lazy.nvim plugin setup/configuration
{
"JuanS3/specs.nvim",
config = function()
require('specs').setup({
show_jumps = true,
min_jump = 30,
popup = {
delay_ms = 10,
inc_ms = 5,
blend = 10,
width = 20,
winhl = "PMenu",
fader = require('specs').exp_fader,
resizer = require('specs').shrink_resizer,
},
ignore_filetypes = {},
ignore_buftypes = {
nofile = true,
},
})
end
},
local specs = require('specs')
specs.setup({
popup = {
inc_ms = 10, -- time increments used for fade/resize effects
width = 120,
winhl = 'Search',
},
})
vim.api.nvim_set_keymap('n', '<leader>v',
':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 }
)
vim.api.nvim_set_keymap('n', 'N',
'N:lua require("specs").show_specs()<CR>',
{ noremap = true, silent = true }
)
:lua require('specs').toggle()
- Toggle Specs on/off
Faders:
-
sinus_fader
β£/β’\β£/β’\β£/β’\β£/β’
-
linear_fader
ββββββββ β ββββββ
-
exp_fader
βββββββββββββ ββ
-
pulse_fader
βββββ ββββββ ββββ
-
empty_fader
βββββββββββββββ
Resizers:
-
shrink_resizer
βββββββββββββββ
-
slide_resizer
βββββββββββββββ
-
empty_resizer
βββββββββββββββ
You can implement your own custom fader/resizer functions for some pretty cool effects:
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,
}
}
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.
-- Press <leader>v to call specs!
vim.api.nvim_set_keymap('n', '<leader>v',
':lua require("specs").show_specs()<CR>',
{ 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 }
)
-- Or maybe you do a lot of screen-casts and want to call attention to a specific line of code:
vim.api.nvim_set_keymap('n', '<leader>v',
':lua require("specs").show_specs({
width = 97,
winhl = "Search",
delay_ms = 610,
inc_ms = 21
})<CR>',
{ noremap = true, silent = true }
)
- More builtin faders + resizers
- Colorizers
- Optional highlight on text yank