Skip to content

Commit

Permalink
Replace linum by nlinum and nlinum-relative
Browse files Browse the repository at this point in the history
  • Loading branch information
xcodebuild authored and syl20bnr committed May 17, 2016
1 parent b4b4491 commit fa4eeb4
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 17 deletions.
8 changes: 1 addition & 7 deletions layers/+distribution/spacemacs-base/config.el
Original file line number Diff line number Diff line change
Expand Up @@ -117,13 +117,7 @@ It runs `tabulated-list-revert-hook', then calls `tabulated-list-print'."
(setq window-combination-resize t)
;; Show column number in mode line
(setq column-number-mode t)
;; Activate linum-mode in all prog-mode and text-mode buffers if the setting is
;; enabled.
(when dotspacemacs-line-numbers
(add-hook 'prog-mode-hook 'linum-mode)
(add-hook 'text-mode-hook 'linum-mode))
;; line number
(setq linum-format "%4d")

;; highlight current line
(global-hl-line-mode t)
;; no blink
Expand Down
6 changes: 3 additions & 3 deletions layers/+distribution/spacemacs-base/keybindings.el
Original file line number Diff line number Diff line change
Expand Up @@ -246,9 +246,9 @@
:documentation "Move point according to visual lines."
:evil-leader "tL")
(spacemacs|add-toggle line-numbers
:status linum-mode
:on (linum-mode)
:off (linum-mode -1)
:status nlinum-mode
:on (nlinum-mode)
:off (nlinum-mode -1)
:documentation "Show the line numbers."
:evil-leader "tn")
(spacemacs|add-toggle auto-fill-mode
Expand Down
13 changes: 13 additions & 0 deletions layers/+distribution/spacemacs-base/packages.el
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
(hi-lock :location built-in)
(holy-mode :location local :step pre)
(hybrid-mode :location local :step pre)
nlinum
(package-menu :location built-in)
(process-menu :location built-in)
(recentf :location built-in)
Expand Down Expand Up @@ -183,6 +184,18 @@
:evil-leader "tEh")
(spacemacs|diminish hybrid-mode " Ⓔh" " Eh"))))

(defun spacemacs-base/init-nlinum ()
(use-package nlinum
:init
(progn
;; Activate nlinum-mode in all prog-mode and text-mode buffers if the setting is
;; enabled.
(when dotspacemacs-line-numbers
(add-hook 'prog-mode-hook 'nlinum-mode)
(add-hook 'text-mode-hook 'nlinum-mode))
;; line number
(setq nlinum-format "%4d"))))

(defun spacemacs-base/init-package-menu ()
(evilified-state-evilify-map package-menu-mode-map
:mode package-menu-mode))
Expand Down
17 changes: 10 additions & 7 deletions layers/+spacemacs/spacemacs-editing-visual/packages.el
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
;; see https://github.com/syl20bnr/spacemacs/issues/2529
(hl-anything :excluded t)
indent-guide
linum-relative
nlinum-relative
rainbow-delimiters
volatile-highlights
))
Expand Down Expand Up @@ -370,17 +370,20 @@
:config
(spacemacs|diminish indent-guide-mode "" " i")))

(defun spacemacs-editing-visual/init-linum-relative ()
(use-package linum-relative
:commands (linum-relative-toggle linum-relative-on)
(defun spacemacs-editing-visual/init-nlinum-relative ()
(use-package nlinum-relative
:commands (nlinum-relative-toggle nlinum-relative-on)
:init
(progn
(when (eq dotspacemacs-line-numbers 'relative)
(linum-relative-on))
(spacemacs/set-leader-keys "tr" 'linum-relative-toggle))
(nlinum-relative-setup-evil)
(add-hook 'nlinum-mode-hook 'nlinum-relative-on))
(spacemacs/set-leader-keys "tr" 'nlinum-relative-toggle))
:config
(progn
(setq linum-relative-current-symbol ""))))
(setq nlinum-relative-current-symbol "")
(setq nlinum-relative-redisplay-delay 0)
)))

(defun spacemacs-editing-visual/init-rainbow-delimiters ()
(use-package rainbow-delimiters
Expand Down

0 comments on commit fa4eeb4

Please sign in to comment.