From 7fb0ff04742e9463d2ac6ee134e310cb06cebeab Mon Sep 17 00:00:00 2001 From: Hau Nguyen Date: Thu, 9 Nov 2023 15:32:08 +0700 Subject: [PATCH] chore: improve nvim-ufo --- data/kitty/kitty.conf | 4 ++-- data/nvim/init.lua | 18 ++++++++++++------ 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/data/kitty/kitty.conf b/data/kitty/kitty.conf index beed2f1..9aa43d0 100644 --- a/data/kitty/kitty.conf +++ b/data/kitty/kitty.conf @@ -2,8 +2,8 @@ include mocha.conf # https://sw.kovidgoyal.net/kitty/conf/#fonts -font_family Sudo Var -font_size 18.0 +font_family 0xProto +font_size 14.0 # kitty +list-fonts --psnames modify_font cell_height 120% diff --git a/data/nvim/init.lua b/data/nvim/init.lua index 8119c28..8d5e497 100644 --- a/data/nvim/init.lua +++ b/data/nvim/init.lua @@ -325,11 +325,7 @@ require("lazy").setup({ vim.keymap.set("n", "zR", ufo.openAllFolds) vim.keymap.set("n", "zM", ufo.closeAllFolds) - ufo.setup({ - provider_selector = function(bufnr, filetype, buftype) - return { "treesitter", "indent" } - end, - }) + ufo.setup() end, }, @@ -438,6 +434,13 @@ require("lazy").setup({ config = function() local lspconfig = require("lspconfig") + -- Support nvim-ufo + local capabilities = vim.lsp.protocol.make_client_capabilities() + capabilities.textDocument.foldingRange = { + dynamicRegistration = false, + lineFoldingOnly = true, + } + -- Go -- https://github.com/golang/tools/blob/master/gopls/doc/vim.md -- https://github.com/golang/tools/blob/master/gopls/doc/settings.md @@ -450,11 +453,14 @@ require("lazy").setup({ usePlaceholders = true, }, }, + capabilities = capabilities, }) -- Proto -- https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md#bufls - lspconfig.bufls.setup({}) + lspconfig.bufls.setup({ + capabilities = capabilities, + }) -- General vim.keymap.set("n", "[d", vim.diagnostic.goto_prev)