Coder Social home page Coder Social logo

xresources-nvim's Introduction

Xresources-nvim

* Neovim colorscheme based on your xresources color *



Require

  • Neovim 0.5
  • xrdb

Install

Vim Plug

Plug 'nekonako/xresources-nvim'

Usage

  • lua

require('xresources')

  • lua inside vimscript

lua require('xresources')

  • vimscript

colorscheme xresources

Notes

if you use light background, set neovim background to light.

  • lua

vim.o.background = 'light'

  • lua inside vimscript

lua vim.o.background = 'light'

  • vimscript

set background=light

Properties

Properties Xresources
fg foreground
bg background
black color0
red color1
green color2
yellow color3
blue color4
purple color5
cyan color6
white color7
light_black color8
light_red color9
light_green color10
light_yellow color11
light_blue color12
light_purple color13
light_cyan color14
light_white color15
grey background + 0xf0f10
grey1 background + 0x363940
none NONE

Example using properties

Let say i want using xresources to my galaxyline configuration

local galaxyline = require('galaxyline')
local color = require('xresources')
local section = galaxyline.section

section.left[1] = {
   FileName = {
      provider = get_current_file_name,
      condition = buffer_not_empty,
      -- acessing properties --
      highlight = {color.bg, color.purple},
      separator = " ",
      -- acessing properties --
      separator_highlight = {color.gray, color.gray}
   }
}

Tips

Similiar project

My setup

  • my xresources color is originaly from uwu.vim
  • my terminal is using alacritty
  • font is pragmataPro

Thanks

xresources-nvim's People

Contributors

cshjsc avatar nekonako avatar rageknify avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

xresources-nvim's Issues

Zsh autocompletion foreground is the same as the terminal's background

Im using Neovim with toggleterm plugin. So, when I spawn a terminal using the said plugin, my Zsh shell will be ready to use like a usual terminal. There is a feature in Zsh where commands will appear to autocomplete without having to type the command fully as long as it has been typed before and is in the history file. So, say I've typed npm start, then I typed np, then a sort of highlight will appear at the shell and I can just press Right button to autocomplete np to npm start (image for visual aid). This is also the case in the terminal created from toggleterm plugin as the shell is the same, which is Zsh. The autocomplete works as it should. However, in the spawned terminal from toggleterm, the color foreground for that said "autocomplete highlight" appears to be colored "black", which is the same as the background making it impossible to see (Zsh autocomplete highlight in toggleterm neovim). However, when I do a V to the line then I can see that the completion highlight is indeed there (autocomplete highlight can be seen with VISUAL LINE). What can I do to make it appear even withou VISUAL LINE? What highlight group am I supposed to change? Is changing highlight group the right approach?

"Overflow" in `get_lighter_color`

Using this plugin with a solarized light colorscheme isn't working for me because of an overflow in the get_lighter_color function.
When these 2 lines get executed:

   grey = get_lighter_color('background', 0xf0f10);
   grey1 = get_lighter_color('background', 0x363940);

The values for before_colorand final_color at the end of get_lighter_color are:

before #fdf6e3
final  #10d05f3
before #fdf6e3
final  #1343023

I assume when those values are used as colors they are considered invalid and None is used instead.
I have noticed that there is vim.o.background = 'dark' in xresources.colorscheme(), would you be open to having it work for light and dark colorschemes @nekonako ?
There's a get_darker_colordefined, it could be used instead when using light color schemes.

edit: I have implemented it, I'll open a PR

Provide custom color sources

Hi,

I really like this idea of having colors picked up from terminal colors. Haven't tried it yet though.
Only issue is that I'm using kitty terminal, which has it's own configuration, and it's not using xresources.

Would you consider exposing a way to provide custom parser for colors? By default it could work like it's working now, and if someone provides a custom function, use that to parse the colors.

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.