https://github.com/nobe4/relative-n.vim
Display the nth relative number in the signs bar
https://github.com/nobe4/relative-n.vim
Last synced: 4 months ago
JSON representation
Display the nth relative number in the signs bar
- Host: GitHub
- URL: https://github.com/nobe4/relative-n.vim
- Owner: nobe4
- License: mit
- Created: 2015-08-12T21:21:04.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2015-08-12T21:30:07.000Z (almost 11 years ago)
- Last Synced: 2025-01-20T06:41:49.993Z (over 1 year ago)
- Language: VimL
- Size: 129 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# relative-n.vim
Display the nth relative number in the signs bar
# What ?
This script display the 10nth lines before and after the current cursor row
position. It comes from a [this question](http://vi.stackexchange.com/questions/4288/show-only-every-n-relative-line-number).
The core concept behind it comes directly from the
[vim-signature](https://github.com/kshenoy/vim-signature) plugin. Here is
a step-by-step walkthrough :
1. Remove all previous signs from the sign bar
2. Build a list of the lines you want to show in the sign bar
3. For each line, create a new sign with a unique id (based on current buffer
and line number)
4. For each line, display the sign (the text of the sign will be the current
line)
# Warnings
This script works as a proof of concept, but I wouldn't use is. You will see
if you try it that it gets all flickering when you move quickly. I think the
reason behind it is that the sign bar is not intended to quickly change over
time.
# Contribution
If you want to see this code evolve and maybe become a plugin, you can reach
via an issue. Thanks !