GithubHelp home page GithubHelp logo

kingedwardi / indentmini.nvim Goto Github PK

View Code? Open in Web Editor NEW

This project forked from nvimdev/indentmini.nvim

0.0 0.0 0.0 32 KB

A minimal and blazing fast indentline plugin

License: MIT License

Lua 100.00%

indentmini.nvim's Introduction

indentmini.nvim

A minimal and blazing fast indentline plugin by using nvim_set_decoration_provide api

Install

  • Lazy.nvim
require('lazy').setup({
    'nvimdev/indentmini.nvim',
    event = 'BufEnter',
    config = function()
        require('indentmini').setup()
    end,
})

Config

  • char -- string type default is โ”‚,
  • exclude -- table type add exclude filetype in this table
config = function()
    require("indentmini").setup({
        char = "|",
        exclude = {
            "erlang",
            "markdown",
        }
    })

    -- Colors are applied automatically based on user-defined highlight groups.
    -- There is no default value.
    vim.cmd.highlight('IndentLine guifg=#123456')
end,

Recipies

By default, if you switch colorschemes your indent colors will be cleared out. To fix this, create an autocommand that will set them again on change. You can also set it up with different colors per-scheme if you'd like.

    config = function()
    -- create a function to set the colors
      local setColors = function()
        local hi_colors = {
          '#AD7021',
          '#8887C3',
          '#738A05',
          '#5F819D',
          '#9E8FB2',
          '#907AA9',
          '#CDA869',
          '#8F9D6A',
        }

        -- you could add some logic here to conditionally set the
        -- highlight colors based on what scheme you're switching to.

        for i, val in pairs(hi_colors) do
          vim.api.nvim_set_hl(0, 'IndentLine' .. i, { fg = val })
        end
      end

      -- set up an autocommand to set the colors when the colorscheme changes
      vim.api.nvim_create_autocmd('ColorScheme', {
        pattern = '*',
        callback = setColors,
      })

      -- don't forget to call it on startup!  
      setColors()

      require('indentmini').setup()
    end,

License MIT

indentmini.nvim's People

Contributors

evetterdrake-ayx avatar glepnir avatar ultra-code avatar xiaoshihou514 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.