From c70f5660e86a235e4763f3a4f2f906ef12d0c949 Mon Sep 17 00:00:00 2001 From: ray Date: Tue, 27 Sep 2022 09:39:29 +0100 Subject: [PATCH] fix nvim.ufo config --- lua/init-lsp.lua | 11 ----------- lua/init-plugins.lua | 8 ++++++++ 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/lua/init-lsp.lua b/lua/init-lsp.lua index c90476a..2dcae64 100644 --- a/lua/init-lsp.lua +++ b/lua/init-lsp.lua @@ -115,11 +115,6 @@ end local capabilities = vim.lsp.protocol.make_client_capabilities() capabilities = require('cmp_nvim_lsp').update_capabilities(capabilities) capabilities.textDocument.completion.completionItem.snippetSupport = true --- nvim-ufo -capabilities.textDocument.foldingRange = { - dynamicRegistration = false, - lineFoldingOnly = true -} for _, lsp in ipairs(servers) do nvim_lsp[lsp].setup { @@ -129,12 +124,6 @@ for _, lsp in ipairs(servers) do } end --- nvim-ufo -require('ufo').setup() -vim.keymap.set('n', 'gH', function() - local winid = require('ufo').peekFoldedLinesUnderCursor() -end) - local runtime_path = vim.split(package.path, ';') table.insert(runtime_path, "lua/?.lua") table.insert(runtime_path, "lua/?/init.lua") diff --git a/lua/init-plugins.lua b/lua/init-plugins.lua index 40a6538..fdbc417 100644 --- a/lua/init-plugins.lua +++ b/lua/init-plugins.lua @@ -11,3 +11,11 @@ require("cmp").setup({ -- nvim-ts-autotag require'nvim-treesitter.configs'.setup {autotag = {enable = true}} ------ + +-- nvim-ufo +require('ufo').setup({ + provider_selector = function(bufnr, filetype, buftype) + return {'treesitter', 'indent'} + end +}) +------