init
This commit is contained in:
commit
b3dba4542f
44 changed files with 1596 additions and 0 deletions
43
home/.config/nvim/lua/lsp.lua
Normal file
43
home/.config/nvim/lua/lsp.lua
Normal file
|
@ -0,0 +1,43 @@
|
|||
local lspconfig = require("lspconfig")
|
||||
|
||||
-- Swift LSP
|
||||
lspconfig.sourcekit.setup {}
|
||||
|
||||
-- Go LSP
|
||||
lspconfig.gopls.setup {
|
||||
cmd = { "gopls" },
|
||||
filetypes = { "go", "gomod" },
|
||||
root_dir = lspconfig.util.root_pattern("go.mod", ".git"),
|
||||
settings = {
|
||||
gopls = {
|
||||
analyses = { unusedparams = true },
|
||||
staticcheck = true,
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
-- Completion
|
||||
local cmp = require("cmp")
|
||||
cmp.setup({
|
||||
snippet = {
|
||||
expand = function(args)
|
||||
vim.fn["vsnip#anonymous"](args.body)
|
||||
end,
|
||||
},
|
||||
mapping = cmp.mapping.preset.insert({
|
||||
["<Tab>"] = cmp.mapping.select_next_item(),
|
||||
["<S-Tab>"] = cmp.mapping.select_prev_item(),
|
||||
["<CR>"] = cmp.mapping.confirm({ select = true }),
|
||||
}),
|
||||
sources = cmp.config.sources({
|
||||
{ name = "nvim_lsp" },
|
||||
{ name = "vsnip" },
|
||||
}, {
|
||||
{ name = "buffer" },
|
||||
{ name = "path" },
|
||||
})
|
||||
})
|
||||
|
||||
-- Syntastic config
|
||||
vim.g.syntastic_swift_checkers = { 'swiftlint', 'swiftpm' }
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue