Bring RGB to life in Neovim

Overview

Bring RGB to life in Neovim

Change your RGB devices' color depending on Neovim's mode.
Fast and asynchronous plugin to live your vim-life to the fullest.

Why?

  • 🌍 Universal: works with all devices supported by OpenRGB
  • 🚀 Fast: snappy and completely asynchronous
  • 💎 Reliable: multiple vim instances are supported
  • ❤️ Flexible: each mode's colors are customizable

Installation

Make sure to have the following plugin in your vimrc:

Plug 'antoinemadec/openrgb.nvim', {'do': 'UpdateRemotePlugins'}

Install:

Setup

Make sure the OpenRGB server is running:

openrgb --server

And add the folowing in your vimrc :

  • if you don't use any statusline plugin, add this in your vimrc:
function OpenRGBStatuslineFunc()
  if g:openrgb_is_ready
    call OpenRGBChangeColorFromMode(mode())
  endif
  return ''
endfunction

if empty(&statusline)
  set statusline=%<%f\ %h%m%r%=%-14.(%l,%c%V%)\ %P
endif
set statusline+=%{OpenRGBStatuslineFunc()}

autocmd FocusGained * call OpenRGBChangeColorFromMode(mode(), 1)
  • if you use lightline, add this in your vimrc:
" default lightline values
let g:lightline = {}
let g:lightline.active = {
      \ 'left': [ [ 'mode', 'paste' ],
      \           [ 'readonly', 'filename', 'modified' ] ],
      \ 'right': [ [ 'lineinfo' ],
      \            [ 'percent' ],
      \            [ 'fileformat', 'fileencoding', 'filetype' ] ] }
let g:lightline.inactive = {
      \ 'left': [ [ 'filename' ] ],
      \ 'right': [ [ 'lineinfo' ],
      \            [ 'percent' ] ] }
let g:lightline.tabline = {
      \ 'left': [ [ 'tabs' ] ],
      \ 'right': [ [ 'close' ] ] }

" openrgb modifications
let g:lightline.active.left[0][0] = 'mymode'
let g:lightline.component_function = {'mymode': 'MyMode'}
function MyMode() abort
  if g:openrgb_is_ready
    call OpenRGBChangeColorFromMode(mode())
  endif
  return lightline#mode()
endfunction
autocmd FocusGained * call OpenRGBChangeColorFromMode(mode(), 1)

Customization

If you don't like the default RGB colors, here is how to change it:

" default dict
let s:default_dict = {
      \ 'main_color': '#000000',
      \ 'led_names': [[]],
      \ 'led_colors': []
      \ }
let g:openrgb_mode_dict = {}
for mode in ['n', 'v', 'V', '', 'i', 'R', 'c', 'r', 't', 'default']
  let g:openrgb_mode_dict[mode] = copy(s:default_dict)
endfor

" customize dict:
"     - if dict[mode] is not found, it falls back to dict['default']
"     - each group of keys in 'led_names' are lit using the same color
"     - look at 'g:openrgb_led_names' to see the available 'led_names'
"     - if empty(led_colors):
"           colors are assigned automatically
"       else:
"           led_colors are used
" -- normal
let g:openrgb_mode_dict['n']['main_color'] = '#ffff00'
let g:openrgb_mode_dict['n']['led_names'] = [
      \ ['Key: Right Arrow', 'Key: Left Arrow', 'Key: Up Arrow', 'Key: Down Arrow'],
      \ ['Key: H', 'Key: J', 'Key: K', 'Key: L'],
      \ ['Key: Left Control', 'Key: Left Windows', 'Key: Left Alt', 'Key: Left Shift'],
      \ ['Key: Insert', 'Key: Delete', 'Key: Home', 'Key: End', 'Key: Page Up', 'Key: Page Down'],
      \ ['Key: F1', 'Key: F2', 'Key: F3', 'Key: F4'],
      \ ['Key: F5', 'Key: F6', 'Key: F7', 'Key: F8'],
      \ ['Key: F9', 'Key: F10', 'Key: F11', 'Key: F12'],
      \ ['Key: 0', 'Key: 1', 'Key: 2', 'Key: 3', 'Key: 4', 'Key: 5', 'Key: 6', 'Key: 7', 'Key: 8', 'Key: 9'],
      \ ]
" -- insert
let g:openrgb_mode_dict['i']['main_color'] = '#007020'
let g:openrgb_mode_dict['i']['led_names'] = [
      \ ['Key: F', 'Key: R'],
      \ ['Key: A', 'Key: N'],
      \ ['Key: C', 'Key: E'],
      \ ]
let g:openrgb_mode_dict['i']['led_colors'] = [
      \ '#0000ff',
      \ '#ffffff',
      \ '#ff0000'
      \ ]

Here is the API if you want to trigger color changes manually:

" calling OpenRGBChangeColor() using 'g:openrgb_mode_dict' info
OpenRGBChangeColorFromMode(mode, force)
" calling OpenRGBChangeColor() directly
call OpenRGBChangeColor(main_color, led_names, led_colors, force)

License

MIT

Owner
Antoine
Verification engineer. Music enthusiast. Vim lover.
Antoine
Source Code for 'Practical Python Projects' (video) by Sunil Gupta

Apress Source Code This repository accompanies %Practical Python Projects by Sunil Gupta (Apress, 2021). Download the files as a zip using the green b

