nvim-ufo cold folding

This commit is contained in:
Ray Elliott 2022-07-24 17:07:15 +01:00
parent b765de7e3f
commit 92b654756e
2 changed files with 15 additions and 0 deletions

View File

@ -10,6 +10,10 @@ call plug#begin('~/.config/nvim/bundle')
" https://github.com/simrat39/rust-tools.nvim " https://github.com/simrat39/rust-tools.nvim
Plug 'simrat39/rust-tools.nvim' Plug 'simrat39/rust-tools.nvim'
" https://github.com/kevinhwang91/
Plug 'kevinhwang91/promise-async'
Plug 'kevinhwang91/nvim-ufo'
" colorscheme (temporary) " colorscheme (temporary)
Plug 'https://github.com/marko-cerovac/material.nvim', { 'branch': 'main' } Plug 'https://github.com/marko-cerovac/material.nvim', { 'branch': 'main' }
let g:material_style = 'lighter' let g:material_style = 'lighter'

View File

@ -113,6 +113,11 @@ end
local capabilities = vim.lsp.protocol.make_client_capabilities() local capabilities = vim.lsp.protocol.make_client_capabilities()
capabilities = require('cmp_nvim_lsp').update_capabilities(capabilities) capabilities = require('cmp_nvim_lsp').update_capabilities(capabilities)
capabilities.textDocument.completion.completionItem.snippetSupport = true capabilities.textDocument.completion.completionItem.snippetSupport = true
-- nvim-ufo
capabilities.textDocument.foldingRange = {
dynamicRegistration = false,
lineFoldingOnly = true
}
for _, lsp in ipairs(servers) do for _, lsp in ipairs(servers) do
nvim_lsp[lsp].setup { nvim_lsp[lsp].setup {
@ -122,6 +127,12 @@ for _, lsp in ipairs(servers) do
} }
end 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, ';') local runtime_path = vim.split(package.path, ';')
table.insert(runtime_path, "lua/?.lua") table.insert(runtime_path, "lua/?.lua")
table.insert(runtime_path, "lua/?/init.lua") table.insert(runtime_path, "lua/?/init.lua")