Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/vonr/foldcus.nvim
A minimal plugin for NeoVim for folding multiline comments
https://github.com/vonr/foldcus.nvim
neovim neovim-plugin
Last synced: about 1 month ago
JSON representation
A minimal plugin for NeoVim for folding multiline comments
- Host: GitHub
- URL: https://github.com/vonr/foldcus.nvim
- Owner: Vonr
- License: gpl-3.0
- Created: 2022-08-01T13:42:07.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2022-10-08T11:51:34.000Z (about 2 years ago)
- Last Synced: 2024-11-25T01:32:11.682Z (about 1 month ago)
- Topics: neovim, neovim-plugin
- Language: Lua
- Homepage:
- Size: 491 KB
- Stars: 22
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# foldcus.nvim
### foldcus.nvim is a minimal plugin for NeoVim for folding multiline comments
### Installation
Packer
```lua
use {
'Vonr/foldcus.nvim',
requires = { 'nvim-treesitter/nvim-treesitter' }
}
```### Usage
Bind the functions to your preferred bindings and use them in Normal mode.
This plugin does not and will not provide any default mappings or commands for the foreseeable future.
Suggested mappings:
```lua
local foldcus = require('foldcus')
local NS = { noremap = true, silent = true }-- Fold multiline comments longer than or equal to 4 lines
vim.keymap.set('n', 'z;', function() foldcus.fold(4) end, NS)-- Fold multiline comments longer than or equal to the number of lines specified by args
-- e.g. Foldcus 4
vim.api.nvim_create_user_command('Foldcus', function(args) foldcus.fold(tonumber(args.args)) end, { nargs = '*' })-- Delete folds of multiline comments longer than or equal to 4 lines
vim.keymap.set('n', 'z\'', function() foldcus.unfold(4) end, NS)-- Delete folds of multiline comments longer than or equal to the number of lines specified by args
-- e.g. Unfoldcus 4
vim.api.nvim_create_user_command('Unfoldcus', function(args) foldcus.unfold(tonumber(args.args)) end, { nargs = '*' })
```![Usage Gif](https://user-images.githubusercontent.com/24369412/194706028-15cc6dec-ed13-4bf1-8761-e8e92bb09ca2.gif)