Add yascroll bar, shrink spaceline hud
This commit is contained in:
parent
2370a91957
commit
714738bfc8
2 changed files with 25 additions and 3 deletions
1
Cask
1
Cask
|
@ -20,6 +20,7 @@
|
||||||
(depends-on "nlinum")
|
(depends-on "nlinum")
|
||||||
(depends-on "fill-column-indicator")
|
(depends-on "fill-column-indicator")
|
||||||
(depends-on "spaceline" :git "https://github.com/TheBB/spaceline")
|
(depends-on "spaceline" :git "https://github.com/TheBB/spaceline")
|
||||||
|
(depends-on "yascroll")
|
||||||
|
|
||||||
;; Evil --- core/core-evil.el
|
;; Evil --- core/core-evil.el
|
||||||
(depends-on "evil")
|
(depends-on "evil")
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
;; see lib/ui-defuns.el
|
;; see lib/ui-defuns.el
|
||||||
|
|
||||||
(when window-system
|
(when window-system
|
||||||
(fringe-mode '(1 . 8))
|
(fringe-mode '(2 . 4))
|
||||||
(set-frame-font narf-default-font)
|
(set-frame-font narf-default-font)
|
||||||
(setq frame-title-format '(buffer-file-name "%f" ("%b"))))
|
(setq frame-title-format '(buffer-file-name "%f" ("%b"))))
|
||||||
|
|
||||||
|
@ -33,6 +33,21 @@
|
||||||
|
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
|
||||||
|
(use-package yascroll
|
||||||
|
:config
|
||||||
|
(defun yascroll:compute-thumb-size (window-lines buffer-lines)
|
||||||
|
"Return the proper size (height) of scroll bar thumb."
|
||||||
|
(let ((window-lines (* window-lines 0.91)))
|
||||||
|
(if (zerop buffer-lines)
|
||||||
|
1
|
||||||
|
(max 1 (floor (min (* (/ (float window-lines) buffer-lines) window-lines) buffer-lines))))))
|
||||||
|
|
||||||
|
(setq yascroll:scroll-bar 'right-fringe
|
||||||
|
yascroll:delay-to-hide nil)
|
||||||
|
(add-to-list 'yascroll:enabled-window-systems 'mac)
|
||||||
|
(defadvice yascroll:before-change (around always-show-bar activate) ())
|
||||||
|
(global-yascroll-bar-mode 1))
|
||||||
|
|
||||||
(use-package fill-column-indicator
|
(use-package fill-column-indicator
|
||||||
:config
|
:config
|
||||||
(setq fci-rule-color "#2b303f")
|
(setq fci-rule-color "#2b303f")
|
||||||
|
@ -183,11 +198,16 @@
|
||||||
|
|
||||||
(spaceline-define-segment narf-env-version
|
(spaceline-define-segment narf-env-version
|
||||||
"A HUD that shows which part of the buffer is currently visible."
|
"A HUD that shows which part of the buffer is currently visible."
|
||||||
(unless narf--env-version
|
(when (and narf--env-command (not narf--env-version))
|
||||||
(narf|spaceline-env-update))
|
(narf|spaceline-env-update))
|
||||||
narf--env-version
|
narf--env-version
|
||||||
:when (and narf--env-version (memq major-mode '(ruby-mode enh-ruby-mode python-mode))))
|
:when (and narf--env-version (memq major-mode '(ruby-mode enh-ruby-mode python-mode))))
|
||||||
|
|
||||||
|
(spaceline-define-segment narf-hud
|
||||||
|
"A HUD that shows which part of the buffer is currently visible."
|
||||||
|
(powerline-hud highlight-face default-face 1)
|
||||||
|
:tight t)
|
||||||
|
|
||||||
;; Initialize modeline
|
;; Initialize modeline
|
||||||
(spaceline-install
|
(spaceline-install
|
||||||
;; Left side
|
;; Left side
|
||||||
|
@ -205,7 +225,8 @@
|
||||||
process :when active)
|
process :when active)
|
||||||
(global :when active)
|
(global :when active)
|
||||||
narf-buffer-position
|
narf-buffer-position
|
||||||
narf-hud)))
|
narf-hud
|
||||||
|
)))
|
||||||
|
|
||||||
(provide 'core-ui)
|
(provide 'core-ui)
|
||||||
;;; core-ui.el ends here
|
;;; core-ui.el ends here
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue