Need help with coc-pairs?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

225 Stars 13 Forks 79 Commits 10 Opened issues


Basic auto pairs extension of coc.nvim

Services available


Need anything else?

Contributors list


Auto pair extension for coc.nvim.

Note you can use other vim auto pairs plugins with coc.nvim, it's a simplified implementation to make auto pairs work like in VSCode.


have renamed to

For enhanced

 experience, checkout 
:h coc#on_enter()


  • You should disable/remove other auto pair plugins for this extension work as expected.
  • When you type a paired character which is just the next character, it would just move to the right by one column.
  • When the previous content ends with two inserting characters, the characters would just be inserted without inserting the paired character. This makes inserting triple quotes easier.
  • '
    only pairs when the character before is not a word character.
  • for
    to insert paired
    , the previous character should not be an empty space.


In vim/neovim, run this command:

:CocInstall coc-pairs


  • Insert pair characters automatically.
  • Buffer local pairs, ex:
    autocmd FileType tex let b:coc_pairs = [["$", "$"]]


  • pairs.disableLanguages
    , list of language ids to disable this extension, default:
  • pairs.enableCharacters
    , list of enabled characters, default:
    ["(", "[", "{", ".
  • pairs.enableBackspace
    , enable imap for backspace to remove paired characters, default:
    , won't work when
     is already mapped.

To disable characters for a specified filetypes, you can use

, ex:
autocmd FileType markdown let b:coc_pairs_disabled = ['`']



We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.