-
Notifications
You must be signed in to change notification settings - Fork 0
/
init.lua
45 lines (35 loc) · 1.14 KB
/
init.lua
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
require('plugins')
-- setup lsp keymaps when attached
local on_attach = function(_, bufnr)
-- show function parameters
vim.keymap.set('n', 'K', vim.lsp.buf.hover, { buffer=bufnr })
end
-- automaticly setup lsp servers
require("mason").setup()
require("mason-lspconfig").setup()
-- setup completion
vim.g.coq_settings = {auto_start= 'shut-up'}
local coq = require('coq')
require("mason-lspconfig").setup_handlers {
-- The first entry (without a key) will be the default handler
-- and will be called for each installed server that doesn't have
-- a dedicated handler.
function (server_name) -- default handler (optional)
require("lspconfig")[server_name].setup {
on_attach = on_attach,
capabilites = coq.lsp_ensure_capabilities(vim.lsp.protocol.make_client_capabilities())
}
end,
}
-- open error list
vim.keymap.set('n', '<space>e', vim.diagnostic.open_float)
vim.opt.ruler = true
vim.opt.hlsearch = true
vim.opt.smarttab = true
vim.opt.autoindent = true
-- tab as 4 spaces
vim.opt.shiftwidth = 4
vim.opt.expandtab = true
-- show line numbers
vim.opt.number = true
vim.opt.relativenumber = true