A dark Neovim theme written in lua.
Which fox will you choose?
Having trouble picking a fox. Let the dice decide! Set style
to randfox
to get a random
fox every time the colorsheme is applied.
Supported plugins
- TreeSitter
- LSP Diagnostics
- LSP Trouble
- LSP Saga
- Git Signs
- Git Gutter
- Glyph Palette
- Telescope
- NvimTree
- WhichKey
- Indent Blankline
- Dashboard
- BufferLine
- Lualine
- Lightline
- Neogit
- vim-sneak
- Fern
- Barbar
- Neovim >= 0.5.0
Install the theme with a package manager:
" For Vim-Plug
Plug 'EdenEast/nightfox.nvim'
-- For Packer
use 'EdenEast/nightfox.nvim'
Enable the colorscheme:
" From vimscript
colorscheme nightfox
-- From lua
require('nightfox').load()
To enable Nightfox
from Lualine
:
require('lualine').setup {
options = {
-- ... your lualine config
theme = "nightfox"
}
}
To enable Nightfox
from Lightline
:
" Vim Script
let g:lightline = {'colorscheme': 'nightfox'}
❗️
nightfox
is the only valid theme name. The other names are styles that can be set in the configuration.
Nightfox also provides the following command to load a specific fox's style.
:NightfoxLoad <fox>
load and applies the passed<fox>
(Use tab completion to view options)
Nightfox comes with default configuration values. You can view them here:
{
fox = "nightfox", -- Which fox style should be applied
transparent = false, -- Disable setting the background color
terminal_colors = true, -- Configure the colors used when opening :terminal
styles = {
comments = "NONE", -- Style that is applied to comments: see `highlight-args` for options
functions = "NONE", -- Style that is applied to functions: see `highlight-args` for options
keywords = "NONE", -- Style that is applied to keywords: see `highlight-args` for options
strings = "NONE", -- Style that is applied to strings: see `highlight-args` for options
variables = "NONE", -- Style that is applied to variables: see `highlight-args` for options
},
colors = {}, -- Override default colors
hlgroups = {}, -- Override highlight groups
}
You can override these values to suite your preferences. An example of this would be as follows:
local nightfox = require('nightfox')
-- This function set the configuration of nightfox. If a value is not passed in the setup function
-- it will be taken from the default configuration above
nightfox.setup({
fox = "nordfox", -- change the colorscheme to use nordfox
styles = {
comments = "italic", -- change style of comments to be italic
keywords = "bold", -- change style of keywords to be bold
functions = "italic,bold" -- styles can be a comma separated list
},
colors = {
red = "#FF000", -- Override the red color for MAX POWER
bg_alt = "#000000",
},
hlgroup = {
TSPunctDelimiter = { fg = "${red}" }, -- Override a highlight group with the color red
LspCodeLens = { bg = "#000000" },
}
})
-- Load the configuration set above and apply the colorscheme
nightfox.load()
For configuration in vimscript
, wrap the above example in a lua script block.
" vimscript
lua << EOF
-- example above here
EOF
These are general settings and are unrelated to any group of settings.
fox
: {string} The name of the fox you which to base the colorscheme on. See Styles.transparent
: {boolean} If set to true the background color will not be set.terminal_colors
: {boolean} If set to true nightfox will set the terminal colors for:terminal
These options set the style for their respecitve highlight groups. See :help highlight-args
.
comments
: {string} Style to the applied to commentsfunctions
: {string} Style to the applied to functionskeywords
: {string} Style to the applied to keywordsstrings
: {string} Style to the applied to stringsvariables
: {string} Style to the applied to variables
colors
is a table that defines hex color overrides for the colors returned by
require('nightfox.colors').load()
. To see what values can be overridden, use vim.inspect
to
print out the returned color table.
print(vim.inspect(require('nightfox.colors').init()))
Colors with the suffix _br
are brighter colors. Colors with the suffix _dm
are dimmer colors.
To see what colors are defined to what highlight group you can reference the file theme.lua.
hlgroups
is a table that defines overrides for highlight groups. The table consists of the
highlight group name as the key. The value is a table that defines optional values of the highlight
group. These values can be:
fg
: The foreground color of the highlight groupbg
: The background color of the highlight groupstyle
: The style applied to the highlight group (see:help hightlight-args
)sp
: Special colors use in GUI. (see:help hightlight-guisp
)
To use a color defined by nightfox's you can use the template format: ${}
. Any value that you can
override in the colors section can be added in the template format. Some examples would
be: ${red}
, ${blue_br}
, ${bg_alt}
.
To see examples of highlight groups that can be overridden reference the file theme.lua.
There are different ways to get colors from nightfox. Here are some examples:
-- Get the colors defined in nightfox with the color overrides from config applied
local colors = require('nightfox.colors').load()
-- Get the color of a specific theme with the color overrides applied from the config
local colors = require('nightfox.colors').load('nordfox')
-- Get the colors defined in nightfox without the color overrides applied from the config
local colors = require('nightfox.colors').init()
-- Get the color of a specific theme without the color overrides applied from the config
local colors = require('nightfox.colors').init("nordfox")
There are extra configuration files for:
The generation method used is based off of tokyonight.
They are generated by executing lua on the file lua/nightfox/extras/init.lua
. The generated
results are output to the extra folder.
Pull requests are welcome. For contributing to extras
, they are generated with a template and run
with each colorscheme style. To add a new template follow these steps:
- Create new
lua
file under./lua/nightfox/extras/
- Add the name and file extension into the
extras
table in./lua/nightfox/extras/init.lua
- To execute the template generation
:luafile ./lua/nightfox/extras/init.lua
- Commit any files generated in
./extra
Found a new fox? Follow this checklist to capture the fox:
- Create a new
lua
file under./lua/nightfox/colors
folder with the fox's name - Copy the contents of another fox into the file that was created
- Update the color table with new foxes hex colors
- Add the fox's name into the
M.foxes
table in./lua/nightfox/colors/init.lua
These themes were used as references and based off this: