GithubHelp home page GithubHelp logo

nvchad / base46 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from norcalli/nvim-base16.lua

178.0 5.0 188.0 637 KB

NvChad's base46 theme plugin with caching ( Total re-write )

License: Other

Lua 100.00%
theme nvchad neovim rice base16

base46's Introduction

NvChad theme plugin

  • This plugin's a whole re-write of Norcalli's plugin.
  • It should be used along with NvChad for best experience.
  • Non NvChad users can have the nvconfig module on the path

Supported Integrations

  • Bufferline.nvim
  • Cmp.nvim
  • Codeactionmenu
  • Nvim-dap
  • Nvim-webdevicons
  • Hop.nvim
  • Vim-illuminate
  • Lsp ( diagnostics )
  • Nvim Navic
  • LspSaga
  • Mason.nvim
  • Notify.nvim
  • Nvim-tree
  • Telescope.nvim
  • Rainbow-delimiters.nvim
  • Todo.nvim
  • Nvim-treesitter
  • Lsp Semantic tokens
  • Trouble.nvim
  • Whichkey.nvim

Configuration

Highlight command

  • :hi command will list all highlight groups
  • :hi with args will highlight a highlight group
  • Example : hi Comment guifg=#ffffff gui=italic, bold

Neovim Lua api for setting highlights

  • Check :h nvim_set_hl for detailed doc
vim.api.nvim_set_hl(0, "Comment", {
  fg = "#ffffff",
  italic = true,
  bold = true,
})

Understanding theme variables

There are 2 main tables used for base46

Note: the below values are mostly approx values so its not compulsory that you have to use those exact numbers, test your theme i.e show it in the PR to get feedback from @siduck

Default Theme table

-- this line for types, by hovering and autocompletion (lsp required)
-- will help you understanding properties, fields, and what highlightings the color used for
---@type Base46Table
local M = {}
-- UI
M.base_30 = {
  white = "",
  black = "", -- usually your theme bg
  darker_black = "", -- 6% darker than black
  black2 = "", -- 6% lighter than black
  one_bg = "", -- 10% lighter than black
  one_bg2 = "", -- 6% lighter than one_bg2
  one_bg3 = "", -- 6% lighter than one_bg3
  grey = "", -- 40% lighter than black (the % here depends so choose the perfect grey!)
  grey_fg = "", -- 10% lighter than grey
  grey_fg2 = "", -- 5% lighter than grey
  light_grey = "",
  red = "",
  baby_pink = "",
  pink = "",
  line = "", -- 15% lighter than black
  green = "",
  vibrant_green = "",
  nord_blue = "",
  blue = "",
  seablue = "",
  yellow = "", -- 8% lighter than yellow
  sun = "",
  purple = "",
  dark_purple = "",
  teal = "",
  orange = "",
  cyan = "",
  statusline_bg = "",
  lightbg = "",
  pmenu_bg = "",
  folder_bg = ""
}

-- check https://github.com/chriskempson/base16/blob/master/styling.md for more info
M.base_16 = {
  base00 = "",
  base01 = "",
  base02 = "",
  base03 = "",
  base04 = "",
  base05 = "",
  base06 = "",
  base07 = "",
  base08 = "",
  base09 = "",
  base0A = "",
  base0B = "",
  base0C = "",
  base0D = "",
  base0E = "",
  base0F = ""
}

-- OPTIONAL
-- overriding or adding highlights for this specific theme only 
-- defaults/treesitter is the filename i.e integration there, 

M.polish_hl = {
  defaults = {
    Comment = {
      bg = "#ffffff", -- or M.base_30.cyan
      italic = true,
    },
  },

  treesitter = {
    ["@variable"] = { fg = "#000000" },
  },
}

-- set the theme type whether is dark or light
M.type = "dark" -- "or light"

-- this will be later used for users to override your theme table from chadrc
M = require("base46").override_theme(M, "abc")

return M

Credits

Contribute

Testing your theme

  • Just place your theme file in your /lua/themes folder
  • And select the theme with theme switcher or change in chadrc

Tips

  • Capture what highlight are used under the cursor by running the :Inspect or :InspectTree commands

base46's People

Contributors

akianonymus avatar brunokrugel avatar brutusmcforce avatar bryant-the-coder avatar deathemonic avatar dereklee0312 avatar dharmx avatar dylanarmstrong avatar felixkratz avatar frenzyexists avatar kayuxx avatar leonheidelbach avatar lucario387 avatar manas140 avatar mangeshrex avatar max397574 avatar mgastonportillo avatar nrbjerg avatar phanlong2811 avatar pocco81 avatar ritchielrez avatar rockorager avatar sefidel avatar siddrs avatar siduck avatar sparkenstein avatar switch1220 avatar tomspeak avatar yetone avatar zbirenbaum 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

base46's Issues

Strange theme colors preview in .tsx file

Description
I used npx create-t3-app command for initialize my project and found strange theme colors preview in _app.tsx file

Desktop

  • Arch linux
  • st terminal
  • NVIM v0.8.0-v0.8.0
    Build type: Release

Screenshots
2022-11-15-16:01:22

Specially this thing
2022-11-15-16:02:28

lazy loading of highlight improper behaviour

updating this plugin made highlight behave improperly

what i have
image
what it should be ( using base64 at commit "674d6bb" )
image

if it's related to the way my NVchad is setup
it would be great to make the plugin actively requiring to activate the lazy loading

Need suggestion for contributing more integrations

Hi There,

I am interested in contributing more integrations here. I can start with highlight groups nvim-notify and lsp-saga plugins. Just want to understand if there are any issues with going forward.

Are you happy with these integrations being added here even though the plugins are not added to nvchad or do you prefer users adding them as UI overrides.

feature to override a specific color for a theme

For a particular theme like onebright I like the overall theme but I want to override a specific color like something similar to the following
eg

theme.override("base00", "282c34")
theme.override("black", "282c34")

Currently, there is no direct feature or a way to achieve it from what I know
would really love to have this option

What exactly does the hl themes do?

This is not really an issue, however I seem to have miss understood something when I created the Monekai theme. What exactly is the role of the hl part of a theme (I thought that it exclusively influenced the way that the UI looked, ie. not syntax highlighting), however i can not seem to figure out why the base feilds in the dictionary is colored aswell as the commas?

Screenshot from 2021-12-12 22-04-51

Sorry for the extra work, appriciate it ๐Ÿ˜…

Sincerely Martin

packer.nvim fails to update base46

Hello, I was updating and adding new plugins but base46 keeps failing to update. Retrying yields the same fail message.

โœ— Failed to update NvChad/base46

Screenshot from 2022-11-13 17-41-12

I'm not sure how to reproduce this issue or if this is a packer.nvim issue.

Error message `attempt to concatenate local 'name' (a nil value)

Seems like yesterdays commit broke something.
I just :PackerSynced and got the following errors in NvChad:

packer.nvim: Error running config for base46: ...al/share/nvim/site/pack/packer/opt/base46/lua/base46.lua:7: attempt to concatenate local 'name' (a nil value)
packer.nvim: Error running config for feline.nvim: ...al/share/nvim/site/pack/packer/opt/base46/lua/base46.lua:7: attempt to concatenate local 'name' (a nil value)

I use chadracula as main theme, no further configs for base46 or feline.nvim

Overriding one part of styling for highlight group clears rest of the style

Since the update a few days ago, comments no longer show in the correct color when I first load NvChad, but display correctly if I switch the theme and then change it back.

I have an hl_override set up in my chadrc.lua to make comments italic. This never affected the color of comments before the update, but now it seems if there is an override of any aspect, it's clearing all the styles associated with the highlight group, since commenting out my override fixes the issue.

M.ui = {
   hl_override = {
      Comment = { italic = true },
   },
}

Wrong colors in diffmode

The onedark theme of nvchad does not highlight colors correctly in diffview.

  • The changed lines will not be color like in the second picture.
  • And the used colors for DiffAdd, DiffChange, DiffDelete are not right colors (e.g. red) from the theme.

Started neovim diff mode with configured nvchad and onedark-theme.
image

Started neovim diff mode with disables plugins and options.
image

Are these colors not taken into account by the theme? How can I override them?

UPDATE:
Theses Colors are not set in de the default themes. I overwrited the following colors and that solves the problem for me.

DiffAdd = {
  fg = "none",
  bg = colors.diff_add,
},
DiffChange = {
  fg = "none",
  bg = colors.diff_change,
},
DiffChangeDelete = {
  fg = "none",
  bg = colors.diff_delete,
},
DiffDelete = {
  fg = "black",
  bg = colors.diff_delete,
},
DiffText = {
  fg = "none",
  bg = colors.diff_text,
},
GitSignsAdd = {
  bg = "black",
},
GitSignsChange = {
  bg = "black",
},
GitSignsDelete = {
  bg = "black",
},
SignColumn = {
  bg = "black",
},
FoldColumn = {
  bg = "black",
}

Disable syntax error highlight

There is a red highlight above the code when there's a syntax error. It happens as we type... before even completing the code and it's annoying.
Is there any way to disable this highlight feature?
image

custom statusline is not loaded when toggle theme

Describe the bug
Possible to load custom statusline when toggle/change theme?

I have following config in chadrc to use custom statusline:

M.plugins = {
    user = {
          ["feline-nvim/feline.nvim"] = {
              config = function()
                  require "custom.plugins.statusline"
              end,
          },
    },
}

but when toggle/change theme, it changes back to default statusline. Kind of weird, I have to quit NVIM and enter again to have my custom one.

To Reproduce
configure custom statusline, PackerSync
change theme.

Expected behavior
custom statusline is loaded instead of default one.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • Operating System
  • Terminal
  • Version of Neovim

Additional context
Add any other context about the problem here.

Themes are too hard to see

Radium

radium

  • Top right window with C++ has too many red brackets and parentheses
  • vim-matchup uses white bg...
  • Can barely see Visual (Selected texts)

Tokyonight

tokyonight

  • Brackets and parentheses actually fit nicely with the theme
  • vim-matchup still using white bg instead of grey?
  • Can see Visual easily

Help to modify

image
I attempted to modify base0F to the same as tokyonight's and make MatchParen only show fg and Visual to base04

However, I don't have a sense of color. While it ended up much clearer to my eyes at the same time it is uglier. Can you help me out :<

Add actual Dracula theme

Hey,

After trying out the chadracula theme for some time I came to realize that I don't like it as much as the original one. Sorry :(
Is there a way to add the original dracula theme back to the repo?

This one seems to be the source: https://github.com/dracula/vim

Falcon Theme

Hi, I'm not entirely sure how to port this but I recently came across fenetikm/falcon and it looks like something I'd want to try out but I'm not able to use an external theme in NVChad. Would love if someone could help me port this to base46!

image

Customize single cursor color

I am trying to change the cursor block color to always be red. Currently on my set up the cursor color change based on the syntax highlighting. Is there a way to override the cursor block color. I have tried the following code but it did not work. I am looking for a more elegant solution that would override this in chadrc.lua.

/base46/integrations/defaults.lua

Cursor = { fg = colors.white, bg = colors.red, },

Add vscode theme

Is there a vscode theme in nvchad? If there is can you send the lua file

Catppuccin Latte

hey man love all your neovim's work!
I wonder if Catppuccin Latte theme (which is a light variant out of 4) will be added in the future. I've been trying to recreate them by referencing their palletes and translate it to base 46 but can't seem to get it right. You can ignore this tho if it's a lot of work.

[Feature] Customizable theme intergrations / Opt-in atom style cmp flyout

Is your feature request related to a problem? Please describe.
screenshot

from https://github.com/hrsh7th/nvim-cmp/wiki/Menu-Appearance#how-to-get-types-on-the-left-and-offset-the-menu

Describe the solution you'd like
Add extra code logic for base46

Describe alternatives you've considered

  • A) Let base46 integrations customizable
    Example syntax 1:

    integration = {
      cmp = function()
        require "base46.integration.cmp"
        require "custom.plugins.base46.cmp"
      end,
    }

    Example syntax 2:

    integration = function()
      require "base46.integration"
      require "custom.plugins.configs.base46"
    end

  • B) Move integrations to nvchad_ui so that base46 only provides color, and cooperate with NvChad/ui#23 (centralized ui config)

Issue with Latex files when Treesitter is enabled

Hi, thanks for the awesome theme picker.

I'm currently writing my thesis in Latex and am not able to install Treesitter, as the highlighting becomes unusable:

I use chadracula, as well as vimtex.
As a reference I used the original Dracula theme: https://github.com/dracula/vim

Just Chadracula (not dracula at all, but usable)
no_ts_chadracula
Just Dracula (everything just pink and white)
no_ts_dracula
Treesitter + Chadracula (not usable, since the text is all orange)
ts_chadracula
Treesitter + Dracula (best config)
ts_dracula

I think it might be a problem with Treesitter, since I also have some issues with nested tables in .lua files, where everything is just orange as well. I have the same problems (colorful text) with all the other colorschemes

vscode_dark theme doesn't match

Rust

VSCode (Rust)

code

Neovim (Rust)

neovim

Lua

VSCode (Lua)

code_chadrc

Neovim (Lua)

neovim_chadrc

C

VSCode (C)

code_c

Neovim (C)

neovim_c

I have the vscode_dark theme enabled but the colors don't match VSCode's Dark+ theme (neither the non-plus theme. That's just the same with a few things highlighted less).

Here is also a list of plugin I have installed (besides the one shipped with NvChad).

Plugins
  • neovim/nvim-lspconfig
  • andweeb/presence.nvim
  • jose-elias-alvarez/null-ls.nvim
  • mfussenegger/nvim-dap
  • rcarriga/nvim-dap-ui
  • lostl1ght/rust-tools.nvim
  • karb94/neoscroll.nvim
  • xiyaowong/nvim-transparent

Polish themes

Use custom treesitter highlights for each theme

  • onedark
  • one_light
  • aquarium
  • blossom
  • catppuccin
  • chadtain
  • doomchad
  • everforest
  • everforest_light
  • gruvbox
  • gruvchad
  • jellybeans
  • kanagawa
  • monekai
  • mountain
  • nightlamp
  • nightowl
  • nord
  • onenord
  • palenight
  • pastelDark
  • radium
  • rxhyn
  • solarized
  • tokyodark
  • tokyonight
  • tomorrow_night
  • wombat

Consistent gitsigns colors

When switching themes, gitsigns colors are changing too. Some themes mark added lines green but others might be blue.

It would be great if you could make gitsigns colors more consistent regardless of theme choices, green for added lines, blue for updated, red or grey for deleted, for example. (Also what Iโ€™ve got used to :-)

question about colortheme (e.g gruvbox)

Using NvCahd's theme selection, I tried setting gruvbox.
Here is what I got from NvChad.
image

Here is the screenshot from the original gruvbox github.
(https://github.com/morhetz/gruvbox)
image

Their color selection for keywords, functions, etc. are very different, and I have a limited knowledge about colorthemes and treesitter.

Does the difference come from color definition order (like palette.color01 or something), or is it comes from treesitter config?

loop 'require' between base46.get_colors and hl_themes.xx ??

got error 'loop or previous error loading module', it would be ok when I commented the line M = require("base46").override_theme(M, "onedark") in hl_themes.xx, so maybe a loop 'require' exists between base46.get_colors and hl_themes.xx ?
image

Add onenord light theme

Onenord provides a really nice light theme - by setting vim.o.background = light - would be great to add

Add Dark Horizon colorscheme

Feature

I would like to add the Dark Horizon colorscheme to NvChad's base46 as it is quite different from what is currently available, and would probably be used by quite a few.

It has a high contrast and works well with dark backgrounds and I'm guessing transparent ones as well.

The github repo can be found on Dark Horizon

Screenshots

image

image

image

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.