mirror of
https://github.com/cap153/nvim.git
synced 2026-07-16 22:16:54 +08:00
适配我的termux、架构判断提取为全局变量、重写ufo使用lsp折叠相关配置
This commit is contained in:
parent
08a226d9ee
commit
ca576a6090
7 changed files with 33 additions and 37 deletions
|
|
@ -20,16 +20,14 @@ vim.api.nvim_create_autocmd({
|
|||
vim.schedule(function()
|
||||
PackUtils.load(P, function()
|
||||
-- Option 2: nvim lsp as LSP client
|
||||
local capabilities = vim.lsp.protocol.make_client_capabilities()
|
||||
capabilities.textDocument.foldingRange = {
|
||||
dynamicRegistration = false,
|
||||
lineFoldingOnly = true,
|
||||
}
|
||||
local language_servers = vim.lsp.get_clients() -- or list servers manually like {'gopls', 'clangd'}
|
||||
for _, ls in ipairs(language_servers) do
|
||||
require("lspconfig")[ls].setup({
|
||||
capabilities = capabilities,
|
||||
})
|
||||
local orig_make_client_capabilities = vim.lsp.protocol.make_client_capabilities
|
||||
vim.lsp.protocol.make_client_capabilities = function()
|
||||
local caps = orig_make_client_capabilities()
|
||||
caps.textDocument.foldingRange = {
|
||||
dynamicRegistration = false,
|
||||
lineFoldingOnly = true
|
||||
}
|
||||
return caps
|
||||
end
|
||||
require("ufo").setup({})
|
||||
-- Option 3: treesitter as a main provider instead
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue