-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmini.lua
More file actions
70 lines (66 loc) · 1.38 KB
/
mini.lua
File metadata and controls
70 lines (66 loc) · 1.38 KB
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
-- mini config
-- debug
vim.lsp.config("lua_ls", {
name = "lua_ls",
cmd = { "lua-language-server" },
filetypes = { "lua" },
on_attach = function(client, buf)
vim.lsp.inlay_hint.enable(true, { bufnr = buf })
end,
single_file_support = true,
root_markers = { ".git", "Makefile" },
settings = {
Lua = {
diagnostics = {
globals = { "vim", "require" },
},
runtime = {
version = "LuaJIT",
},
hint = {
enable = true, -- necessary
arrayIndex = "Enable",
await = true,
paramName = "All",
paramType = true,
-- semicolon = "All",
setType = true,
},
workspace = {
checkThirdParty = false,
library = vim.api.nvim_get_runtime_file("", true),
},
completion = {
callSnippet = "Replace",
},
},
},
handlers = {
["textDocument/definition"] = function(err, result, ctx, config)
if type(result) == "table" then
result = { result[1] }
end
vim.lsp.handlers["textDocument/definition"](err, result, ctx, config)
end,
},
})
vim.lsp.enable("lua_ls")
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
vim.fn.system({
"git",
"clone",
"--filter=blob:none",
"--branch=stable",
"https://github.com/folke/lazy.nvim.git",
lazypath,
})
end
vim.opt.rtp:prepend(lazypath)
require("lazy").setup({
{
"edte/codelens.nvim",
ft = { "lua", "go", "cpp" },
opts = {},
},
})