chore: update readme
This commit is contained in:
parent
9bf72afc63
commit
b7ce5d1f35
1 changed files with 50 additions and 54 deletions
104
README.md
104
README.md
|
|
@ -4,19 +4,21 @@
|
||||||
|
|
||||||
Minimalistic plugin for Go development in Neovim written in Lua.
|
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))
|
## Install (using [lazy.nvim](https://github.com/folke/lazy.nvim))
|
||||||
|
|
||||||
Requirements:
|
Requirements:
|
||||||
|
|
||||||
- **Neovim 0.10** or later
|
- **Neovim 0.10** or later
|
||||||
- Treesitter `go` parser(`:TSInstall go` if you use [nvim-treesitter](https://github.com/nvim-treesitter/nvim-treesitter))
|
- 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 (tested on 1.23)
|
- [Go](https://github.com/golang/go) installed
|
||||||
|
|
||||||
```lua
|
```lua
|
||||||
|
-- NOTE: this plugin is already lazy-loaded, it adds only about 1ms of load
|
||||||
|
-- time to your config
|
||||||
{
|
{
|
||||||
"olexsmir/gopher.nvim",
|
"olexsmir/gopher.nvim",
|
||||||
ft = "go",
|
ft = "go",
|
||||||
|
|
@ -25,58 +27,14 @@ Requirements:
|
||||||
build = function()
|
build = function()
|
||||||
vim.cmd.GoInstallDeps()
|
vim.cmd.GoInstallDeps()
|
||||||
end,
|
end,
|
||||||
|
---@module "gopher"
|
||||||
---@type gopher.Config
|
---@type gopher.Config
|
||||||
opts = {},
|
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
|
## Features
|
||||||
|
|
||||||
<!-- markdownlint-disable -->
|
|
||||||
|
|
||||||
<details>
|
<details>
|
||||||
<summary>
|
<summary>
|
||||||
<b>Install plugin's go deps</b>
|
<b>Install plugin's go deps</b>
|
||||||
|
|
@ -227,11 +185,49 @@ require("gopher").setup {
|
||||||
```
|
```
|
||||||
</details>
|
</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
|
## Contributing
|
||||||
|
|
||||||
PRs are always welcome. See [CONTRIBUTING.md](./CONTRIBUTING.md)
|
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)
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue