add base name
[dotfiles.git] / emacs.d / config / init-linum.el
index 98b1af9..fd43e27 100644 (file)
@@ -1,12 +1,25 @@
 ;; refer to https://github.com/aaronbieber/dotfiles/blob/master/configs/emacs.d/lisp/init-linum.el
 ;; Stuff for line numbers.
+
+
+(custom-set-faces
+ ;; custom-set-faces was added by Custom.
+ ;; If you edit it by hand, you could mess it up, so be careful.
+ ;; Your init file should contain only one such instance.
+ ;; If there is more than one, they won't work right.
+ '(highlight-current-line-face ((t (:background "gray22"))))
+ '(linum ((t (:background "#000000" :foreground "gray40" :height 0.8 :slant italic :weigth light))))
+ '(linum-relative-current-face ((t (:inherit linum :foreground "Yellow" :weight light :height 0.8)))))
+
+(require 'linum-relative)
+
 (defface linum-current
 ;  '((t (:inherit linum :weight bold :underline "#555")))
   '((t (:inherit linum :weight bold :foreground "Yellow")))
   "The current line number.")
 
 (defun my-linum-get-format-string ()
- (let* ((width (min 4 (1+ (length (number-to-string
+ (let* ((width (max 3 (1+ (length (number-to-string
                              (count-lines (point-min) (point-max)))))))
          (format (concat "%" (number-to-string width) "d "))
          (current-line-format (concat "%-" (number-to-string width) "d ")))
 (global-linum-mode t)
 (add-hook 'linum-before-numbering-hook 'my-linum-get-format-string)
 
+
+
+
+
+;; enable linum-relative in programming mode
+;https://github.com/howardabrams/dot-files/blob/master/emacs.org
+(add-hook 'prog-mode-hook 'linum-mode)
+
+;; hight current line
+(require 'highlight-current-line)
+(highlight-current-line-on t)
+
+
+
 (provide 'init-linum)