From 46d493db652ea3ee84e35bd1388a39825978e675 Mon Sep 17 00:00:00 2001 From: Omixxx Date: Tue, 28 Feb 2023 14:36:03 +0100 Subject: [PATCH] update --- init.lua | 4 +-- lua/custom/plugins/folding.lua | 58 ++++++++++++++++------------------ 2 files changed, 29 insertions(+), 33 deletions(-) diff --git a/init.lua b/init.lua index c735eac9..b2702c63 100644 --- a/init.lua +++ b/init.lua @@ -87,6 +87,7 @@ require('lazy').setup({ 'neovim/nvim-lspconfig', dependencies = { + -- Automatically install LSPs to stdpath for neovim 'williamboman/mason.nvim', 'williamboman/mason-lspconfig.nvim', @@ -170,7 +171,6 @@ require('lazy').setup({ end, }, - -- NOTE: Next Step on Your Neovim Journey: Add/Configure additional "plugins" for kickstart -- These are some example plugins that I've included in the kickstart repository. -- Uncomment any of the lines below to enable them. @@ -216,8 +216,6 @@ require('orgmode').setup({ vim.o.hlsearch = true vim.cmd [[highlight Search guifg=#292e42 guibg=#bb9af7]] - - -- Make line numbers default vim.wo.number = true diff --git a/lua/custom/plugins/folding.lua b/lua/custom/plugins/folding.lua index 62d269d6..d9a72882 100644 --- a/lua/custom/plugins/folding.lua +++ b/lua/custom/plugins/folding.lua @@ -1,36 +1,34 @@ return { { 'kevinhwang91/nvim-ufo', - dependecies = 'kevinhwang91/promise-async' }, - config = function() - vim.o.foldcolumn = '1' -- '0' is not bad - vim.o.foldlevel = 99 -- Using ufo provider need a large value, feel free to decrease the value - vim.o.foldlevelstart = 99 - vim.o.foldenable = true - vim.opt.foldlevel = 20 - vim.opt.foldmethod = "expr" - vim.opt.foldexpr = "nvim_treesitter#foldexpr()" + dependecies = { 'kevinhwang91/promise-async' }, + config = function() + vim.o.foldcolumn = "1" -- '0' is not bad + vim.o.foldlevel = 99 -- Using ufo provider need a large value, feel free to decrease the value + vim.o.foldlevelstart = 99 + vim.o.foldenable = true + vim.o.fillchars = [[eob: ,fold: ,foldopen:,foldsep: ,foldclose:]] - -- Using ufo provider need remap `zR` and `zM`. If Neovim is 0.6.1, remap yourself - vim.keymap.set('n', 'zR', require('ufo').openAllFolds) - vim.keymap.set('n', 'zM', require('ufo').closeAllFolds) + -- Using ufo provider need remap `zR` and `zM`. If Neovim is 0.6.1, remap yourself + vim.keymap.set('n', 'zR', require('ufo').openAllFolds) + vim.keymap.set('n', 'zM', require('ufo').closeAllFolds) - -- Option 2: nvim lsp as LSP client - -- Tell the server the capability of foldingRange, - -- Neovim hasn't added foldingRange to default capabilities, users must add it manually - local capabilities = vim.lsp.protocol.make_client_capabilities() - capabilities.textDocument.foldingRange = { - dynamicRegistration = false, - lineFoldingOnly = true - } - local language_servers = require("lspconfig").util.available_servers() -- or list servers manually like {'gopls', 'clangd'} - for _, ls in ipairs(language_servers) do - require('lspconfig')[ls].setup({ - capabilities = capabilities - -- you can add other fields for setting up lsp server in this table - }) - end - require('ufo').setup() - -- - end + -- Option 2: nvim lsp as LSP client + -- Tell the server the capability of foldingRange, + -- Neovim hasn't added foldingRange to default capabilities, users must add it manually + local capabilities = vim.lsp.protocol.make_client_capabilities() + capabilities.textDocument.foldingRange = { + dynamicRegistration = false, + lineFoldingOnly = true + } + local language_servers = require("lspconfig").util.available_servers() -- or list servers manually like {'gopls', 'clangd'} + for _, ls in ipairs(language_servers) do + require('lspconfig')[ls].setup({ + capabilities = capabilities + -- you can add other fields for setting up lsp server in this table + }) + end + require('ufo').setup() + end, + } }