aboutsummaryrefslogtreecommitdiff
path: root/init.lua
blob: 46b308dee1b293c0005bf2044efa6f4b1b79072a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
-- Clone 'mini.nvim' manually in a way that it gets managed by 'mini.deps'
local path_package = vim.fn.stdpath('data') .. '/site/'
local mini_path = path_package .. 'pack/deps/start/mini.nvim'
if not vim.loop.fs_stat(mini_path) then
  vim.cmd('echo "Installing `mini.nvim`" | redraw')
  local clone_cmd = {
    'git', 'clone', '--filter=blob:none',
    'https://github.com/echasnovski/mini.nvim', mini_path
  }
  vim.fn.system(clone_cmd)
  vim.cmd('packadd mini.nvim | helptags ALL')
  vim.cmd('echo "Installed `mini.nvim`" | redraw')
end


local mini_deps = require('mini.deps')
mini_deps.setup({ path = { package = path_package } })
local add = mini_deps.add

-- deps
add("echasnovski/mini.nvim") -- provide many things
add("neovim/nvim-lspconfig") -- lsp support
add({
    source = "nvim-treesitter/nvim-treesitter",
    hooks = { post_checkout = function() vim.cmd('TSUpdate') end },
})

-- misc
require("mini.statusline").setup()

-- treesitter
local tree_sitter = require("nvim-treesitter.configs")

tree_sitter.setup({
    ensure_installed = {"go"},
    highlight = {enable = true}
})

-- completion
require("mini.completion").setup()

local lsp_config = require("lspconfig")

lsp_config.gopls.setup({
    capabilities = capabilities,
    cmd_env = {GOFLAGS = "-tags=unit,integration,e2e"},
    on_attach = on_attach
})