Coder Social home page Coder Social logo

kitty-color-control's Introduction

Current State

This does not work well.

Have a look at my latest attempts of making this work more reliably and across platforms in the osc branch, and join the discussion if you really want this plugin to work or know how to improve it.

Neovim does not make it easy to send OSC to the terminal (without crashing). I have currently abandoned all efforts in favour of just writing my own color scheme. But feel free to fork and/or discuss, I am curious if there is a good solution to this.


Kitty Color Control

This simple plugin is made for usage in neovim’s TUI inside kitty; it does two things:

  • set the cursor’s foreground color according to neovim’s active color scheme
  • increase efficiency by setting the window’s background and foreground colors to the ones of the Normal highlight group, and setting the group’s colors to NONE

Prerequisites

You have to enable remote control. Optionally, also specify an address, if you have configured one, just set kitty_address in your init file, like this:

let g:kitty_address = 'unix:/tmp/hellokitty-$KITTY_PID'

Or with lua:

vim.g.kitty_address = 'unix:/tmp/hellokitty-$KITTY_PID'

Also, make sure to set guicursor, as demonstrated in neovim’s FAQ.

Quirks & Room for Improvement

As this plugin is a scratch to my personal itch, it does not cover all possible scenarios. In its current state it is just good enough.

  • This plugin depends on a POSIX compliant shell, grep, sed and tr.
  • When extracting colors from a set highlight group only guibg and guifg are considered.
  • The whole plugin is one single file. Maybe it should be more? (I don’t know about nvim plugin best practices).
  • There is more inline shell script than I like.
  • As it needs seven external commands and a subshell, all connected by pipe, to restore colors when leaving nvim, there is a noticable delay.
  • This is bearly tested (so far only on Linux, might try macOS later).

If you have an idea for improvemnt please create an issue to discuss it. If you also have the skills to do the improving yourself you are more than welcome to do so by creating a pull request.

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.