init: use nlinum instead of linum
nlinum from Elpa seems to handle the line number margin differently
from linum. This avoids a horizontal gap between left margin and fringe
when line numbers are downscaled with respect to the text font size.
See:
https://emacs.stackexchange.com/questions/53598/\
how-to-downscale-linum-font-size-and-avoid-left-margin-gap
diff --git a/init/init.el b/init/init.el
index e33b1c4..42266b1 100644
--- a/init/init.el
+++ b/init/init.el
@@ -38,10 +38,8 @@
(add-to-list 'package-archives
'("melpa" . "https://melpa.org/packages/") t)
-;; If running below the recommended Stretch version
-(when (< emacs-major-version 24)
- (add-to-list 'package-archives
- '("gnu" . "https://elpa.gnu.org/packages/")))
+(add-to-list 'package-archives
+ '("gnu" . "https://elpa.gnu.org/packages/"));)
(package-initialize)
@@ -51,7 +49,8 @@
smooth-scroll
markdown-mode
smart-mode-line-powerline-theme
- rainbow-delimiters))
+ rainbow-delimiters
+ nlinum))
(unless package-archive-contents
(package-refresh-contents))
@@ -73,8 +72,9 @@
("84d2f9eeb3f82d619ca4bfffe5f157282f4779732f48a5ac1484d94d5ff5b279" default)))
'(fill-column 80)
'(global-hl-line-mode t)
- '(global-linum-mode t)
- '(inhibit-startup-screen t)
+ '(nlinum-highlight-current-line t)
+ '(global-nlinum-mode t)
+ '(inhibit-startup-screen t)
'(show-paren-mode t)
'(tool-bar-mode nil))
@@ -83,12 +83,13 @@
;;'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''';;
(custom-set-faces
'(default ((t (:background "#343D46" :foreground "#D8DEE9" :slant normal
- :weight normal :width ultracondensed
- :foundry "adobe" :family "Source Code Variable"))))
+ :weight normal :width normal :foundry "adobe"
+ :family "Source Code Variable"))))
'(font-lock-comment-face ((t (:background "#343D46" :foreground "#848B97"))))
'(fringe ((t (:background "#343D46"))))
- '(hl-line ((t (:background "#2C3133"))))
- '(linum ((t (:slant normal :width ultracondensed :foreground "#848B97"))))
+ '(hl-line ((t (:background "#2C3133" :weight bold))))
+ '(nlinum-current-line ((t (:background "#2C3133" :foreground "white" :weight bold :height 80))))
+ '(nlinum ((t (:slant normal :width ultra-condensed :foreground "#848B97"))))
'(mode-line ((t (:background "#4E5A65" :foreground "#D8DEE9" :box nil))))
'(mode-line-buffer-id-inactive ((t (:inherit mode-line-buffer-id
:background "#757B81"
@@ -175,12 +176,12 @@
;;,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,;;
;; Fringe
;;'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''';;
-(fringe-mode '(12 . 0))
+(fringe-mode '(10 . 0))
;;,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,;;
;; Line number format
;;'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''';;
-(setq linum-format "%5.5s")
+(setq nlinum-format "%5.5s")
;;,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,;;
;; Highlight matching bracket
@@ -245,8 +246,8 @@
;;,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,;;
;; Furter customization for linum and left margin width
;;'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''';;
-;(eval-after-load "linum"
-; '(set-face-attribute 'linum nil :height 80))
+(eval-after-load "nlinum"
+ '(set-face-attribute 'linum nil :height 80))
(set-default-font "Source Code Variable-12")
;;,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,;;