You can change the colors and highlights.
- Subject color: blue
- Second color: green
- Search/Match color: orange
The priority from high to low:
config.colors
- colors and highlights defined in each plugin
colors/highlights
- colors and highlights defined in theme plugin
- syntax highlights by nvim-treesitter
The colors are desiged based on Display P3 color space. It works for MacOS and iTerm2 users.
If your nvim colors looks different from below picture. Your terminal is not under Display P3 color space. You may try sRGB colors.
The color space is managed by your terminal application and operator system. You should choose the right color space for your environment.
Current one.nvim provides Display P3 and sRGB color presets. And use Display P3 presets by default. You can use sRGB presets like below codes.
require('one').setup {
config = {
colors = require('one.colors.srgb')
}
}
For Kitty users, you should set macos_colorspace displayp3
in kitty config. Or set macos_colorspace srgb
and use the sRGB color presets.
For windows users, read Microsoft - About Color Management and Windows Central - How to find the right color profile for your monitor using Windows 10. (Even though one.nvim not work for windows users for current)
Change basic colors via config.colors
.
Default color configs is defined in ../lua/one/colors/display-p3.lua.
require('one').setup {
config = {
colors = { -- basic colors
white = '#BEC0C4', -- frontground
black = '#15181D', -- background
cursorLine = '#252931',
},
}
}
Override plugin highlights via plugins
.
require('one').setup {
plugins = {
{
'stevearc/aerial.nvim',
highlights = {
AerialLine = { bg = 'green' },
}
},
},
}
It's highly dependent on nvim-treesitter. The nvim-treesitter will set highlights for each syntax. See the treesitter highlights and colors/highlights.
If syntax highlights not work, try to reinstall your treesitter parsers. Read doc/treesitter.md for troubleshooting.
The markdown
syntax highlights are disabled for treesitter (See config.treesitter.highlight.disable
).
But its syntax parser is still working.
Its syntax highlights are defined in lua/one/plugins/markdown/highlights.lua .
The help
syntax highlights are disabled for treesitter, while using nvim builtin highlights.
Default theme is 'onedarkpro'.
require('one').setup {
config = {
theme = {
use = 'onedarkpro',
-- The onedarkpro plugin provides four themes.
onedarkpro = {
theme = 'onedark', -- 'onelight', 'onedark_vivid', 'onedark_dark'
-- You can override options
-- Options see https://github.com/olimorris/onedarkpro.nvim#wrench-configuration
colors = {},
highlights = {},
plugins = {},
styles = {},
options = {},
}
}
},
}
require('one').setup {
config = {
theme = {
use = 'material',
-- The material plugin provides five themes.
material = {
style = 'darker', -- 'darker', 'lighter', 'oceanic', 'palenight' 'deep ocean'
-- Options see https://github.com/marko-cerovac/material.nvim
}
}
},
}
You can disable theme by config.theme.use = false
.
If you prefer tokyonight.nvim, edit your init.lua
like below codes.
require('one').setup {
config = {
theme = { use = false },
},
plugins = {
{ 'onedarkpro', disable = true },
{
'folke/tokyonight.nvim',
config = function(config)
local conf = config.tokyonight
vim.cmd('colorscheme ' .. conf.colorscheme)
require('tokyonight').setup(conf.setup)
end,
defaultConfig = {
'tokyonight',
{
colorscheme = 'tokyonight', -- https://github.com/folke/tokyonight.nvim#-usage
setup = {}, -- https://github.com/folke/tokyonight.nvim#%EF%B8%8F-configuration
},
},
},
},
}
But some places do not look good, that you need to solve them by yourself.