Git Product home page Git Product logo

kak-rainbow's Introduction

kak-rainbow

A cursor-centered rainbow highlighter for kakoune.

Handles different styles of enclosing characters independently, so adding parens doesn't change the colors of braces, etc. Fast enough to use in idle hooks, on my machine highlighting an 80 column by 80 line block of solid parentheses took ~70ms to compute.

kak-rainbow demo

Installation

Install by putting rainbow.kak into your autoload folder (by default, ~/.config/kak/autoload/).

You'll also likely want to add 'rainbow-enable-window' to run when certain filetypes are opened by adding something like this to kakrc:

hook global WinSetOption filetype=(rust|python|c|c++|scheme|lisp|clojure|javascript|json) %{
        rainbow-enable-window
}

Configuration

use set-option rainbow_colors <space separated list of colors> to customize colors. The first one is the one the cursor is currently on, surrounding levels get the next color in the list, surrounded ones get the previous (wrapping if necessary).

Limitations

Because this is language-agnostic, < and > aren't supported (knowing when to ignore their use as comparisons requires parsing). For the same reason, comments are highlighted just like anything else. So far this hasn't been an issue

Similar projects

These other rainbow highlighters have somewhat different behaviors, and were very helpful in learning how to construct this one.

kak-rainbow's People

Contributors

bodhizafa avatar

Stargazers

Jordan Yee avatar  avatar Rosario Pulella avatar Dylan DiGeronimo avatar Masanori Ogino avatar Nebojša Stričević avatar Chris Waldon avatar John Wesley Harris avatar Walter C avatar SeerLite avatar  avatar Josef Pospíšil avatar  avatar Andy Shevchenko avatar  avatar

Watchers

 avatar James Cloos avatar

kak-rainbow's Issues

Do not highlight siblings

Is it possible to highlight only the parent levels?
E.g. given the following snippet, with the cursor indicated with |, it would only highlight the second line, but not the first line.

(((())))
((((|))))

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.