You could also use the
sml-modeline package. It works pretty well in the terminal (imo) and is a nice alternative when
yascroll doesn't work so well. However, you might want to apply the following monkey patch to
sml-modeline-mode if you don't want it messing with stuff that's already in your modeline:
"Show buffer size and position like scrollbar in mode line.
You can customize this minor mode, see option `sml-modeline-mode'.
Note: If you turn this mode on then you probably want to turn off
(or current-prefix-arg 'toggle)))
(eq arg 'toggle)
(add-to-list 'mode-line-position ;; this line is patched and...
(add-to-list 'mode-line-position sml-modeline-old-car-mode-line-position)) ;; this line is patched
;; (they use `add-to-list' instead of `setcar')
(message "Sml-Modeline mode %sabled%s"
As you can see, only two lines there are patched which just make sure that it uses
add-to-list instead of
setcar (this keeps it from overriding anything that's the
mode-line-position). Also, I have the following settings in my Custom file for
'(sml-modeline-borders (quote ("[" . "] ")))
'(sml-modeline-numbers (quote percentage))
The only real quirks I've seen for this mode are that it's not really accurate in things like
Info-mode (because it seems that
Info-mode buffers are actually one big buffer given the illusion of being multiple ones) and sometimes the "scrollbar" disappears between the percent symbol and the number adjacent to it when the "scrollbar" is really small. Other than that,
sml-modeline works pretty nicely.
I just found two hacky "fixes" for the aforementioned bugs. For the bug regarding
Info-mode et al. scrolling, if you remove the
(widen) invocations from
sml-modeline-create, you'll get the expected behavior. Note that I've only tested this in
Info-mode, so don't expect this "fix" to give desired behavior everywhere. For the other bug regarding the "scrollbar" disappearing, you can eliminate this effect by not setting the
sml-modeline-borders variable. Not exactly sure why that works, but it does so whatever.