cs.vim 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. " Vim filetype plugin file
  2. " Language: C#
  3. " Maintainer: Nick Jensen <nickspoon@gmail.com>
  4. " Former Maintainer: Johannes Zellner <johannes@zellner.org>
  5. " Last Change: 2022-11-16
  6. " License: Vim (see :h license)
  7. " Repository: https://github.com/nickspoons/vim-cs
  8. if exists('b:did_ftplugin')
  9. finish
  10. endif
  11. let b:did_ftplugin = 1
  12. let s:save_cpo = &cpoptions
  13. set cpoptions&vim
  14. " Set 'formatoptions' to break comment lines but not other lines,
  15. " and insert the comment leader when hitting <CR> or using "o".
  16. setlocal formatoptions-=t formatoptions+=croql
  17. " Set 'comments' to format dashed lists in comments.
  18. setlocal comments=sO:*\ -,mO:*\ \ ,exO:*/,s1:/*,mb:*,ex:*/,:///,://
  19. let b:undo_ftplugin = 'setl com< fo<'
  20. if exists('loaded_matchit') && !exists('b:match_words')
  21. " #if/#endif support included by default
  22. let b:match_ignorecase = 0
  23. let b:match_words = '\%(^\s*\)\@<=#\s*region\>:\%(^\s*\)\@<=#\s*endregion\>,'
  24. let b:undo_ftplugin .= ' | unlet! b:match_ignorecase b:match_words'
  25. endif
  26. if (has('gui_win32') || has('gui_gtk')) && !exists('b:browsefilter')
  27. let b:browsefilter = "C# Source Files (*.cs *.csx)\t*.cs;*.csx\n" .
  28. \ "C# Project Files (*.csproj)\t*.csproj\n" .
  29. \ "Visual Studio Solution Files (*.sln)\t*.sln\n" .
  30. \ "All Files (*.*)\t*.*\n"
  31. let b:undo_ftplugin .= ' | unlet! b:browsefilter'
  32. endif
  33. let &cpoptions = s:save_cpo
  34. unlet s:save_cpo
  35. " vim:et:sw=2:sts=2