feat: add neovim config and tmux
This commit is contained in:
61
home-manager/dotfiles/nvim/lua/custom/configs/lspconfig.lua
Normal file
61
home-manager/dotfiles/nvim/lua/custom/configs/lspconfig.lua
Normal file
@@ -0,0 +1,61 @@
|
||||
local config = require("plugins.configs.lspconfig")
|
||||
local on_attach = config.on_attach
|
||||
local capabilities = config.capabilities
|
||||
local lspconfig = require("lspconfig")
|
||||
|
||||
local function organize_imports()
|
||||
local params = {
|
||||
command = "_typescript.organizeImports",
|
||||
arguments = { vim.api.nvim_buf_get_name(0) },
|
||||
}
|
||||
vim.lsp.buf.execute_command(params)
|
||||
end
|
||||
|
||||
lspconfig.ts_ls.setup {
|
||||
on_attach = on_attach,
|
||||
capabilities = capabilities,
|
||||
init_options = {
|
||||
preferences = {
|
||||
disablesuggestions = true,
|
||||
}
|
||||
},
|
||||
commands = {
|
||||
OrganizeImports = {
|
||||
organize_imports,
|
||||
description = "Organize Imports",
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
lspconfig.terraformls.setup {
|
||||
on_attach = on_attach,
|
||||
capabilities = capabilities,
|
||||
}
|
||||
|
||||
lspconfig.tflint.setup {
|
||||
on_attach = on_attach,
|
||||
capabilities = capabilities,
|
||||
}
|
||||
|
||||
lspconfig.gopls.setup {
|
||||
on_attach = on_attach,
|
||||
capabilities = capabilities,
|
||||
cmd = { "gopls" },
|
||||
filetypes = { "go", "gomod", "gowork", "gotempl" },
|
||||
root_dir = lspconfig.util.root_pattern("go.mod", "go.work"),
|
||||
settings = {
|
||||
gopls = {
|
||||
completeUnimported = true,
|
||||
usePlaceholders = true,
|
||||
analyses = {
|
||||
unusedparams = true,
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
lspconfig.pyright.setup {
|
||||
on_attach = on_attach,
|
||||
capabilities = capabilities,
|
||||
filetypes = { "python" },
|
||||
}
|
||||
Reference in New Issue
Block a user