Skip to content

A Green/Gold theme(colorscheme) for Neovim 0.5+ reimplemented in lua from the famous vim theme sainnhe/everforest

License

Notifications You must be signed in to change notification settings

xfyuan/nightforest.nvim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Neovim Nightforest

A colorscheme for Neovim 0.5+ reimplemented in lua from everforest.

Screenshots

Nightforest

nightforest

Dawnforest

dawnforest

Dayforest

dayforest

Support for popular plugins:

Commands

To apply the colorscheme, you can call require('nightforest').colorscheme() from lua or use :colorscheme nightforest command. By default it respects your 'background' (see :h background) setting to choose between dark and light variants. But you can use the :colorscheme nightforest, :colorscheme dayforest, or :colorscheme dawnforest commands to apply a variant directly.

Configuration

To configure the plugin, you can call require('nightforest').setup(values), where values is a dictionary with the parameters you want to override. Here are the defaults:

require('nightforest').setup({
    midnight = false, -- Set to `true` to use `midnight` variant to render a deep dark background.
    overrides = {}, -- A dictionary of group names, each associated with a dictionary of parameters (`bg`, `fg`, `sp` and `style`) and colors in hex.
})

Alternatively, overrides can be a function that returns a dictionary of the same format. You can use the function to override based on a dynamic condition, such as the value of 'background'.

Colorscheme also provides a theme for lualine.nvim. You can set in setup lualine:

require('lualine').setup({
  options = {
    theme = 'nightforest',
  },
})

overrides Examples

  1. Replace IncSearch group with foreground set to #FFFFFF:
require('nightforest').setup({
  overrides = {
    IncSearch = { fg = '#FFFFFF' }
  }
})
  1. Change the background color of non-active windows to make the active one more obvious, specifying overrides for both light and dark backgrounds:
require 'nightforest'.setup({
  overrides = function()
    if vim.o.background == 'dark' then
      return { NormalNC = {bg = '#0f151e', fg = '#808080'} }
    else
      return { NormalNC = {bg = '#f0f0f0', fg = '#808080'} }
    end
  end
})

Tip: You can use :source $VIMRUNTIME/syntax/hitest.vim to see all highlighting groups.

  1. To get the colors from the colorscheme you can use nightforest.colors:
local colors = require('nightforest.colors')
colors.generate() -- Pass `true` to enable midnight

require('nightforest').setup({
  overrides = {
    IncSearch = { fg = colors.fg }
  }
})

Tip: You can use :lua print(vim.inspect(require('nightforest.colors'))) command to check all available colors.

Inspiration

The following themes were used as an inspiration:

About

A Green/Gold theme(colorscheme) for Neovim 0.5+ reimplemented in lua from the famous vim theme sainnhe/everforest

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages