Coder Social home page Coder Social logo

olimorris / onedarkpro.nvim Goto Github PK

View Code? Open in Web Editor NEW
700.0 700.0 35.0 996 KB

๐ŸŽจ Atom's iconic One Dark theme. Cacheable, fully customisable, Tree-sitter and LSP semantic token support. Comes with variants

License: MIT License

Lua 93.04% Makefile 0.88% Python 0.04% Ruby 0.03% Vim Script 3.27% Scheme 2.75%
colorscheme lua neovim nvim onedark onedarkpro onelight theme

onedarkpro.nvim's People

Contributors

anthony-s93 avatar github-actions[bot] avatar harry-lees avatar hougesen avatar lc0117 avatar maxmx03 avatar metainsight7 avatar mmirus avatar mo8it avatar mrjones2014 avatar mrstrik3 avatar nullchilly avatar olimorris avatar rj1 avatar robstumborg avatar tristan957 avatar vidocqh avatar vpavliashvili 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  avatar  avatar

onedarkpro.nvim's Issues

How do I make the colors a bit dimmer?

This is kind of dumb but, I've been using a different OneDark color scheme from https://github.com/navarasu/onedark.nvim and my setup looked like this.
image

So, after I switched to yours, it looks something like this.
image

I'm using the Item2's default dark color palette with the background set to 10% gray. You can see that the contrast a bit low in the line highlight and lualine. How can I make it look like my old config? (also I really don't like the purple accent on everything, any way I can change that? ๐Ÿ˜„ )

Highlight "link" not honored

Hi,
If I have a setup like:

local onedarkpro = require('onedarkpro')

local p = {
    fg = '#abb2bf',
    pmenu = '#333841',
}

onedarkpro.setup({
    theme = 'onedark',
    colors = p,
    hlgroups = {
        NormalFloat = { link = 'Pmenu' },
        Pmenu = { fg = p.fg, bg = p.pmenu },
    },
})

Then the NormalFloat "link" is not respected and defaults to whatever onedarkpro default is. In order for it to work I need to rewrite it as:

NormalFloat = { fg = p.fg, bg = p.pmenu },

Is this a bug or a feature? Thanks in advance.

Minimal.lua file to use when testing onedarkpro

The majority of issues raised are about highlight groups not being applied or other plugins changing colors. To prevent this, I've included an example minimal.lua file which can be run with:

nvim --clean -u minimal.lua

Note: Just place the minimal.lua file in any directory and run the command. No need to mess around with your existing config!

minimal.lua

-- ignore default config and plugins
vim.opt.runtimepath:remove(vim.fn.expand("~/.config/nvim"))
vim.opt.packpath:remove(vim.fn.expand("~/.local/share/nvim/site"))

-- append test directory
local test_dir = "/tmp/onedarkpro"
vim.opt.runtimepath:append(vim.fn.expand(test_dir))
vim.opt.packpath:append(vim.fn.expand(test_dir))

-- install packer
local install_path = test_dir .. "/pack/packer/start/packer.nvim"
local install_plugins = false

if vim.fn.empty(vim.fn.glob(install_path)) > 0 then
    vim.cmd("!git clone https://github.com/wbthomason/packer.nvim " .. install_path)
    vim.cmd("packadd packer.nvim")
    install_plugins = true
end

local packer = require("packer")

packer.init({
    package_root = test_dir .. "/pack",
    compile_path = test_dir .. "/plugin/packer_compiled.lua",
})

packer.startup(function(use)
    -- Packer can manage itself
    use("wbthomason/packer.nvim")

    use({ "nvim-treesitter/nvim-treesitter", run = ":TSUpdate" })
    use("olimorris/onedarkpro.nvim")

    if install_plugins then
        packer.sync()
    end
end)

local ok, treesitter = pcall(require, "nvim-treesitter.configs")
if ok then
    treesitter.setup({
        ensure_installed = "all",
        ignore_install = { "phpdoc" }, -- list of parser which cause issues or crashes
        highlight = { enable = true },
    })
end

local ok, onedarkpro = pcall(require, "onedarkpro")
if ok then
    vim.cmd("colorscheme onedarkpro")
end

Indent blankline is not colored

Hey,

First, I'd like to say I really love Onedarkpro theme! I think this turns to be my favorite!

It seems like indent blankline is not colored when you hover on it.
Also, YAML keys are not highlighted (is this expected behavior?)

Last but not least, can this be supported with base16?

Thank you for this!

Share your custom highlights

Telescope

I thought I'd begin by sharing how I have Telescope formatted:

Screenshots

Screen Shot 2023-01-17 at 18 15 15@2x

Screen Shot 2023-01-17 at 18 15 39@2x

Highlights

colors = {
  dark = {
    telescope_prompt = "require('onedarkpro.helpers').darken('bg', 1, 'onedark')",
    telescope_results = "require('onedarkpro.helpers').darken('bg', 4, 'onedark')",
    telescope_preview = "require('onedarkpro.helpers').darken('bg', 6, 'onedark')",
    telescope_selection = "require('onedarkpro.helpers').darken('bg', 8, 'onedark')",
  },
  light = {
    telescope_prompt = "require('onedarkpro.helpers').darken('bg', 2, 'onelight')",
    telescope_results = "require('onedarkpro.helpers').darken('bg', 5, 'onelight')",
    telescope_preview = "require('onedarkpro.helpers').darken('bg', 7, 'onelight')",
    telescope_selection = "require('onedarkpro.helpers').darken('bg', 9, 'onelight')",
  },
},
highlights = {
  TelescopeBorder = {
    fg = "${telescope_results}",
    bg = "${telescope_results}",
  },
  TelescopePromptBorder = {
    fg = "${telescope_prompt}",
    bg = "${telescope_prompt}",
  },
  TelescopePromptCounter = { fg = "${fg}" },
  TelescopePromptNormal = { fg = "${fg}", bg = "${telescope_prompt}" },
  TelescopePromptPrefix = {
    fg = "${purple}",
    bg = "${telescope_prompt}",
  },
  TelescopePromptTitle = {
    fg = "${telescope_prompt}",
    bg = "${purple}",
  },
  TelescopePreviewTitle = {
    fg = "${telescope_results}",
    bg = "${green}",
  },
  TelescopeResultsTitle = {
    fg = "${telescope_results}",
    bg = "${telescope_results}",
  },
  TelescopeMatching = { fg = "${blue}" },
  TelescopeNormal = { bg = "${telescope_results}" },
  TelescopeSelection = { bg = "${telescope_selection}" },
  TelescopePreviewNormal = { bg = "${telescope_preview}" },
  TelescopePreviewBorder = { fg = "${telescope_preview}", bg = "${telescope_preview}" },
}

Note: The config for Telescope itself was taken from the awesome NvChad!

Disable autoload on setup

Would it be possible to disable the autoload behaviour from 5d90d33? I have multiple colorschemes enabled and use this plugin as a secondary colorscheme, so overriding the colorscheme by automatically loading it is messing with all my configs. Thanks!

Custom highlight groups feature causes startup error

As of commit 43bfe7d, I encounter this error on startup using LunarVim:

Error detected while processing /home/james/.local/share/lunarvim/lvim/init.lua:
E5113: Error while calling lua chunk: ...es/.local/share/lunarvim/lvim/lua/lvim/plugin-loader.lua:99:
 Vim(lua):E5108: Error executing lua ...ck/packer/start/onedarkpro.nvim/lua/onedarkpro/utils.lua:167:
 bad argument #1 to 'pairs' (table expected, got nil)
stack traceback:
        [C]: in function 'pairs'
        ...ck/packer/start/onedarkpro.nvim/lua/onedarkpro/utils.lua:167: in function 'template_table'

        ...ck/packer/start/onedarkpro.nvim/lua/onedarkpro/utils.lua:336: in function 'load'
        [string ":lua"]:1: in main chunk
        [C]: in function 'cmd'
        ...es/.local/share/lunarvim/lvim/lua/lvim/plugin-loader.lua:99: in function 'load'
        /home/james/.local/share/lunarvim/lvim/init.lua:13: in main chunk
stack traceback:
        [C]: in function 'cmd'
        ...es/.local/share/lunarvim/lvim/lua/lvim/plugin-loader.lua:99: in function 'load'
        /home/james/.local/share/lunarvim/lvim/init.lua:13: in main chunk

Transparency option didn't work

I have copied the default config and changed the transparency option from false to true and reload, but it didn't work. Nvim style reamain the same as before.

Share your custom filetype highlights

After merging 43bfe7d, the theme now has the ability to specify highlight groups by filetype. Creating this issue for us to share our custom configs to get filetypes looking as close to One Dark Pro as possible.

After pasting some yaml and ruby code into VS Code and comparing the colors, this is where I've ended up:

Yaml

filetype_hlgroups = {
  yaml = {
    TSField = { fg = "${red}" },
  }
}

Ruby

filetype_hlgroups = {
  ruby = {
    TSFunction = { fg = "${blue}", style = "bold" },
    TSInclude = { fg = "${blue}", style = "italic" },
    TSParameter = { fg = "${fg}" },
    TSSymbol = { fg = "${cyan}" },
  }
}

vscode onedarkpro vs this one

Hi,

This is a suggestion.
I end up changing many highlights and colors to represent the onedarkpro for vscode that has over 4M downloads, a standard onedarkpro theme. If this repo is for everyone to enjoy the standard onedarkpro theme with neovim you should represent the exact onedarkpro.

For example, the default backgroud color should be bg = "#282c34", the next line should be purple and not italic TSInclude = { fg = theme.colors.blue, style = theme.options.italic }, -- For includes: "#include" in C, "use" or "extern crate" in Rust, or "require" in Lua. and so on.

People should start from the standard theme and then change settings/highlights/colors if needed. But, if this repo is for yourself just ignore what I just said.

One last suggestion, the plugins by default should be set to false, so we can keep the onedarkpro.settup clean as much as possible.

Thanks

Question: how to setup the theme properly for python?

Hi

Your theme is awesome it's the reason that I'm trying to switch from vim to nvim, I'm trying to get the same results as the images that you share, but at the moment (since I downloaded the theme) the name of the variables and most of the text is in gray, only the name of functions, objects , primitive types and keywords of the language are in colors, name of the variables and arguments of functions are in gray too.

Besides the vim plug part this is my config on init.vim file

`
" Vim Colors Configuration
syntax enable
syntax on
set cursorline

if exists('+termguicolors')
"let &t_8f = "<Esc>[38;2;%lu;%lu;%lum"
"let &t_8b = "<Esc>[48;2;%lu;%lu;%lum"
set termguicolors
endif

set t_Co=256

colorscheme onedarkpro

`

YAML files are not highlighted

One of the concessions I had to make with trying to make the theme match VS Code's One Dark Pro was to sacrifice how YAML files are highlighted.

The highlight group responsible is TSField. Treesitter sees YAML files as a collection of fields and highlights them accordingly. However it also applies TSField to certain elements in Python files. So we end up with a trade off. Do we wish to have YAML files highlighted nicely or make Python stick as close to the original One Dark Pro as best we can? I guess the choice is up to you.

Python with TSField set to foreground (default)

Screen Shot 2021-11-28 at 11 14 16@2x

Python with TSField set to red (which highlights YAML files)

Screen Shot 2021-11-28 at 11 15 08@2x

YAML with TSField set to foreground (default)

Screen Shot 2021-11-28 at 11 21 30@2x

YAML with TSField set to red

Screen Shot 2021-11-28 at 11 15 37@2x

Your configuration

If you wish to customise the TSField highlight group so YAML files are highlighted, you can do so by providing a highlight group override as per the readme:

local onedarkpro = require('onedarkpro')
onedarkpro.setup({
  hlgroups = {
    TSField = { fg = "${red}" }
  }
})
onedarkpro.load()

Change folded highlight group

Could you change the current Folded highlight group?

Currently it makes it harder to distinguish folded text from comments.

I can change it in :

onedarkpro.setup({
  hlgroups = {}
})

but many other highlight groups are linked to it.

Solution

Change LineNr to

LineNr = { bg = theme.options.transparency, fg = theme.colors.gray }, -- Line number for ":number" and ":#" commands, and when 'number' or 'relativenumber' option is set.

and link it in place of Folded

Custom config is only parsed on initial load

I use onedarkpro to switch between the onedark and onelight themes throughout the day. I also have custom colors and hlgroups which I apply depending on which theme is loaded.

I've noticed in recent times that as I flick between the two themes, certain hlgroups, which I've specified in my config, are ignored. This became most obvious with my telescope prompts. For example, I may have the following config:

TelescopePromptTitle = {
  fg = "${telescope_prompt}",
  bg = "${purple}",
},

Which is then parsed by the theme's utilities to become:

TelescopePromptTitle = {
  fg = "#2e323a",
  bg = "#c678dd",
},

This works fine until I have two different values for ${telescope_prompt}, for each theme:

colors = {
  onedark = {
    telescope_prompt = "#2e323a"
  },
  onelight = {
    telescope_prompt = "#f5f5f5"
  }
}

What happens then is that the theme only replaces telescope_prompt once, when the theme is initialised. So when I toggle between onedark and onelight, the hlgroup for TelescopePromptTitle will never change.

Line number color

Hi,

The colortheme worked perfectly but suddenly the line numbers did change color and i can't find a way to fix it. The linenumbers are some sort of purple? Also the CursorLineNr is not applied anymore.

1647282173

I tried reinstalling but it did not change anything.

Any ideas where it goes wrong?

Changing background color

If you'd like to have a different background color, you can do so by following the README.md, here. That way you can stay up to date with the plugin and not have to worry about maintaining a fork ๐Ÿ˜„

Error in theme

Error in packer_compiled: .../start/onedarkpro.nvim/lua/onedarkpro/colors/onedark.lua:38: attempt to call field 'lighten' (a nil value)

my config-

 use {
            'olimorris/onedarkpro.nvim',
            config = [[require('config.onedarkpro')]]
        }
vim.o.background = "dark" -- to load onedark
local onedarkpro = require("onedarkpro")
local config = {dark_theme = "onedark_vivid", light_theme = "onelight"}

onedarkpro.setup({
    dark_theme = "onedark_vivid", -- The default dark theme
    light_theme = "onelight", -- The default light theme
    -- Theme can be overwritten with 'onedark' or 'onelight' as a string
    theme = function()
        if vim.o.background == "dark" then
            return config.dark_theme
        else
            return config.light_theme
        end
    end,
    colors = {onedark = {bg = '#27292d'}}, -- Override default colors by specifying colors for 'onelight' or 'onedark' themes
    options = {
        bold = false, -- Use the themes opinionated bold styles?
        italic = true, -- Use the themes opinionated italic styles?
        underline = false, -- Use the themes opinionated underline styles?
        undercurl = false, -- Use the themes opinionated undercurl styles?
        cursorline = true, -- Use cursorline highlighting?
        transparency = false, -- Use a transparent background?
        terminal_colors = false, -- Use the theme's colors for Neovim's :terminal?
        window_unfocussed_color = false -- When the window is out of focus, change the normal background?
    }
})
require('onedarkpro').load()

"Vivid" colors

Hey there! Not an issue, just sharing info for anyone else interested.

I personally liked the vivid colors from One Dark in VS Code (specifically https://github.com/Binaryify/OneDark-Pro).

If anyone wants to recreate them in this theme, I think this is all that's needed:

local onedarkpro = require('onedarkpro')
onedarkpro.setup({
  theme = "onedark",
  colors = {
    onedark = {
      -- Vivid colors from https://github.com/Binaryify/OneDark-Pro
      red = "#ef596f",
      green = "#89ca78",
      cyan = "#2bbac5",
      purple = "#d55fde",
    },
  },
})
onedarkpro.load()

The color of OneDarkPro Background is Blue

I don't know what I'm doing wrong, because I installed the Plugin through Plug and I used the lua script that you can see in photo bellow. How can I solved my problem?

Screen Shot 2022-03-21 at 18 41 39

Screen Shot 2022-03-21 at 18 47 11

Unfocused window lua bar unreadable

Hi there

Thank you for this very beautiful and configurable theme, I love it.

I have only one issue currently, which is the following

The foreground color (text color) of the unfocused windows is to similar to the background color so that the information is not readable.

This is especially noticeable when using e.g. dap_ui which annotates the windows contents in the window bar. Or if I want to read what file the other window is.

Is this a design decision? Can I somehow override it? I tried to override the hlgroup lualine_b_inactive and lualine_c_inactive with no success.

image

Changing higlight groups for vim-matchup

I have the following in my onedarkpro setup file

  colors = {}, -- Override default colors. Can specify colors for "onelight" or "onedark" themes by passing in a table
  hlgroups = {  -- Override default highlight groups
    Cursorline = { bg="Grey20" , },
    MatchParen = { bg='Grey20' },
    MatchBackground = { bg='Grey20', fg="Grey40" },
  },

However, I am still not able to get a distinct background for the line shown by vim-matchup for start of a function

SCSS color VSCode

Hello.
I don't understand why i didn't have the same color :
Vscode One Dark Pro SCSS:
image

Neovim One Dark Pro SCSS :
image

I use neovim v0.6.1
Lastest Treesitter and OneDarkPro (no custom config)

Could you help me please ?

nvim-cmp hlgroup. (and telescope title)

Hey @olimorris, I can't seem to find the hlgroup for nvim-cmp selected item. I have tried PmenuSel but it doesn't seem to work. This also applies to telescope or any popup menu/float. I get this very light color. โ†“

Screenshot 2022-06-05 at 16 05 39

Screenshot 2022-06-05 at 16 07 29

I also only noticed now that the Telescope title is very light. Any way to fix these ?

Telescope missing borders

After a update (unsure if onedarkpro or telescope) the borders of telescope are missing.

image

With a different colorscheme it looks like this
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.