Reputation: 304
I wanted to modify the function created by Andreas Politz (discussion here: https://groups.google.com/d/msg/vim_use/6bO-QKWj9_4/2cdqygSqcMgJ) to work with vsplits too. This function creates a horizontal scrollbar to indicate the current position in the file (I actually don't like MacVim default scrollbars). The size of the scrollbar depends on the width of the whole window and does not adapt to vsplit. As I use NERDTree plugin, every vsplit has a oversized scrollbar.
I've done some searches on StackOverflow and VIM wiki but I only found commands to resize the vsplit and none to get the actual size.
Do you have any clue on how to get the current vsplit width?
PS: My results so far:
:set columns
returns actual window size:set winwidth
returns the minimum width of window:set window
gives me a number that doesn't change when I switch between splits (77
each time)Upvotes: 0
Views: 150
Reputation: 196556
:echo winwidth(0)
returns the width of window 0
.
See :help functions
for a comprehensive list of functions available in Vim. The documentation is the first place you should visit if you are looking for anything Vim-related.
Upvotes: 2