initial commit

This commit is contained in:
2025-08-05 00:16:13 +03:00
commit 4c7269dad4
7 changed files with 124 additions and 0 deletions

51
lua/lsp.lua Normal file
View File

@@ -0,0 +1,51 @@
vim.lsp.enable({ "lua_ls", "denols" })
vim.lsp.config("lua_ls", {
settings = {
Lua = {
runtime = {
version = "LuaJIT",
},
workspace = {
checkThirdParty = false,
library = {
vim.env.VIMRUNTIME,
},
},
format = {
enable = true,
defaultConfig = {
indent_style = "space",
indent_size = "3",
quote_style = "double",
table_separator_style = "comma",
trailing_table_separator = "smart",
call_arg_parentheses = "remove_string_only",
space_after_comment_dash = "true",
space_around_math_operator = "true",
["space_around_math_operator.exponent"] = "false",
align_call_args = "true",
align_continuous_similar_call_args = "true",
line_space_after_local_or_assign_statement = "max(2)",
line_space_after_expression_statement = "max(2)",
line_space_after_comment = "keep",
line_space_around_block = "max(1)",
break_all_list_when_line_exceed = "true",
remove_call_expression_list_finish_comma = "true",
end_statement_with_semicolon = "replace_with_newline",
},
},
},
},
})
vim.api.nvim_create_autocmd("LspAttach", {
callback = function(ev)
local client = assert(vim.lsp.get_client_by_id(ev.data.client_id))
if client:supports_method "textDocument/completion" then
vim.lsp.completion.enable(true, client.id, ev.buf, { autotrigger = true })
end
end,
})