On Mon, Feb 28, 2011 at 03:53:27PM EST, ZyX wrote: > > How could I figure out the number of help windows in the current tab?
> let helpcount=len(filter(range(1, winnr('$')), 'getbufvar(winbufnr(v:val), > "&ft")==#"help"')) Works out of the box. :-) > You may want to change "&ft" (shortcut to "&filetype") to "&bt" > (shortcut to "&buftype"), but I would use &ft because vim behavior > when you have more then one buffer with 'buftype' set to `help' is > undefined (that is why I would have written `setl bt= | vert help > subject' instead of suggested `vnew | set bt=help | help subject'). The suggested pipe ‘setl bt= | help’ does indeed override Vim's miserly behavior relative to help windows.. Why? Another quick question.. in Vimscript, what is the natural idiom to code: if count == 0; do proc_0; fi if count == 1; do proc_1; fi if count > 1; do proc_n; fi Otherwise, is there a decent tutorial on how to write functions in Vim..? Thanks a bunch, cj -- You received this message from the "vim_use" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php