mirror of
https://github.com/kogakure/dotfiles.git
synced 2026-02-03 20:25:30 +00:00
feat(nvim): add ufo plugin for better folds
This commit is contained in:
20
nvim/after/plugin/ufo.lua
Normal file
20
nvim/after/plugin/ufo.lua
Normal file
@@ -0,0 +1,20 @@
|
||||
-- https://github.com/kevinhwang91/nvim-ufo
|
||||
local status_ok, ufo = pcall(require, "ufo")
|
||||
if not status_ok then
|
||||
return
|
||||
end
|
||||
|
||||
local keymap = vim.keymap.set
|
||||
local opts = { noremap = true, silent = true }
|
||||
|
||||
-- Options
|
||||
vim.o.foldcolumn = "1"
|
||||
vim.o.foldlevel = 99
|
||||
vim.o.foldlevelstart = 99
|
||||
vim.o.foldenable = true
|
||||
|
||||
ufo.setup()
|
||||
|
||||
-- Keymaps
|
||||
keymap("n", "zR", require("ufo").openAllFolds, opts)
|
||||
keymap("n", "zM", require("ufo").closeAllFolds, opts)
|
||||
@@ -159,6 +159,12 @@ end
|
||||
|
||||
local capabilities = vim.lsp.protocol.make_client_capabilities()
|
||||
|
||||
-- nvim-ufo - better folding
|
||||
capabilities.textDocument.foldingRange = {
|
||||
dynamicRegistration = false,
|
||||
lineFoldingOnly = true,
|
||||
}
|
||||
|
||||
local status_ok, cmp_nvim_lsp = pcall(require, "cmp_nvim_lsp")
|
||||
if not status_ok then
|
||||
return
|
||||
|
||||
@@ -146,6 +146,7 @@ return packer.startup(function(use)
|
||||
use("simrat39/symbols-outline.nvim") -- Symbols Outline
|
||||
use("SmiteshP/nvim-navic") -- Statusline current context
|
||||
use("kevinhwang91/nvim-bqf") -- Better Quickfix
|
||||
use({ "kevinhwang91/nvim-ufo", requires = "kevinhwang91/promise-async" }) -- Better folds
|
||||
|
||||
-- Editing Files
|
||||
use("windwp/nvim-autopairs") -- Autopairs, integrates with both cmp and treesitter
|
||||
|
||||
Reference in New Issue
Block a user