diff --git a/Cask b/Cask index c146aac0a..123524c40 100644 --- a/Cask +++ b/Cask @@ -20,6 +20,7 @@ (depends-on "nlinum") (depends-on "fill-column-indicator") (depends-on "spaceline" :git "https://github.com/TheBB/spaceline") +(depends-on "yascroll") ;; Evil --- core/core-evil.el (depends-on "evil") diff --git a/core/core-ui.el b/core/core-ui.el index d9816c3b9..5c68ccc6d 100644 --- a/core/core-ui.el +++ b/core/core-ui.el @@ -2,7 +2,7 @@ ;; see lib/ui-defuns.el (when window-system - (fringe-mode '(1 . 8)) + (fringe-mode '(2 . 4)) (set-frame-font narf-default-font) (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 :config (setq fci-rule-color "#2b303f") @@ -183,11 +198,16 @@ (spaceline-define-segment narf-env-version "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--env-version :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 (spaceline-install ;; Left side @@ -205,7 +225,8 @@ process :when active) (global :when active) narf-buffer-position - narf-hud))) + narf-hud + ))) (provide 'core-ui) ;;; core-ui.el ends here