On 10/6/06, Yegappan Lakshmanan <[EMAIL PROTECTED]> wrote:
Hi,

On 10/6/06, Mike <[EMAIL PROTECTED]> wrote:
> On 10/6/06, Aaron Griffin <[EMAIL PROTECTED]> wrote:
> > On 10/6/06, Mike <[EMAIL PROTECTED]> wrote:
> > > alternatively: is there a single command to toggle the quickfix
> > > window, rather than issuing :copen and :ccl?
> >
> > :help cwindow
> >
>
> The problem with :cwindow is that it depends on what is in the
> quickfix window.  I just want it to open or close, I don't care what
> is in there.
>

You can use the following function and command to toggle the
quickfix window (in Vim7):

function! s:qf_toggle()
    for i in range(1, winnr('$'))
        let bnum = winbufnr(i)
        if getbufvar(bnum, '&buftype') == 'quickfix'
            cclose
            return
        endif
    endfor

    copen
endfunction

command! Ctoggle call s:qf_toggle()

- Yegappan


That does the trick -- thanks

Mike

Reply via email to