Skip to content

How to map a key to toggle list? #4298

Answered by chemzqm
xbot asked this question in Q&A
Oct 17, 2022 · 2 comments · 2 replies
Discussion options

You must be logged in to vote

Create a function like

function! ToggleList() abort
  let find = 0
  for info in getwininfo()
    if bufname(info['bufnr']) =~# 'list:///'
      let find = 1
      break
    endif
  endfor
  if find
    CocListCancel
  else
    CocListResume
  endif
endfunction

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
2 replies
@xbot
Comment options

@chemzqm
Comment options

Answer selected by chemzqm
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants