-
But How we can use fold and folding utility in lunarvim ? |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments
-
this works for me. -- folding powered by treesitter
-- https://github.com/nvim-treesitter/nvim-treesitter#folding
-- look for foldenable: https://github.com/neovim/neovim/blob/master/src/nvim/options.lua
-- Vim cheatsheet, look for folds keys: https://devhints.io/vim
vim.opt.foldmethod = "expr" -- default is "normal"
vim.opt.foldexpr = "nvim_treesitter#foldexpr()" -- default is ""
vim.opt.foldenable = false -- if this option is true and fold method option is other than normal, every time a document is opened everything will be folded.
|
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
Hi, Is there a plugin necessary for folding to work? I tried adding the 3 lines inside the accepted answer but I couldn't get it to work. I have a YAML file and I want to fold part of some block. I get my cursor on the first line of the block I want to fold, press z and I only see "spelling" inside the menu. |
Beta Was this translation helpful? Give feedback.
-
If you try enabling the lvim.builtin.which_key.setup.plugins.presets.z = true |
Beta Was this translation helpful? Give feedback.
-
Note this gotcha: folding doesn't always work when you initially open the file -- sometimes you get an error Simplest workaround is to run |
Beta Was this translation helpful? Give feedback.
this works for me.