1 " toggle unite, quickfix list and location list
2 if exists("g:loaded_toggle_list")
6 let g:loaded_toggle_list = 1
8 function! s:GetBufferList()
15 function! s:ToggleLocationList()
16 for bufnum in map(filter(split(s:GetBufferList(), '\n'), 'v:val =~# "Location List"'), 'str2nr(matchstr(v:val, "\\d\\+"))')
32 echohl WarningMsg | echon 'No Location List' | echohl None
36 function! s:ToggleQuickfixList()
37 for bufnum in map(filter(split(s:GetBufferList(), '\n'), 'v:val =~ "Quickfix List"'), 'str2nr(matchstr(v:val, "\\d\\+"))')
38 if bufwinnr(bufnum) != -1
51 function! s:ToggleUnite()
52 for i in range(1, winnr('$'))
53 let name = bufname(winbufnr(i))
54 if match(name, '^\[unite\]') == 0
62 nmap <silent> [oq :copen<cr>
63 nmap <silent> ]oq :cclose<cr>
64 nmap <silent> coq :call <SID>ToggleLocationList()<CR>
65 nmap <silent> [ol :lopen<cr>
66 nmap <silent> ]ol :lclose<cr>
67 nmap <silent> col :call <SID>ToggleQuickfixList()<CR>