[mirror] Make your go dev experience better github.com/olexsmir/gopher.nvim
neovim golang
1--- *gopher.nvim* Enhance your golang experience 2--- 3--- MIT License Copyright (c) 2025 Oleksandr Smirnov 4--- 5--- ============================================================================== 6--- 7--- gopher.nvim is a minimalistic plugin for Go development in Neovim written in Lua. 8--- It's not an LSP tool, the main goal of this plugin is add go tooling support in Neovim. 9--- 10--- Table of Contents 11---@toc 12 13local log = require "gopher._utils.log" 14local tags = require "gopher.struct_tags" 15local tests = require "gopher.gotests" 16local gocmd = require("gopher._utils.gocmd").run 17local gopher = {} 18 19---@toc_entry Setup 20---@tag gopher.nvim-setup() 21---@text Setup function. This method simply merges default config with opts table. 22--- You can read more about configuration at |gopher.nvim-config| 23--- Calling this function is optional, if you ok with default settings. 24--- See |gopher.nvim.config| 25--- 26---@usage >lua 27--- require("gopher").setup {} -- use default config or replace {} with your own 28--- < 29---@param user_config gopher.Config See |gopher.nvim-config| 30gopher.setup = function(user_config) 31 log.debug "setting up config" 32 require("gopher.config").setup(user_config) 33 log.debug(vim.inspect(user_config)) 34end 35 36---@toc_entry Install dependencies 37---@tag gopher.nvim-dependencies 38---@text Gopher.nvim implements most of its features using third-party tools. 39--- To install these tools, you can run `:GoInstallDeps` command 40--- or call `require("gopher").install_deps()` if you want to use lua api. 41--- By default dependencies will be installed asynchronously, 42--- to install them synchronously pass `{sync = true}` as an argument. 43gopher.install_deps = require("gopher.installer").install_deps 44 45gopher.impl = require("gopher.impl").impl 46gopher.iferr = require("gopher.iferr").iferr 47gopher.comment = require("gopher.comment").comment 48 49gopher.tags = { 50 add = tags.add, 51 rm = tags.remove, 52 clear = tags.clear, 53} 54 55gopher.test = { 56 add = tests.func_test, 57 exported = tests.all_exported_tests, 58 all = tests.all_tests, 59} 60 61gopher.get = function(...) 62 gocmd("get", ...) 63end 64 65gopher.mod = function(...) 66 gocmd("mod", ...) 67end 68 69gopher.generate = function(...) 70 gocmd("generate", ...) 71end 72 73gopher.work = function(...) 74 gocmd("work", ...) 75end 76 77return gopher