2 Commits

  1. 3
      after/plugin/lsp.lua
  2. 17
      after/plugin/ufo.lua
  3. 2
      lua/junikim/packer.lua

3
after/plugin/lsp.lua

@ -3,9 +3,6 @@
local lsp = require('lsp-zero') local lsp = require('lsp-zero')
lsp.preset('recommended') lsp.preset('recommended')
lsp.nvim_workspace()
local cmp = require('cmp') local cmp = require('cmp')
local cmp_select = { behavior = cmp.SelectBehavior.Select } local cmp_select = { behavior = cmp.SelectBehavior.Select }
local cmp_mappings = lsp.defaults.cmp_mappings({ local cmp_mappings = lsp.defaults.cmp_mappings({

17
after/plugin/ufo.lua

@ -0,0 +1,17 @@
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
-- 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 3: treesitter as a main provider instead
-- Only depend on `nvim-treesitter/queries/filetype/folds.scm`,
-- performance and stability are better than `foldmethod=nvim_treesitter#foldexpr()`
require('ufo').setup({
provider_selector = function(bufnr, filetype, buftype)
return { 'treesitter', 'indent' }
end
})

2
lua/junikim/packer.lua

@ -80,4 +80,6 @@ return require('packer').startup(function(use)
require 'colorizer'.setup() require 'colorizer'.setup()
end } end }
use { 'kevinhwang91/nvim-ufo', requires = 'kevinhwang91/promise-async' }
end) end)
Loading…
Cancel
Save