Moved lsp configs to seperate files

This commit is contained in:
Kristofers Solo 2023-02-27 13:33:57 +02:00
parent 7794232f37
commit d79bde7f26
5 changed files with 146 additions and 4 deletions

View File

@ -0,0 +1,7 @@
return {
filetypes = {
"sh",
"bash",
"zsh",
},
}

View File

@ -0,0 +1,89 @@
return {
server = {
capabilities = {
offsetEncoding = { "utf-16" },
},
},
extensions = {
-- defaults:
-- Automatically set inlay hints (type hints)
autoSetHints = true,
-- These apply to the default ClangdSetInlayHints command
inlay_hints = {
-- Only show inlay hints for the current line
only_current_line = false,
-- Event which triggers a refersh of the inlay hints.
-- You can make this "CursorMoved" or "CursorMoved,CursorMovedI" but
-- not that this may cause higher CPU usage.
-- This option is only respected when only_current_line and
-- autoSetHints both are true.
only_current_line_autocmd = "CursorHold",
-- whether to show parameter hints with the inlay hints or not
show_parameter_hints = true,
-- prefix for parameter hints
parameter_hints_prefix = "<- ",
-- prefix for all the other hints (type, chaining)
other_hints_prefix = "=> ",
-- whether to align to the length of the longest line in the file
max_len_align = false,
-- padding from the left if max_len_align is true
max_len_align_padding = 1,
-- whether to align to the extreme right or not
right_align = false,
-- padding from the right if right_align is true
right_align_padding = 7,
-- The color of the hints
highlight = "Comment",
-- The highlight group priority for extmark
priority = 100,
},
ast = {
-- -- These are unicode, should be available in any font
-- role_icons = {
-- type = "🄣",
-- declaration = "🄓",
-- expression = "🄔",
-- statement = ";",
-- specifier = "🄢",
-- ["template argument"] = "🆃",
-- },
-- kind_icons = {
-- Compound = "🄲",
-- Recovery = "🅁",
-- TranslationUnit = "🅄",
-- PackExpansion = "🄿",
-- TemplateTypeParm = "🅃",
-- TemplateTemplateParm = "🅃",
-- TemplateParamObject = "🅃",
-- },
-- These require codicons (https://github.com/microsoft/vscode-codicons)
role_icons = {
type = "",
declaration = "",
expression = "",
specifier = "",
statement = "",
["template argument"] = "",
},
kind_icons = {
Compound = "",
Recovery = "",
TranslationUnit = "",
PackExpansion = "",
TemplateTypeParm = "",
TemplateTemplateParm = "",
TemplateParamObject = "",
},
highlights = {
detail = "Comment",
},
},
memory_usage = {
border = "none",
},
symbol_info = {
border = "none",
},
},
}

View File

@ -0,0 +1,13 @@
return {
filetypes = {
"html",
"htmldjango",
"typescriptreact",
"javascriptreact",
"css",
"sass",
"scss",
"less",
"eruby",
},
}

View File

@ -1,18 +1,32 @@
return {
settings = {
Lua = {
runtime = {
-- Tell the language server which version of Lua you're using (most likely LuaJIT in the case of Neovim)
version = "LuaJIT",
},
diagnostics = {
-- Get the language server to recognize the `vim` global
globals = { "vim" },
},
workspace = {
library = {
[vim.fn.expand("$VIMRUNTIME/lua")] = true,
[vim.fn.stdpath("config") .. "/lua"] = true,
},
-- Make the server aware of Neovim runtime files
library = vim.api.nvim_get_runtime_file("", true),
},
-- Do not send telemetry data containing a randomized but unique identifier
telemetry = {
enable = false,
},
root_pattern = {
".stylua.toml",
".luarc.json",
".luarc.jsonc",
".luacheckrc",
"stylua.toml",
"selene.toml",
"selene.yml",
".git",
},
},
},
}

View File

@ -0,0 +1,19 @@
return {
tools = {
on_initialized = function()
vim.cmd([[
autocmd BufEnter,CursorHold,InsertLeave,BufWritePost *.rs silent! lua vim.lsp.codelens.refresh()
]])
end,
},
settings = {
["rust-analyzer"] = {
lens = {
enable = true,
},
checkOnSave = {
command = "clippy",
},
},
},
}