blob: 0734d11d220211122a16a6fe9844c284468c5f4a [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
Bram Moolenaar63f32602022-06-09 20:45:54 +01006" 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
Bram Moolenaar86b48162022-12-06 18:20:10 +000028 let b:match_ignorecase = 0
Bram Moolenaar63f32602022-06-09 20:45:54 +010029 let b:match_words = '\%(^\s*\)\@<=#\s*region\>:\%(^\s*\)\@<=#\s*endregion\>,'
Bram Moolenaar86b48162022-12-06 18:20:10 +000030 let b:undo_ftplugin .= ' | unlet! b:match_ignorecase b:match_words'
Bram Moolenaar071d4272004-06-13 20:20:40 +000031endif
Bram Moolenaar8e52a592012-05-18 21:49:28 +020032
Bram Moolenaar63f32602022-06-09 20:45:54 +010033if (has('gui_win32') || has('gui_gtk')) && !exists('b:browsefilter')
34 let b:browsefilter = "C# Source Files (*.cs *.csx)\t*.cs;*.csx\n" .
35 \ "C# Project Files (*.csproj)\t*.csproj\n" .
36 \ "Visual Studio Solution Files (*.sln)\t*.sln\n" .
37 \ "All Files (*.*)\t*.*\n"
38 let b:undo_ftplugin .= ' | unlet! b:browsefilter'
39endif
40
41let &cpoptions = s:save_cpo
42unlet s:save_cpo
43
44" vim:et:sw=2:sts=2