cs.vim 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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. " 2024 Jan 14 by Vim Project (browsefilter)
  7. " License: Vim (see :h license)
  8. " Repository: https://github.com/nickspoons/vim-cs
  9. if exists('b:did_ftplugin')
  10. finish
  11. endif
  12. let b:did_ftplugin = 1
  13. let s:save_cpo = &cpoptions
  14. set cpoptions&vim
  15. " Set 'formatoptions' to break comment lines but not other lines,
  16. " and insert the comment leader when hitting <CR> or using "o".
  17. setlocal formatoptions-=t formatoptions+=croql
  18. " Set 'comments' to format dashed lists in comments.
  19. setlocal comments=sO:*\ -,mO:*\ \ ,exO:*/,s1:/*,mb:*,ex:*/,:///,://
  20. let b:undo_ftplugin = 'setl com< fo<'
  21. if exists('loaded_matchit') && !exists('b:match_words')
  22. " #if/#endif support included by default
  23. let b:match_ignorecase = 0
  24. let b:match_words = '\%(^\s*\)\@<=#\s*region\>:\%(^\s*\)\@<=#\s*endregion\>,'
  25. let b:undo_ftplugin .= ' | unlet! b:match_ignorecase b:match_words'
  26. endif
  27. if (has('gui_win32') || has('gui_gtk')) && !exists('b:browsefilter')
  28. let b:browsefilter = "C# Source Files (*.cs, *.csx)\t*.cs;*.csx\n" .
  29. \ "C# Project Files (*.csproj)\t*.csproj\n" .
  30. \ "Visual Studio Solution Files (*.sln)\t*.sln\n"
  31. if has("win32")
  32. let b:browsefilter ..= "All Files (*.*)\t*\n"
  33. else
  34. let b:browsefilter ..= "All Files (*)\t*\n"
  35. endif
  36. let b:undo_ftplugin .= ' | unlet! b:browsefilter'
  37. endif
  38. let &cpoptions = s:save_cpo
  39. unlet s:save_cpo
  40. " vim:et:sw=2:sts=2