Skip to content

forked from hlchunk.nvim and removed indent. only chunk and context, simple and faster.

License

Notifications You must be signed in to change notification settings

Mr-LLLLL/cool-chunk.nvim

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

What can this plugin do

Forked from hlchunk. Indent has been removed (but if you want to use it, try indent-blankline). Chunk, context and line_num have been retained. It is simple, fast and cool.

Show Gif

Screencasts

Brief introduction

This plugin now has some functions, which include:

  1. chunk
  2. line_num (support highlight context and chunk range)
  3. context
  4. textobject (support context textobject and chunk textobject)
  5. jump (support jump to context start and end)

Requirements

neovim version >= 0.9.0

Installation

With Lazy

{
    "Mr-LLLLL/cool-chunk.nvim",
    event = { "CursorHold", "CursorHoldI" },
    dependencies = {
        "nvim-treesitter/nvim-treesitter",
    },
    config = function()
        require("cool-chunk").setup({})
    end
},

Setup

The script comes with the following defaults:

Click this Dropdown to see default setttings.
{
    chunk = {
        notify = true,
        support_filetypes = ft.support_filetypes, -- ft = require("cool-chunk.utils.filetype").support_filetypes
        exclude_filetypes = ft.exclude_filetypes,
        hl_group = {
            chunk = "CursorLineNr",
            error = "Error",
        },
        chars = {
            horizontal_line = "",
            vertical_line = "",
            left_top = "",
            left_bottom = "",
            left_arrow = "<",
            bottom_arrow = "v",
            right_arrow = ">",
        },
        textobject = "ah",
        animate_duration = 200, -- if don't want to animation, set to 0.
        fire_event = { "CursorHold", "CursorHoldI" },
    },
    context = {
        notify = true,
        chars = {
            "",
        },
        hl_group = {
            context = "LineNr",
        },
        exclude_filetypes = ft.exclude_filetypes,
        support_filetypes = ft.support_filetypes,
        textobject = "ih",
        jump_support_filetypes = { "lua", "python" },
        jump_start = "[{",
        jump_end = "]}",
        fire_event = { "CursorHold", "CursorHoldI" },
    },
    line_num = {
        notify = true,
        hl_group = {
            chunk = "CursorLineNr",
            context = "LineNr",
            error = "Error",
        },
        support_filetypes = ft.support_filetypes,
        exclude_filetypes = ft.exclude_filetypes,
        fire_event = { "CursorHold", "CursorHoldI" },
    }
}

command

Click this Dropdown to see Available Commands

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

  • EnableCC
  • DisableCC
  • EnableCCChunk
  • DisableCCChunk
  • EnableCCContext
  • DisableCCContext
  • EnableCCLineNum
  • DisableCCLineNum

About

forked from hlchunk.nvim and removed indent. only chunk and context, simple and faster.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages

  • Lua 100.0%