blob: ada71315e1f6e9a495454459d8a5755b0bc0e94a [file] [log] [blame]
Bram Moolenaar071d4272004-06-13 20:20:40 +00001" Vim filetype plugin file
Bram Moolenaar63f32602022-06-09 20:45:54 +01002" Language: C#
3" Maintainer: Nick Jensen <nickspoon@gmail.com>
4" Former Maintainer: Johannes Zellner <johannes@zellner.org>
Bram Moolenaar86b48162022-12-06 18:20:10 +00005" Last Change: 2022-11-16
Doug Kearns93197fd2024-01-14 20:59:02 +01006" 2024 Jan 14 by Vim Project (browsefilter)
Bram Moolenaar63f32602022-06-09 20:45:54 +01007" License: Vim (see :h license)
8" Repository: https://github.com/nickspoons/vim-cs
Bram Moolenaar071d4272004-06-13 20:20:40 +00009
Bram Moolenaar63f32602022-06-09 20:45:54 +010010if exists('b:did_ftplugin')
Bram Moolenaar071d4272004-06-13 20:20:40 +000011 finish
12endif
Bram Moolenaar071d4272004-06-13 20:20:40 +000013let b:did_ftplugin = 1
Bram Moolenaar63f32602022-06-09 20:45:54 +010014
15let s:save_cpo = &cpoptions
16set cpoptions&vim
Bram Moolenaar071d4272004-06-13 20:20:40 +000017
Bram Moolenaar071d4272004-06-13 20:20:40 +000018" Set 'formatoptions' to break comment lines but not other lines,
19" and insert the comment leader when hitting <CR> or using "o".
Bram Moolenaar63f32602022-06-09 20:45:54 +010020setlocal formatoptions-=t formatoptions+=croql
Bram Moolenaar071d4272004-06-13 20:20:40 +000021
22" Set 'comments' to format dashed lists in comments.
23setlocal comments=sO:*\ -,mO:*\ \ ,exO:*/,s1:/*,mb:*,ex:*/,:///,://
24
Bram Moolenaar63f32602022-06-09 20:45:54 +010025let b:undo_ftplugin = 'setl com< fo<'
26
27if exists('loaded_matchit') && !exists('b:match_words')
28 " #if/#endif support included by default
Bram Moolenaar86b48162022-12-06 18:20:10 +000029 let b:match_ignorecase = 0
Bram Moolenaar63f32602022-06-09 20:45:54 +010030 let b:match_words = '\%(^\s*\)\@<=#\s*region\>:\%(^\s*\)\@<=#\s*endregion\>,'
Bram Moolenaar86b48162022-12-06 18:20:10 +000031 let b:undo_ftplugin .= ' | unlet! b:match_ignorecase b:match_words'
Bram Moolenaar071d4272004-06-13 20:20:40 +000032endif
Bram Moolenaar8e52a592012-05-18 21:49:28 +020033
Bram Moolenaar63f32602022-06-09 20:45:54 +010034if (has('gui_win32') || has('gui_gtk')) && !exists('b:browsefilter')
Doug Kearns93197fd2024-01-14 20:59:02 +010035 let b:browsefilter = "C# Source Files (*.cs, *.csx)\t*.cs;*.csx\n" .
Bram Moolenaar63f32602022-06-09 20:45:54 +010036 \ "C# Project Files (*.csproj)\t*.csproj\n" .
Doug Kearns93197fd2024-01-14 20:59:02 +010037 \ "Visual Studio Solution Files (*.sln)\t*.sln\n"
38 if has("win32")
39 let b:browsefilter ..= "All Files (*.*)\t*\n"
40 else
41 let b:browsefilter ..= "All Files (*)\t*\n"
42 endif
Bram Moolenaar63f32602022-06-09 20:45:54 +010043 let b:undo_ftplugin .= ' | unlet! b:browsefilter'
44endif
45
46let &cpoptions = s:save_cpo
47unlet s:save_cpo
48
49" vim:et:sw=2:sts=2