Giter VIP home page Giter VIP logo

hlchunk.nvim's Introduction

hlchunk.nvim

English | 简体中文

What can this plugin do

similar to indent-blankline, this plugin can highlight the indent line, and highlight the code chunk according to the current cursor position.

What is the advantage of this plugin

  1. more extensible
  2. faster rendering speed (0.04 seconds per thousand renderings, with the window have 50 lines)
  3. more active maintenance (the author is a student with a lot of time to maintain this plugin, haha)

Brief introduction

this plugin now have five parts (future will add more... ^v^)

  1. chunk
  2. indent
  3. line_num
  4. blank
  5. context (experimental)

one picture to understand what these mods do

more details about each mod

NOTE: you can click the picture to get more information about how to configure like this

chunk

image

indent

image image image

line_num

image

blank

image

Requirements

neovim version >= 0.9.0

Installation

Packer

use { "shellRaining/hlchunk.nvim" }

Plug

call plug#begin()
Plug 'shellRaining/hlchunk.nvim'
call plug#end()

lua << EOF
require("hlchunk").setup({})
EOF

Lazy

{
  "shellRaining/hlchunk.nvim",
  event = { "UIEnter" },
  config = function()
    require("hlchunk").setup({})
  end
},

Setup

The script comes with the following defaults:

Click this Dropdown to see defaults setttings.
{
    chunk = {
        enable = true,
        notify = true,
        use_treesitter = true,
        -- details about support_filetypes and exclude_filetypes in https://github.com/shellRaining/hlchunk.nvim/blob/main/lua/hlchunk/utils/filetype.lua
        support_filetypes = ft.support_filetypes,
        exclude_filetypes = ft.exclude_filetypes,
        chars = {
            horizontal_line = "",
            vertical_line = "",
            left_top = "",
            left_bottom = "",
            right_arrow = ">",
        },
        style = {
            { fg = "#806d9c" },
            { fg = "#c21f30" }, -- this fg is used to highlight wrong chunk
        },
        textobject = "",
        max_file_size = 1024 * 1024,
        error_sign = true,
    },

    indent = {
        enable = true,
        use_treesitter = false,
        chars = {
            "",
        },
        style = {
            { fg = vim.fn.synIDattr(vim.fn.synIDtrans(vim.fn.hlID("Whitespace")), "fg", "gui") }
        },
    },

    line_num = {
        enable = true,
        use_treesitter = false,
        style = "#806d9c",
    },

    blank = {
        enable = true,
        chars = {
            "",
        },
        style = {
            vim.fn.synIDattr(vim.fn.synIDtrans(vim.fn.hlID("Whitespace")), "fg", "gui"),
        },
    },
}


setup example:

require('hlchunk').setup({
    indent = {
        chars = { "", "¦", "", "", }, -- more code can be found in https://unicodeplus.com/

        style = {
            "#8B00FF",
        },
    },
    blank = {
        enable = false,
    }
})

command

Click this Dropdown to see Available Commands

this plugin provides some commands to switch plugin status, which are listed below

  • EnableHL
  • DisableHL

the two commands are used to switch the whole plugin status, when use DisableHL, include hl_chunk and hl_indent will be disable

  • DisableHLChunk
  • EnableHLChunk

the two will control hl_chunk

  • DisableHLIndent
  • EnableHLIndent

the two will control hl_indent

  • DisableHLLineNum
  • EnableHLLineNum

the two will control hl_line_num

  • DisableHLBlank
  • EnableHLBlank

the two will control hl_blank

hlchunk.nvim's People

Contributors

shellraining avatar nyngwang avatar xiao-m0 avatar miversen33 avatar juanzoran avatar crivotz avatar pauldesmondparker avatar itepechi avatar kang8 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.