cs.vim 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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: 2021-12-07
  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_words = '\%(^\s*\)\@<=#\s*region\>:\%(^\s*\)\@<=#\s*endregion\>,'
  23. let b:undo_ftplugin .= ' | unlet! b:match_words'
  24. endif
  25. if (has('gui_win32') || has('gui_gtk')) && !exists('b:browsefilter')
  26. let b:browsefilter = "C# Source Files (*.cs *.csx)\t*.cs;*.csx\n" .
  27. \ "C# Project Files (*.csproj)\t*.csproj\n" .
  28. \ "Visual Studio Solution Files (*.sln)\t*.sln\n" .
  29. \ "All Files (*.*)\t*.*\n"
  30. let b:undo_ftplugin .= ' | unlet! b:browsefilter'
  31. endif
  32. let &cpoptions = s:save_cpo
  33. unlet s:save_cpo
  34. " vim:et:sw=2:sts=2