๐Ÿ“ฆ yochem / jumpsigns.nvim

Show jump locations in the signcolumn

โ˜… 1 stars โ‘‚ 0 forks ๐Ÿ‘ 1 watching
๐Ÿ“ฅ Clone https://github.com/yochem/jumpsigns.nvim.git
HTTPS git clone https://github.com/yochem/jumpsigns.nvim.git
SSH git clone git@github.com:yochem/jumpsigns.nvim.git
CLI gh repo clone yochem/jumpsigns.nvim
Yochem van Rosmalen Yochem van Rosmalen Remove readme errors 47724bc 1 years ago ๐Ÿ“ History
๐Ÿ“‚ main View all commits โ†’
๐Ÿ“ lua
๐Ÿ“„ README.md
๐Ÿ“„ README.md

jumpsigns.nvim

Show jump locations in the signcolumn
Example image

In the image, the jumpsigns are highlighted in orange. This is not the normal highlight color.

This plugin shows jump locations of different motions in the sign column, to quickly glance which motion to use to get somewhere quickly.

Features

  • Currently supported motions:
M / L }
  • More to come!
  • Checkhealth support: :checkhealth jumpsigns
  • Highlighting groups: :hi @jumpsigns.sign
  • Toggle on keymap: :nmap <leader>js <Plug>(JumpSignsToggle)
This plugin is inspired by mawkler/hml.nvim.

Installation

Lazy:

{
  "yochem/jumpsigns.nvim",
  opts = {}
}

For others, use the url from this repo and don't forget to call the setup function somewhere in your config:

require("jumpsigns").setup()

Configuration

Full configuration with comments in config.lua. This is the default:

{
  enabled = true,
  priority = 11,
  signs = {
    window_high = { text = "H" },
    window_middle = { text = "M" },
    window_low = { text = "L" },
    paragraph_prev = { text = "{" },
    paragraph_next = { text = "}" },
  },
}

All signs configurations also accept an enabled and priority argument to control the individual jumpsign.

Tips

Highlights

To change colors/highlighting, use Nvims builtin highlight commands:

-- Change highlight of all signs
vim.api.nvim_set_hl(0, "@jumpsigns.sign", { fg = "Orange" })

-- or change only one (e.g. for `H`)
vim.api.nvim_set_hl(0, "@jumpsigns.sign.window_high", { fg = "Gray" })

Toggle and lazy-load

To toggle, enable, or disable this plugin, <Plug>(JumpSignsToggle), <Plug>(JumpSignsEnable), and <Plug>(JumpSignsToggle) are exposed. For example, to lazy-load on a keymap:

require("jumpsigns").setup({ enabled = false })
vim.keymap.set("n", "<leader>js", "<Plug>(JumpSignsToggle)")

Similar Projects

plugin, always places signs in number column. Also shows linewise jump targets in a virtual lines below the current line.