blob: f53ffcbc8eed6dd61cb0b21707b5d7b9ebc7ff6c [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>
5" Last Change: 2021-12-07
6" License: Vim (see :h license)
7" Repository: https://github.com/nickspoons/vim-cs
Bram Moolenaar071d4272004-06-13 20:20:40 +00008
Bram Moolenaar63f32602022-06-09 20:45:54 +01009if exists('b:did_ftplugin')
Bram Moolenaar071d4272004-06-13 20:20:40 +000010 finish
11endif
Bram Moolenaar071d4272004-06-13 20:20:40 +000012let b:did_ftplugin = 1
Bram Moolenaar63f32602022-06-09 20:45:54 +010013
14let s:save_cpo = &cpoptions
15set cpoptions&vim
Bram Moolenaar071d4272004-06-13 20:20:40 +000016
Bram Moolenaar071d4272004-06-13 20:20:40 +000017" Set 'formatoptions' to break comment lines but not other lines,
18" and insert the comment leader when hitting <CR> or using "o".
Bram Moolenaar63f32602022-06-09 20:45:54 +010019setlocal formatoptions-=t formatoptions+=croql
Bram Moolenaar071d4272004-06-13 20:20:40 +000020
21" Set 'comments' to format dashed lists in comments.
22setlocal comments=sO:*\ -,mO:*\ \ ,exO:*/,s1:/*,mb:*,ex:*/,:///,://
23
Bram Moolenaar63f32602022-06-09 20:45:54 +010024let b:undo_ftplugin = 'setl com< fo<'
25
26if exists('loaded_matchit') && !exists('b:match_words')
27 " #if/#endif support included by default
28 let b:match_words = '\%(^\s*\)\@<=#\s*region\>:\%(^\s*\)\@<=#\s*endregion\>,'
29 let b:undo_ftplugin .= ' | unlet! b:match_words'
Bram Moolenaar071d4272004-06-13 20:20:40 +000030endif
Bram Moolenaar8e52a592012-05-18 21:49:28 +020031
Bram Moolenaar63f32602022-06-09 20:45:54 +010032if (has('gui_win32') || has('gui_gtk')) && !exists('b:browsefilter')
33 let b:browsefilter = "C# Source Files (*.cs *.csx)\t*.cs;*.csx\n" .
34 \ "C# Project Files (*.csproj)\t*.csproj\n" .
35 \ "Visual Studio Solution Files (*.sln)\t*.sln\n" .
36 \ "All Files (*.*)\t*.*\n"
37 let b:undo_ftplugin .= ' | unlet! b:browsefilter'
38endif
39
40let &cpoptions = s:save_cpo
41unlet s:save_cpo
42
43" vim:et:sw=2:sts=2