Coder Social home page Coder Social logo

conceal.nvim's Introduction

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

local conceal = require("conceal")

-- should be run before .generate_conceals to use user Configuration
conceal.setup({
    --[[ ["language"] = {
        enabled = bool,
        ["keyword"] = {
            enabled     = bool,
            conceal     = string,
            highlight   = string
        }
    } ]]
    ["lua"] = {
      ["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 changes
conceal.generate_conceals()

-- bind a <leader>tc to toggle the concealing level
vim.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.

conceal.nvim's People

Contributors

jxstxs avatar amar1729 avatar leaxoy avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.