https://github.com/xcodebuild/nlinum-relative
Emacs relative line number besed on nlinum-mode
https://github.com/xcodebuild/nlinum-relative
Last synced: 24 days ago
JSON representation
Emacs relative line number besed on nlinum-mode
- Host: GitHub
- URL: https://github.com/xcodebuild/nlinum-relative
- Owner: xcodebuild
- License: gpl-2.0
- Created: 2016-05-12T06:25:17.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2022-12-01T04:35:36.000Z (over 2 years ago)
- Last Synced: 2025-01-28T02:33:19.863Z (3 months ago)
- Language: Emacs Lisp
- Size: 22.5 KB
- Stars: 61
- Watchers: 3
- Forks: 9
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- my-awesome-github-stars - xcodebuild/nlinum-relative - Emacs relative line number besed on nlinum-mode (Emacs Lisp)
README
[](http://github.com/syl20bnr/spacemacs)
[](http://opensource.org/licenses/GPL-2.0)
[](https://melpa.org/#/nlinum-relative)# nlinum-relative
Emacs relative line number based on nlinum-mode# Preview
# Why this
`nlinum` is faster than `linum` because of its use of [jit-lock](https://github.com/jwiegley/emacs-release/blob/master/lisp/jit-lock.el). `nlinum-relative` only redisplays line numbers when idle which is much more smoother especially with big files.# Install
This package is available on MELPA as `nlinum-relative`.
```lisp
(use-package nlinum-relative
:config
;; something else you want
(nlinum-relative-setup-evil)
(add-hook 'prog-mode-hook 'nlinum-relative-mode))
```# Spacemacs
Use `develop` branch's `nlinum` layer.
# Usage
``` lisp
(require 'nlinum-relative)
(nlinum-relative-setup-evil) ;; setup for evil
(add-hook 'prog-mode-hook 'nlinum-relative-mode)
(setq nlinum-relative-redisplay-delay 0) ;; delay
(setq nlinum-relative-current-symbol "->") ;; or "" for display current line number
(setq nlinum-relative-offset 0) ;; 1 if you want 0, 2, 3...
```# Related
- [coldnew/linum-relative: display relative line numbers in the left margin in emacs](https://github.com/coldnew/linum-relative)
Some code from here
- [GNU ELPA - nlinum](https://elpa.gnu.org/packages/nlinum.html)
Based on this