1 files changed,
50 insertions(+),
54 deletions(-)
Author:
Oleksandr Smirnov
olexsmir@gmail.com
Committed at:
2025-08-30 16:59:50 +0300
Change ID:
vuuqouyuovpwwrmywquqzoytvnwmvnpr
Parent:
9bf72af
M
README.md
@@ -4,19 +4,21 @@ [](https://stand-with-ukraine.pp.ua)
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,57 +27,13 @@ -- (optional) will update plugin's deps on every update
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>@@ -227,11 +185,49 @@ :GoIfErr
``` </details> -## Contributing +## Configuration -PRs are always welcome. See [CONTRIBUTING.md](./CONTRIBUTING.md) +> [!IMPORTANT] +> +> If you need more info look `:h gopher.nvim` -## Thanks +**Take a look at default options (might be a bit outdated, look `:h gopher.nvim-config`)** -- [go.nvim](https://github.com/ray-x/go.nvim) -- [iferr](https://github.com/koron/iferr) +```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)