https://github.com/wolandark/dotnet-vim
Dotnet-Vim - A simple plugin to interface with the dotnet CLI from Vim (WIP)
https://github.com/wolandark/dotnet-vim
csharp dotnet vim vim-plugin
Last synced: 5 months ago
JSON representation
Dotnet-Vim - A simple plugin to interface with the dotnet CLI from Vim (WIP)
- Host: GitHub
- URL: https://github.com/wolandark/dotnet-vim
- Owner: wolandark
- Created: 2024-12-06T16:53:34.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2024-12-06T17:04:41.000Z (over 1 year ago)
- Last Synced: 2025-04-14T19:29:58.691Z (about 1 year ago)
- Topics: csharp, dotnet, vim, vim-plugin
- Language: Vim Script
- Homepage:
- Size: 3.91 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Dotnet CLI Vim Plugin
A Vim plugin for interfacing with the .NET CLI directly from Vim. This plugin allows you to run common `dotnet` commands seamlessly within the editor.
## Features
The plugin provides the following commands for interacting with the .NET CLI:
### Commands
| Command | Description |
|---------------------------------|-----------------------------------------------------------------------------|
| `:DotnetBuild` | Builds the project in the current directory. |
| `:DotnetRun` | Runs the project in the current directory. |
| `:DotnetTest` | Runs tests for the project. |
| `:DotnetRestore` | Restores dependencies and project-specific tools. |
| `:DotnetAddClass ` | Adds a new class with the specified name (e.g., `Student`). |
| `:DotnetAddInterface ` | Adds a new interface with the specified name (e.g., `IStudent`). |
| `:DotnetNewGitignore` | Creates a new `.gitignore` file for the project. |
| `:DotnetNewProject ` | Creates a new console project with the specified name. |
| `:DotnetAddPackage ` | Adds a NuGet package to the project (e.g., `Newtonsoft.Json`). |
| `:DotnetAddReference ` | Adds a project reference (e.g., `../MyLibrary/MyLibrary.csproj`). |
| `:DotnetRemovePackage ` | Removes a NuGet package from the project (e.g., `Newtonsoft.Json`). |
| `:DotnetRemoveReference ` | Removes a project reference (e.g., `../MyLibrary/MyLibrary.csproj`). |
| `:DotnetClean` | Cleans the build outputs of the project or solution. |
## Examples
Here are some practical examples of how to use the plugin:
**Build the project**:
`:DotnetBuild`
**Run the project**:
`:DotnetRun`
**Test the project**:
`:DotnetTest`
**Restore dependencies**:
`:DotnetRestore`
**Add a new class named Student**:
`:DotnetAddClass Student`
Add a new interface named IStudent:
`:DotnetAddInterface IStudent`
**Generate a .gitignore file**:
`:DotnetNewGitignore`
**Create a new console project named MyProject**:
`:DotnetNewProject MyProject`
**Add a package, for example, Newtonsoft.Json**:
`:DotnetAddPackage Newtonsoft.Json`
**Add a reference to another project, for example, ../MyLibrary/MyLibrary.csproj**:
`:DotnetAddReference ../MyLibrary/MyLibrary.csproj`
**Remove a package, for example, Newtonsoft.Json**:
`:DotnetRemovePackage Newtonsoft.Json`
**Remove a reference, for example, ../MyLibrary/MyLibrary.csproj**:
`:DotnetRemoveReference ../MyLibrary/MyLibrary.csproj`
**Clean the solution**:
`:DotnetClean`
# Installation
## Manual Installation
Create the plugin directory: `~/.vim/pack/plugins/start/dotnet/`
Save the plugin file as `dotnet.vim` in the above directory.
You can also place the plugin file under `ftplugin`. See `:h ftplugin`.
## Vim Plugin Managers
If you use a plugin manager like vim-plug, add the following line to your .vimrc:
```
Plug 'wolandark/dotnet-vim'
```
# License
This plugin is licensed under the MIT License.
# Contributions
Contributions and feature suggestions are welcome! Feel free to open issues or submit pull requests.