format lspconfig
This commit is contained in:
parent
4ee5f69566
commit
a94b098588
@ -23,23 +23,29 @@ return {
|
||||
vim.api.nvim_set_hl(
|
||||
0,
|
||||
'LspReferenceText',
|
||||
{ bold = true,
|
||||
{
|
||||
bold = true,
|
||||
ctermbg = 'red',
|
||||
bg = '#5a524c' }
|
||||
bg = '#5a524c'
|
||||
}
|
||||
)
|
||||
vim.api.nvim_set_hl(
|
||||
0,
|
||||
'LspReferenceRead',
|
||||
{ bold = true,
|
||||
{
|
||||
bold = true,
|
||||
ctermbg = 'red',
|
||||
bg = 'DarkGreen' }
|
||||
bg = 'DarkGreen'
|
||||
}
|
||||
)
|
||||
vim.api.nvim_set_hl(
|
||||
0,
|
||||
'LspReferenceWrite',
|
||||
{ bold = true,
|
||||
{
|
||||
bold = true,
|
||||
ctermbg = 'red',
|
||||
bg = 'DarkRed' }
|
||||
bg = 'DarkRed'
|
||||
}
|
||||
)
|
||||
local diagnostics = {
|
||||
Error = ' ',
|
||||
@ -50,9 +56,9 @@ return {
|
||||
}
|
||||
local signs = {
|
||||
{ name = 'DiagnosticSignError', text = diagnostics.Error },
|
||||
{ name = 'DiagnosticSignWarn', text = diagnostics.Warning },
|
||||
{ name = 'DiagnosticSignHint', text = diagnostics.Hint },
|
||||
{ name = 'DiagnosticSignInfo', text = diagnostics.Information },
|
||||
{ name = 'DiagnosticSignWarn', text = diagnostics.Warning },
|
||||
{ name = 'DiagnosticSignHint', text = diagnostics.Hint },
|
||||
{ name = 'DiagnosticSignInfo', text = diagnostics.Information },
|
||||
}
|
||||
|
||||
for _, sign in ipairs(signs) do
|
||||
@ -116,14 +122,14 @@ return {
|
||||
-- Set some keybinds conditional on server capabilities
|
||||
if client.server_capabilities.documentFormattingProvider then
|
||||
vim.keymap.set('n', '<space>f', function()
|
||||
vim.lsp.buf.format({ timeout_ms = 10000 })
|
||||
end,
|
||||
vim.lsp.buf.format({ timeout_ms = 10000 })
|
||||
end,
|
||||
{ noremap = true, silent = false, desc = 'Format file', buffer = bufnr })
|
||||
end
|
||||
if client.server_capabilities.documentRangeFormattingProvider then
|
||||
vim.keymap.set('x', '<space>f', function()
|
||||
vim.lsp.buf.format({ timeout_ms = 10000 })
|
||||
end,
|
||||
vim.lsp.buf.format({ timeout_ms = 10000 })
|
||||
end,
|
||||
{ noremap = true, silent = false, desc = 'Format visual', buffer = bufnr })
|
||||
end
|
||||
|
||||
@ -193,7 +199,7 @@ return {
|
||||
return lspconfig.util.find_git_ancestor(fname)
|
||||
end,
|
||||
single_file_support = true, -- suggested
|
||||
on_attach = on_attach -- on_attach is the on_attach function you defined
|
||||
on_attach = on_attach -- on_attach is the on_attach function you defined
|
||||
}
|
||||
}
|
||||
lspconfig.neocmake.setup({})
|
||||
@ -206,7 +212,8 @@ return {
|
||||
server = {
|
||||
capabilities = clangd_capabilities,
|
||||
on_attach = on_attach,
|
||||
cmd = { 'clangd', '--compile-commands-dir=build_nvim', '--query-driver', '/opt/cortex-a78-2022.08-gcc12.1-linux5.15/bin/aarch64-linux-gnu-g*' },
|
||||
cmd = { 'clangd', '--compile-commands-dir=build_nvim', '--query-driver',
|
||||
'/opt/cortex-a78-2022.08-gcc12.1-linux5.15/bin/aarch64-linux-gnu-g*' },
|
||||
root_dir = lspconfig.util.root_pattern(
|
||||
'.clangd',
|
||||
'.clang-tidy',
|
||||
|
Loading…
x
Reference in New Issue
Block a user