cpp.vim 760 B

123456789101112131415161718192021222324
  1. " Vim filetype plugin file
  2. " Language: C++
  3. " Maintainer: The Vim Project <https://github.com/vim/vim>
  4. " Last Change: 2024 Jun 06
  5. " Former Maintainer: Bram Moolenaar <Bram@vim.org>
  6. " Only do this when not done yet for this buffer
  7. if exists("b:did_ftplugin")
  8. finish
  9. endif
  10. " Behaves mostly just like C
  11. " XXX: "[.]" in the first pattern makes it a wildcard on Windows
  12. runtime! ftplugin/c[.]{vim,lua} ftplugin/c_*.{vim,lua} ftplugin/c/*.{vim,lua}
  13. " Change 'commentstring' to "C++ style"/"mono-line" comments
  14. setlocal commentstring=//\ %s
  15. let b:undo_ftplugin ..= ' | setl commentstring<'
  16. " C++ uses templates with <things>
  17. " Disabled, because it gives an error for typing an unmatched ">".
  18. " set matchpairs+=<:>
  19. " let b:undo_ftplugin ..= ' | setl matchpairs<'