add some plugin and complete config
This commit is contained in:
@ -4,56 +4,56 @@ table.insert(runtime_path, "lua/?.lua")
|
||||
table.insert(runtime_path, "lua/?/init.lua")
|
||||
|
||||
local opts = {
|
||||
settings = {
|
||||
Lua = {
|
||||
runtime = {
|
||||
-- Tell the language server which version of Lua you're using (most likely LuaJIT in the case of Neovim)
|
||||
version = "LuaJIT",
|
||||
-- Setup your lua path
|
||||
path = runtime_path,
|
||||
},
|
||||
diagnostics = {
|
||||
-- Get the language server to recognize the `vim` global
|
||||
globals = { "vim" },
|
||||
},
|
||||
workspace = {
|
||||
-- Make the server aware of Neovim runtime files
|
||||
library = vim.api.nvim_get_runtime_file("", true),
|
||||
checkThirdParty = false,
|
||||
},
|
||||
-- Do not send telemetry data containing a randomized but unique identifier
|
||||
telemetry = {
|
||||
enable = false,
|
||||
},
|
||||
},
|
||||
},
|
||||
flags = {
|
||||
debounce_text_changes = 150,
|
||||
},
|
||||
on_attach = function(client, bufnr)
|
||||
-- 禁用格式化功能,交给专门插件插件处理
|
||||
client.server_capabilities.document_formatting = false
|
||||
client.server_capabilities.document_range_formatting = false
|
||||
settings = {
|
||||
Lua = {
|
||||
runtime = {
|
||||
-- Tell the language server which version of Lua you're using (most likely LuaJIT in the case of Neovim)
|
||||
version = "LuaJIT",
|
||||
-- Setup your lua path
|
||||
path = runtime_path,
|
||||
},
|
||||
diagnostics = {
|
||||
-- Get the language server to recognize the `vim` global
|
||||
globals = { "vim" },
|
||||
},
|
||||
workspace = {
|
||||
-- Make the server aware of Neovim runtime files
|
||||
library = vim.api.nvim_get_runtime_file("", true),
|
||||
checkThirdParty = false,
|
||||
},
|
||||
-- Do not send telemetry data containing a randomized but unique identifier
|
||||
telemetry = {
|
||||
enable = false,
|
||||
},
|
||||
},
|
||||
},
|
||||
flags = {
|
||||
debounce_text_changes = 150,
|
||||
},
|
||||
on_attach = function(client, bufnr)
|
||||
-- 禁用格式化功能,交给专门插件插件处理
|
||||
client.server_capabilities.document_formatting = false
|
||||
client.server_capabilities.document_range_formatting = false
|
||||
|
||||
-- local function buf_set_keymap(...)
|
||||
-- vim.api.nvim_buf_set_keymap(bufnr, ...)
|
||||
end
|
||||
-- -- local function buf_set_option(...) vim.api.nvim_buf_set_option(bufnr, ...) end
|
||||
-- -- 绑定快捷键
|
||||
-- require("keybindings").mapLSP(buf_set_keymap)
|
||||
-- end,
|
||||
-- local function buf_set_keymap(...)
|
||||
-- vim.api.nvim_buf_set_keymap(bufnr, ...)
|
||||
end,
|
||||
-- -- local function buf_set_option(...) vim.api.nvim_buf_set_option(bufnr, ...) end
|
||||
-- -- 绑定快捷键
|
||||
-- require("keybindings").mapLSP(buf_set_keymap)
|
||||
-- end,
|
||||
}
|
||||
|
||||
local capabilities = vim.lsp.protocol.make_client_capabilities()
|
||||
capabilities = require('cmp_nvim_lsp').update_capabilities(capabilities)
|
||||
capabilities = require("cmp_nvim_lsp").default_capabilities(capabilities)
|
||||
opts.capabilities = capabilities
|
||||
|
||||
-- 查看目录等信息
|
||||
-- print(vim.inspect(server))
|
||||
|
||||
return {
|
||||
on_setup = function(server)
|
||||
-- opts = require("lua-dev").setup({ lspconfig = opts })
|
||||
server.setup(opts)
|
||||
end,
|
||||
on_setup = function(server)
|
||||
-- opts = require("lua-dev").setup({ lspconfig = opts })
|
||||
server.setup(opts)
|
||||
end,
|
||||
}
|
||||
|
Reference in New Issue
Block a user