Skip to main content
Docs / INTEGRATIONS

Dialogs & Pickers

Build confirmation, input, quick-pick, menu, and multi-select interactions in coc.nvim extensions.

Dialogs & Pickers

Dialogs are floating windows or popups that respond to user input. Neovim can focus and click bottom buttons; Vim popup buttons are activated with their highlighted shortcut character.

Choose the right API

NeedAPIResult
Custom text and buttonswindow.showDialog()Dialog or null; callback index is -1 on close.
Yes/no confirmationwindow.showPrompt()boolean.
Text inputwindow.requestInput()Entered text; falls back to Vim input() when dialogs are unavailable.
Filterable single/multi choicewindow.showQuickPick()Selected item(s) or undefined.
Cursor-position menuwindow.showMenuPicker()Zero-based index, or -1 on cancel.
Centered multi-selectwindow.showPickerDialog()Selected item(s), or undefined.

Basic dialog

ts snippet
1import { window } from 'coc.nvim'
2 
3await window.showDialog({
4 title: 'Apply edits?',
5 content: 'Three files will be changed.',
6 buttons: [{ index: 0, text: 'Apply' }, { index: 1, text: 'Cancel' }],
7 callback: index => {
8 if (index === 0) window.showInformationMessage('Applied')
9 }
10})

Confirm and input

window.showPrompt() uses <Esc>/n to reject and y to accept. window.requestInput() accepts with <CR> and cancels with <Esc>; Neovim insert-mode mappings can still apply inside its floating input.

Quick Pick

window.showQuickPick() provides fuzzy filtering and can return one or many QuickPickItem values. Use createQuickPick() only when you need lower-level lifecycle and input events.

ts snippet
1const item = await window.showQuickPick(['Vim', 'Neovim'], {
2 title: 'Choose an editor',
3 placeHolder: 'Type to filter',
4})

Menus and pickers accept <CR>, cancel with <Esc>/<C-c>, move with j/k, arrows, <Tab>/<S-Tab>, and <C-n>/<C-p>, and scroll with <C-f>/<C-b>. Picker dialogs use <Space> to toggle selection.

Configuration

Search dialog settings for confirm keys, rounded borders, maximum size, picker buttons, shortcuts, and highlight groups.

Source of truth: :h coc-dialog and the TypeScript API.