The goal of this plugin is to make relative line jumps easier. You can specify
the number of pointers and the distance between them, change the hl group to
your liking (any of the vim.api.nvim_set_hl()
settings should work), the default
autocmd is provided (you can change its pattern if you want).
demo.mp4
{ "scheisa/relpointers.nvim" }
use { "scheisa/relpointers.nvim" }
Just call require("relpointers").setup({})
function in your config file.Use require("relpointers").disable()
to disable the plugin.
require("relpointers").setup({
amount = 2,
distance = 5,
hl_properties = { underline = true },
pointer_style = "line region",
white_space_rendering = "\t\t\t\t\t",
virtual_pointer_position = -4,
virtual_pointer_text = "@",
enable_autocmd = true,
autocmd_pattern = "*",
})
Amount of pointers below or under cursor (multiply by 2 to see actuall amount)
Distance between pointers
Any arguments which work with vim.api.nvim_set_hl()
would work
Currently there is 2 styles - "line region" and "virtual"
currently works only with the whole line
You can specify region which will be highlighted on the line, (1 for the whole line)
Use white_space_rendering
to specify how lines without any symbols should be
displayed. Default value is 5 tabs
Uses vim.api.nvim_buf_set_extmark()
to work.
Position could be specified, default one is located in signcolumn (-4), use
virtual_pointer_position
to change it.
You can change its text by using virtual_pointer_text
.
You still can usehl_properties
to change highlights ( I recommend to use
something like hl_properties = { link = "Visual" }
or hl_properties = { link = "IncSearch" }
instead of default underline highlight)
Enables default autocmd
You could specify a pattern for default autocmd. Example:
- "*" - will work with any filetypes
- "*.lua" - will work only with
.lua
extension
- this plugin uses
vim.fn.clearmatches()
so if you are using default autocmd all matches would be cleared on every cursor move
- idea of this plugin is not mine, I saw a basic implementation of this in ThePrimeagen's discord unfortunally I can't find it now to specify who is the original authour. I rewrote it, implemented some of my personal ideas and made it to be a plugin-like instead of lua function.