chore: update readme

This commit is contained in:
Oleksandr Smirnov 2025-08-30 16:22:24 +03:00
parent 9bf72afc63
commit b7ce5d1f35
No known key found for this signature in database

104
README.md
View file

@ -4,19 +4,21 @@
Minimalistic plugin for Go development in Neovim written in Lua.
It's **NOT** an LSP tool, the main goal of this plugin is to add go tooling support in Neovim.
It's **NOT** an LSP tool, the goal of this plugin is to add go tooling support in Neovim.
> If you want to use new and maybe undocumented, and unstable features you might use [develop](https://github.com/olexsmir/gopher.nvim/tree/develop) branch.
> All development of new and maybe undocumented, and unstable features is happening on [develop](https://github.com/olexsmir/gopher.nvim/tree/develop) branch.
## Install (using [lazy.nvim](https://github.com/folke/lazy.nvim))
Requirements:
- **Neovim 0.10** or later
- Treesitter `go` parser(`:TSInstall go` if you use [nvim-treesitter](https://github.com/nvim-treesitter/nvim-treesitter))
- [Go](https://github.com/golang/go) installed (tested on 1.23)
- Treesitter parser for `go`(`:TSInstall go` if you use [nvim-treesitter](https://github.com/nvim-treesitter/nvim-treesitter))
- [Go](https://github.com/golang/go) installed
```lua
-- NOTE: this plugin is already lazy-loaded, it adds only about 1ms of load
-- time to your config
{
"olexsmir/gopher.nvim",
ft = "go",
@ -25,58 +27,14 @@ Requirements:
build = function()
vim.cmd.GoInstallDeps()
end,
---@module "gopher"
---@type gopher.Config
opts = {},
}
```
## Configuration
> [!IMPORTANT]
>
> If you need more info look `:h gopher.nvim`
**Take a look at default options (might be a bit outdated, look `:h gopher.nvim-config`)**
```lua
require("gopher").setup {
-- log level, you might consider using DEBUG or TRACE for debugging the plugin
log_level = vim.log.levels.INFO,
-- timeout for running internal commands
timeout = 2000,
commands = {
go = "go",
gomodifytags = "gomodifytags",
gotests = "gotests",
impl = "impl",
iferr = "iferr",
},
gotests = {
-- gotests doesn't have template named "default" so this plugin uses "default" to set the default template
template = "default",
-- path to a directory containing custom test code templates
template_dir = nil,
-- switch table tests from using slice to map (with test name for the key)
named = false,
},
gotag = {
transform = "snakecase",
-- default tags to add to struct fields
default_tag = "json",
},
iferr = {
-- choose a custom error message
message = nil,
},
}
```
## Features
<!-- markdownlint-disable -->
<details>
<summary>
<b>Install plugin's go deps</b>
@ -227,11 +185,49 @@ require("gopher").setup {
```
</details>
## Configuration
> [!IMPORTANT]
>
> If you need more info look `:h gopher.nvim`
**Take a look at default options (might be a bit outdated, look `:h gopher.nvim-config`)**
```lua
require("gopher").setup {
-- log level, you might consider using DEBUG or TRACE for debugging the plugin
log_level = vim.log.levels.INFO,
-- timeout for running internal commands
timeout = 2000,
commands = {
go = "go",
gomodifytags = "gomodifytags",
gotests = "gotests",
impl = "impl",
iferr = "iferr",
},
gotests = {
-- gotests doesn't have template named "default" so this plugin uses "default" to set the default template
template = "default",
-- path to a directory containing custom test code templates
template_dir = nil,
-- switch table tests from using slice to map (with test name for the key)
named = false,
},
gotag = {
transform = "snakecase",
-- default tags to add to struct fields
default_tag = "json",
},
iferr = {
-- choose a custom error message
message = nil,
},
}
```
## Contributing
PRs are always welcome. See [CONTRIBUTING.md](./CONTRIBUTING.md)
## Thanks
- [go.nvim](https://github.com/ray-x/go.nvim)
- [iferr](https://github.com/koron/iferr)