C Sharp and Vim

Editing in Visual Studio
The VsVim emulation layer for Visual Studio is pretty complete as of 2012.

Editing in Vim
If you want to edit source in Vim and compile using Visual Studio, you can:
 * Start CMD
 * Run vcvars32.bat
 * Run gvim
 * set mp=csc\ %

Sample .vimrc
set filetype=cs " if you use doxygen, you can consider using: "  set filetype=cs.doxygen " however, the doxygen highlighting may make the code less readable

" select compiler definition to enable understanding gmcs errors " - this one is set to work with mono. compiler! gmcs

set mp=/opt/local/bin/gmcs\ -recurse:'*.cs'

" update ctags shortcut " -R        : recurse " --extra "  q        : include fully qualified items (e.g. 'Class.MethodName' as well as 'MethodName') "  f        : include files as tags (e.g. 'File.cs') " --c#-kinds "  cgms     : classes, enums, methods, structs "             (see 'ctags --list-kinds' for more information) map t :!/opt/local/bin/ctags -R --extra=+qf --c\#-kinds=cgms .

" tag completion set complete+=]

" fold #regions set foldmethod=syntax set foldlevelstart=0