neovim

Neovim text editor
git clone https://git.dasho.dev/neovim.git
Log | Files | Refs | README

cs.vim (1644B)


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