+1
-4
README.md
+1
-4
README.md
···
13
13
Requirements:
14
14
15
15
- **Neovim 0.10** or later
16
-
- Treesitter `go` parser(`:TSInstall go`)
16
+
- Treesitter `go` parser(`:TSInstall go` if you use [nvim-treesitter](https://github.com/nvim-treesitter/nvim-treesitter))
17
17
- [Go](https://github.com/golang/go) installed (tested on 1.23)
18
18
19
19
```lua
···
21
21
"olexsmir/gopher.nvim",
22
22
ft = "go",
23
23
-- branch = "develop"
24
-
dependencies = {
25
-
"nvim-treesitter/nvim-treesitter",
26
-
},
27
24
-- (optional) will update plugin's deps on every update
28
25
build = function()
29
26
vim.cmd.GoInstallDeps()
+2
-21
lua/gopher/health.lua
+2
-21
lua/gopher/health.lua
···
2
2
local cmd = require("gopher.config").commands
3
3
4
4
local deps = {
5
-
plugin = {
6
-
{ lib = "nvim-treesitter", msg = "required for everything in gopher.nvim" },
7
-
},
8
5
bin = {
9
6
{
10
7
bin = cmd.go,
11
-
msg = "required for `:GoGet`, `:GoMod`, `:GoGenerate`, `:GoWork`, `:GoInstallDeps`",
8
+
msg = "required for `:GoGet`, `:GoMod`, `:GoGenerate`, `:GoWork`, `:GoInstallDeps`, `:GoInstallDepsSync`",
12
9
optional = false,
13
10
},
14
11
{ bin = cmd.gomodifytags, msg = "required for `:GoTagAdd`, `:GoTagRm`", optional = true },
···
21
18
},
22
19
},
23
20
treesitter = {
24
-
{ parser = "go", msg = "required for `gopher.nvim`" },
21
+
{ parser = "go", msg = "required for most of the parts of `gopher.nvim`" },
25
22
},
26
23
}
27
24
28
-
---@param module string
29
-
---@return boolean
30
-
local function is_lualib_found(module)
31
-
local is_found, _ = pcall(require, module)
32
-
return is_found
33
-
end
34
-
35
25
---@param bin string
36
26
---@return boolean
37
27
local function is_binary_found(bin)
···
46
36
end
47
37
48
38
function health.check()
49
-
vim.health.start "required plugins"
50
-
for _, plugin in ipairs(deps.plugin) do
51
-
if is_lualib_found(plugin.lib) then
52
-
vim.health.ok(plugin.lib .. " installed")
53
-
else
54
-
vim.health.error(plugin.lib .. " not found, " .. plugin.msg)
55
-
end
56
-
end
57
-
58
39
vim.health.start "required binaries"
59
40
vim.health.info "all those binaries can be installed by `:GoInstallDeps`"
60
41
for _, bin in ipairs(deps.bin) do