Small plugin that adds a command to run dotnet-csharpier on C# files.
CSharpier is an opinionated code formatter for C#.
You can invoke the formatter manually from the command menu, "CSharpier: format file". You can also configure the plugin to run automatically on save by editing the package settings (Preferences/Package Settings/CSharpier):
{
"format_on_save": true,
}
Note that the command is only visible, and runs on save, when used on C# files.
Thanks to @thijsdezoete's isort plugin for providing a convenient starting point!
To install csharpier: dotnet tool install csharpier -g.
dotnet is part of the .NET CLI, included in the .NET SDK.
Hopefully soon: in @wbond's Package Control. Until then, open the command menu (default ctrl-shift-p), choose Package Control: Add Repository and paste in the repo URL: https://github.com/mkonstapel/sublime-text-csharpier-plugin.
To install the package, choose Package Control: Install Package from the command menu and search for csharpier.
Clone this repository from your Sublime packages directory:
$ cd ~/.config/sublime-text/Packages
$ git clone https://github.com/mkonstapel/sublime-text-csharpier-plugin
$ cd "~/Library/Application Support/Sublime Text/Packages"
$ git clone https://github.com/mkonstapel/sublime-text-csharpier-plugin
$ cd "%APPDATA%\Sublime Text\Packages"
$ git clone https://github.com/mkonstapel/sublime-text-csharpier-plugin