Apress 2 Jun 01, 2022
DeltaPy - Tabular Data Augmentation (by @firmai)

DeltaPy⁠⁠ — Tabular Data Augmentation & Feature Engineering Finance Quant Machine Learning ML-Quant.com - Automated Research Repository Introduction T

Derek Snow 470 Dec 28, 2022
Count the number of lines of code in a directory, minus the irrelevant stuff

countloc Simple library to count the lines of code in a directory (excluding stuff like node_modules) Simply just run: countloc node_modules args to

Anish 4 Feb 14, 2022
Fully typesafe, Rust-like Result and Option types for Python

safetywrap Fully typesafe, Rust-inspired wrapper types for Python values Summary This library provides two main wrappers: Result and Option. These typ

Matthew Planchard 32 Dec 25, 2022
[Unofficial] Python PEP in EPUB format

PEPs in EPUB format This is a unofficial repository where I stock all valid PEPs in the EPUB format. Repository Cloning git clone --recursive Mickaël Schoentgen 9 Oct 12, 2022

An introduction course for Python provided by VetsInTech

Introduction to Python This is an introduction course for Python provided by VetsInTech. For every "boot camp", there usually is a pre-req, but becaus

Vets In Tech 2 Dec 02, 2021
Que es S4K Builder?, Fácil un constructor de tokens grabbers con muchas opciones, como BTC Miner, Clipper, shutdown PC, Y más! Disfrute el proyecto. <3

S4K Builder Este script Python 3 de código abierto es un constructor del muy popular registrador de tokens que está en [mi GitHub] (https://github.com

SadicX 1 Oct 22, 2021
Data-science-on-gcp - Source code accompanying book: Data Science on the Google Cloud Platform, Valliappa Lakshmanan, O'Reilly 2017

data-science-on-gcp Source code accompanying book: Data Science on the Google Cloud Platform, 2nd Edition Valliappa Lakshmanan O'Reilly, Jan 2022 Bran

Google Cloud Platform 1.2k Dec 28, 2022
Generate modern Python clients from OpenAPI

openapi-python-client Generate modern Python clients from OpenAPI 3.x documents. This generator does not support OpenAPI 2.x FKA Swagger. If you need

555 Jan 02, 2023
Preview title and other information about links sent to chats.

Link Preview A small plugin for Nicotine+ to display preview information like title and description about links sent in chats. Plugin created with Nic

Nick 0 Sep 05, 2021
Obmovies - A short guide on setting up the system and environment dependencies required for ob's Movies database

Obmovies - A short guide on setting up the system and environment dependencies required for ob's Movies database

1 Jan 04, 2022
Repository for learning Python (Python Tutorial)

Repository for learning Python (Python Tutorial) Languages and Tools 🧰 Overview 📑 Repository for learning Python (Python Tutorial) Languages and Too

Swiftman 2 Aug 22, 2022
Some of the best ways and practices of doing code in Python!

Pythonicness ❤ This repository contains some of the best ways and practices of doing code in Python! Features Properly formatted codes (PEP 8) for bet

Samyak Jain 2 Jan 15, 2022
Some code that takes a pipe-separated input and converts that into a table!

tablemaker A program that takes an input: a | b | c # With comments as well. e | f | g h | i |jk And converts it to a table: ┌───┬───┬────┐ │ a │ b │

CodingSoda 2 Aug 30, 2022
Data science Python notebooks: Deep learning (TensorFlow, Theano, Caffe, Keras), scikit-learn, Kaggle, big data (Spark, Hadoop MapReduce, HDFS), matplotlib, pandas, NumPy, SciPy, Python essentials, AWS, and various command lines.

Data science Python notebooks: Deep learning (TensorFlow, Theano, Caffe, Keras), scikit-learn, Kaggle, big data (Spark, Hadoop MapReduce, HDFS), matplotlib, pandas, NumPy, SciPy, Python essentials, A

Donne Martin 24.5k Jan 09, 2023
Sphinx theme for readthedocs.org

Read the Docs Sphinx Theme This Sphinx theme was designed to provide a great reader experience for documentation users on both desktop and mobile devi

Read the Docs 4.3k Dec 31, 2022
Course materials and handouts for #100DaysOfCode in Python course

#100DaysOfCode with Python course Course details page: talkpython.fm/100days Course Summary #100DaysOfCode in Python is your perfect companion to take

Talk Python 1.9k Dec 31, 2022
An open source utility for creating publication quality LaTex figures generated from OpenFOAM data files.

foamTEX An open source utility for creating publication quality LaTex figures generated from OpenFOAM data files. Explore the docs » Report Bug · Requ

1 Dec 19, 2021
A curated list of awesome tools for Sphinx Python Documentation Generator

Awesome Sphinx (Python Documentation Generator) A curated list of awesome extra libraries, software and resources for Sphinx (Python Documentation Gen

Hyunjun Kim 831 Dec 27, 2022
Projeto em Python colaborativo para o Bootcamp de Dados do Itaú em parceria com a Lets Code

🧾 lets-code-todo-list por Henrique V. Domingues e Josué Montalvão Projeto em Python colaborativo para o Bootcamp de Dados do Itaú em parceria com a L

Henrique V. Domingues 1 Jan 11, 2022