Skip to content

Latest commit

History

47 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

conceal.nvim

A Neovim Plugin which uses Tree-sitter to conceal typical boiler Code

TL;DR

  • Conceals Boiler Code with Tree-sitter
  • Keywords can be disabled (all Keywords are enabled by default)
  • Conceal Chars can be defined (defaults are given)
  • Highlight group can be defined (uses the default groups)

Demo

Installation

Using packer.nvim

use { "Jxstxs/conceal.nvim", requires="nvim-treesitter/nvim-treesitter" }

Requirements

  • Neovim Nightly (v0.9.0-dev-124-gbd7ca10fd, the Version i Use)
  • nvim-treesitter

Usage/Examples

localconceal=require("conceal")
-- should be run before .generate_conceals to use user Configurationconceal.setup({
--[[ ["language"] = { enabled = bool, keywords = { ["keyword"] = { enabled = bool, conceal = string, highlight = string } } } ]]
["lua"] = {
enabled=true,
keywords= {
["local"] = {
enabled=false-- to disable concealing for "local"
},
["return"] = {
conceal="R" -- to set the concealing to "R"
},
["for"] = {
highlight="keyword" -- to set the Highlight group to "@keyword"
}
}
},
["language"] = {
enabled=false-- to disable the whole language
}
})
-- generate the scm queries-- only need to be run when the Configuration changesconceal.generate_conceals()
-- bind a <leader>tc to toggle the concealing levelvim.keymap.set("n", "<leader>tc", function()
require("conceal").toggle_conceal()
end, { silent=true})

Features

  • Conceal Boilerplate Code with a given Highlight group and conceal char
  • Function to toggle the Concealing Level

Contributing

Contributions are always welcome! Just remember to be Kind

License

This Project uses the MIT License, as mentioned here.

About

A Neovim Plugin which uses Treesitter to conceal typical boiler Code

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages