Compare commits
No commits in common. "53d9b50e0bbc7b8512ad898604d64926ca16a538" and "00f87db6923c696b7d561a5f817aed0dcf3dc48c" have entirely different histories.
53d9b50e0b
...
00f87db692
@ -82,52 +82,46 @@ return {
|
|||||||
},
|
},
|
||||||
|
|
||||||
config = function()
|
config = function()
|
||||||
local capabilities = vim.tbl_deep_extend(
|
local lspconfig_default_opts = {
|
||||||
'force', vim.lsp.protocol.make_client_capabilities(),
|
|
||||||
require('cmp_nvim_lsp').default_capabilities())
|
|
||||||
|
|
||||||
local server_opts = {
|
|
||||||
clangd = {
|
|
||||||
cmd = { 'clangd', '--completion-style=detailed' },
|
|
||||||
},
|
|
||||||
|
|
||||||
lua_ls = {
|
|
||||||
settings = {
|
|
||||||
Lua = {
|
|
||||||
diagnostics = {
|
|
||||||
disable = { 'missing-fields', },
|
|
||||||
globals = { 'vim', },
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
|
|
||||||
pyright = {
|
|
||||||
settings = {
|
|
||||||
pyright = {
|
|
||||||
disableOrganizeImports = true,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
|
|
||||||
harper_ls = {
|
|
||||||
filetypes = {}, -- Disable for all filetypes
|
|
||||||
},
|
|
||||||
}
|
|
||||||
|
|
||||||
for server, opts in pairs(server_opts) do
|
|
||||||
-- Broadcast full client capabilities to language servers
|
-- Broadcast full client capabilities to language servers
|
||||||
opts.capabilities = vim.tbl_deep_extend(
|
capabilities = vim.tbl_deep_extend(
|
||||||
'force', {}, capabilities, opts.capabilities or {})
|
'force', vim.lsp.protocol.make_client_capabilities(),
|
||||||
vim.lsp.config(server, opts)
|
require('cmp_nvim_lsp').default_capabilities()),
|
||||||
end
|
}
|
||||||
|
|
||||||
require('mason').setup()
|
require('mason').setup()
|
||||||
require('mason-lspconfig').setup({
|
require('mason-lspconfig').setup({
|
||||||
automatic_enable = true,
|
automatic_installation = false,
|
||||||
ensure_installed = ensure_installed,
|
ensure_installed = ensure_installed,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
vim.lsp.config('clangd', {
|
||||||
|
cmd = { 'clangd', '--completion-style=detailed' },
|
||||||
|
})
|
||||||
|
|
||||||
|
vim.lsp.config('lua_ls', {
|
||||||
|
settings = {
|
||||||
|
Lua = {
|
||||||
|
diagnostics = {
|
||||||
|
disable = { 'missing-fields', },
|
||||||
|
globals = { 'vim', },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
vim.lsp.config('pyright', {
|
||||||
|
settings = {
|
||||||
|
pyright = {
|
||||||
|
disableOrganizeImports = true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
vim.lsp.config('harper_ls', {
|
||||||
|
filetypes = {}, -- Disable for all filetypes
|
||||||
|
})
|
||||||
|
|
||||||
-- (Dis|en)able harper-ls when spell mode is (dis|en)enabled.
|
-- (Dis|en)able harper-ls when spell mode is (dis|en)enabled.
|
||||||
vim.api.nvim_create_autocmd("OptionSet", {
|
vim.api.nvim_create_autocmd("OptionSet", {
|
||||||
pattern = "spell",
|
pattern = "spell",
|
||||||
@ -179,7 +173,7 @@ return {
|
|||||||
},
|
},
|
||||||
|
|
||||||
formatting = {
|
formatting = {
|
||||||
format = function(_, vim_item)
|
format = function(entry, vim_item)
|
||||||
-- Set a limit to how wide the completion menu can be
|
-- Set a limit to how wide the completion menu can be
|
||||||
local winwidth = vim.fn.winwidth(vim.api.nvim_get_current_win())
|
local winwidth = vim.fn.winwidth(vim.api.nvim_get_current_win())
|
||||||
local menuwidth = math.min(winwidth / 2, 70)
|
local menuwidth = math.min(winwidth / 2, 70)
|
||||||
@ -197,7 +191,7 @@ return {
|
|||||||
documentation = cmp.config.window.bordered(),
|
documentation = cmp.config.window.bordered(),
|
||||||
},
|
},
|
||||||
|
|
||||||
preselect = 'None', -- Don't preselect completions suggested by source
|
preselect = 'none', -- Don't preselect completions suggested by source
|
||||||
})
|
})
|
||||||
require("cmp_git").setup({})
|
require("cmp_git").setup({})
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user