Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/vladevelops/nvim_goruntest
Lets you run a test from anywhere in the context. It provides a simple set of functions to add to your Neovim configuration.
https://github.com/vladevelops/nvim_goruntest
codingtools developertools go godevelopment golang gotesting nvim nvimdevelopertools vim
Last synced: 7 days ago
JSON representation
Lets you run a test from anywhere in the context. It provides a simple set of functions to add to your Neovim configuration.
- Host: GitHub
- URL: https://github.com/vladevelops/nvim_goruntest
- Owner: vladevelops
- License: mit
- Created: 2024-06-22T13:25:56.000Z (6 months ago)
- Default Branch: main
- Last Pushed: 2024-06-22T13:59:57.000Z (6 months ago)
- Last Synced: 2024-06-22T21:45:51.641Z (6 months ago)
- Topics: codingtools, developertools, go, godevelopment, golang, gotesting, nvim, nvimdevelopertools, vim
- Language: Lua
- Homepage:
- Size: 5.86 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
![download](https://github.com/vladevelops/nvim_goruntest/assets/122153525/2486f67c-241a-4925-a57f-970fa0197f31)
# Go Test Runner for Neovim
This Neovim configuration allows you to run Go tests from anywhere within test scope, focusing on the test function under the cursor. It provides a simple set of functions and a keybinding to streamline your Go testing workflow.
## Features
- **Run Go tests under the cursor:** Automatically detects the test function name and executes it.
- **Simple integration:** Easily add the provided functions to your Neovim configuration.
- **Cache cleanup:** Cleans the Go test cache before running tests to ensure fresh results.## Installation
To integrate this functionality into your Neovim setup, follow these steps:
1. **Copy the code.**
2. **Add the code to your Neovim configuration:**
- You can directly paste the code into your configuration file.3. **Reload Neovim or restart it** to apply the changes.
## Usage
With the configuration added, you can now run Go tests under the cursor by pressing the `rt` keybinding in normal mode. This keybinding will:
1. Determine the package name of the current file.
2. Verify that the file type is Go.
3. Identify the nearest test function under the cursor.
4. Open a split terminal and run the Go test for the identified function.## Keybinding
- `rt`: Run the Go test function under the cursor.
## Contributing
Contributions are welcome! If you have suggestions or improvements, feel free to open an issue or submit a pull request.
## License
This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for more information.