Feature suggestion: console-mode scrollbars

271 views
Skip to first unread message

Yang Zhang

unread,
Oct 6, 2009, 1:46:56 PM10/6/09
to v...@vim.org
Would there be any possibility to add scrollbars to the console
versions of vim? A scrollbar can serve as a stronger visual indicator
of position and size than the percentage indicator in the status bar.
--
Yang Zhang
http://www.mit.edu/~y_z/

Gene Kwiecinski

unread,
Oct 6, 2009, 2:57:27 PM10/6/09
to vim...@googlegroups.com
>Would there be any possibility to add scrollbars to the console
>versions of vim? A scrollbar can serve as a stronger visual indicator

Ummm, aren't scrollbars pretty much by definition *graphical*?

Unless you want the equivalent of some DOS-era application with
hideous character-based scrollbars.


Man, maybe I'm just in a foul mood or something, but keyclicks,
scrollbars, etc., what's next? Wanting to use 'vim' to directly
edit .gifs/.jpgs like M$Paint or something? C'mon...

Christian Brabandt

unread,
Oct 6, 2009, 3:37:26 PM10/6/09
to vim...@googlegroups.com, v...@vim.org
Hi Yang!

On Di, 06 Okt 2009, Yang Zhang wrote:

> Would there be any possibility to add scrollbars to the console
> versions of vim? A scrollbar can serve as a stronger visual indicator
> of position and size than the percentage indicator in the status bar.

I used to have the following function by Andreas Politzน for quite some time in my .vimrc

,----
| " A statusbar function, that provides a visual scrollbar (courtesy of A.Politz)
| func! STL()
| let stl = '%f [%{(&fenc==""?&enc:&fenc).((exists("+bomb") && &bomb)?",B":"")}%M%R%H%W] %y [%l/%L,%v] [%p%%]'
| let barWidth = &columns - 65 " <-- wild guess
| let barWidth = barWidth < 3 ? 3 : barWidth
|
| if line('$') > 1
| let progress = (line('.')-1) * (barWidth-1) / (line('$')-1)
| else
| let progress = barWidth/2
| endif
|
| " line + vcol + %
| let pad = strlen(line('$'))-strlen(line('.')) + 3 - strlen(virtcol('.')) + 3 - strlen(line('.')*100/line('$'))
| let bar = repeat(' ',pad).' [%1*%'.barWidth.'.'.barWidth.'('
| \.repeat('-',progress )
| \.'%2*0%1*'
| \.repeat('-',barWidth - progress - 1).'%0*%)%<]'
|
| return stl.bar
| endfun
|
| hi def link User1 DiffAdd
| hi def link User2 DiffDelete
| set stl=%!STL()
`----

regards,
Christian
--
น)http://groups.google.com/group/vim_use/msg/01ba9fdfdeb6015a

Yang Zhang

unread,
Oct 6, 2009, 5:02:55 PM10/6/09
to vim...@googlegroups.com, v...@vim.org
Nice. I'll take it. Thanks.

On Tue, Oct 6, 2009 at 12:37 PM, Christian Brabandt <cbl...@256bit.org> wrote:
>
> Hi Yang!
>
> On Di, 06 Okt 2009, Yang Zhang wrote:
>
>> Would there be any possibility to add scrollbars to the console
>> versions of vim? A scrollbar can serve as a stronger visual indicator
>> of position and size than the percentage indicator in the status bar.
>
> I used to have the following function by Andreas Politz¹ for quite some time in my .vimrc
> ¹)http://groups.google.com/group/vim_use/msg/01ba9fdfdeb6015a
Reply all
Reply to author
Forward
0 new messages