A customisable theme for Neovim with support for popular Neovim plugins. Written in Lua.
-
Extensible user configuration.
-
Integration with popular Vim/Neovim plugins.
-
Change configuration settings on the fly with the
:Tundra
command.
- Neovim v0.7.0 or higher.
Important
Some plugin integrations require Neovim v0.8. If your Neovim version doesn't support a plugin integration, Tundra displays a warning message when enabling that integration. Use Neovim v0.8.0 or higher, or downgrade to Tundra v0.1.0 to avoid warning messages.
- A terminal with true colour support.
Note
The default macOS terminal doesn't support true colour. Use a terminal that supports true colour such as iTerm2.
Install Tundra with your favourite package manager.
use 'sam4llis/nvim-tundra' -- packer.nvim
Plug 'sam4llis/nvim-tundra' " vim-plug
To use Tundra's default configuration, add the following to your Neovim configuration:
vim.g.tundra_biome = 'arctic' -- 'arctic' or 'jungle'
vim.opt.background = 'dark'
vim.cmd('colorscheme tundra')
Tundra provides a setup
function to overwrite default settings. Omitted fields
in the setup
function default to their respective default configuration
setting. The creator of Tundra recommends the following configuration as a
starting point:
require('nvim-tundra').setup({
transparent_background = false,
dim_inactive_windows = {
enabled = false,
color = nil,
},
sidebars = {
enabled = true,
color = nil,
},
editor = {
search = {},
substitute = {},
},
syntax = {
booleans = { bold = true, italic = true },
comments = { bold = true, italic = true },
conditionals = {},
constants = { bold = true },
fields = {},
functions = {},
keywords = {},
loops = {},
numbers = { bold = true },
operators = { bold = true },
punctuation = {},
strings = {},
types = { italic = true },
},
diagnostics = {
errors = {},
warnings = {},
information = {},
hints = {},
},
plugins = {
lsp = true,
semantic_tokens = true,
treesitter = true,
telescope = true,
nvimtree = true,
cmp = true,
context = true,
dbui = true,
gitsigns = true,
neogit = true,
textfsm = true,
},
overwrite = {
colors = {},
highlights = {},
},
})
vim.g.tundra_biome = 'arctic' -- 'arctic' or 'jungle'
vim.opt.background = 'dark'
vim.cmd('colorscheme tundra')
You must invoke the setup
function before the :colorscheme tundra
command to
respect your configuration settings.
Note
You can omit empty tables and nil
fields in the configuration table to
respect default settings.
lualine.nvim
To use the Tundra integration for lualine.nvim
, add the following to your
Neovim configuration:
require('lualine').setup({
options = {
-- ...
theme = 'tundra',
-- ...
},
})
-
transparent_background
(boolean): If true, certain highlight groups inherit a transparent background. Defaults tofalse
. -
dim_inactive_windows
(table):-
enabled
(boolean): If true, non-current windows inherit the background colourcolor
. Defaults tofalse
. -
color
(string | nil): A hexadecimal colour value or colour keyword that the background of non-current windows inherits. If nil, non-current windows use the default colour for dimmed windows. Defaults tonil
.
-
-
sidebars
(table):-
enabled
(boolean): If true, all 'sidebar' windows (outlined below) inherit the background colourcolor
. Defaults tofalse
. -
color
(string | nil): A hexadecimal colour value or colour keyword that the background of 'sidebar' windows inherits. If nil, all 'sidebar' windows use the default colour for 'sidebar' windows. Defaults tonil
. -
filetypes
(array[str] table): Defines filetypes treated as 'sidebar' windows. Leavingfiletypes
as an empty table inherits the default filetypes. Adding a filetype tofiletypes
overwrites the default filetypes. Defaults tosidebars.filetypes
.
-
Note
You can toggle general settings using the :Tundra
command line sugar.
The plugins
subtable in the Tundra setup function activates
plugin-specific highlight groups for supported plugins.
The base configuration implicitly enables native LSP and nvim-treesitter by
default. Enabling other supported plugins requires a setup
function call.
For example, to use Tundra's telescope.nvim highlight groups:
require('nvim-tundra').setup({
-- ...
plugins = {
telescope = true,
},
-- ...
})
In the preceding example configuration the editor
, syntax
,
and diagnostics
subtables provide an interface to overwrite styles for
specific elements. Each field within these subtables can accept any key from
h: highlight args
as a boolean.
-
A common use-case for
editor
subtable involves reversing the highlight groups for thesearch
andsubstitute
fields by adding areverse = true
flag to the respective field. -
Conventionally, syntactic elements like booleans and functions use the
syntax
subtable to add key-value pairs such asbold = true
anditalic = true
. -
A common use-case for the
diagnostic
subtable involves changing the foreground or background colour of diagnostic groups using the respectivefg = '<HEX_VALUE>'
orbg = '<HEX_VALUE>'
flags.
You can change Tundra configuration settings in real-time using the :Tundra
command.
-
:Tundra toggle_transparency
: Toggles thetransparent_background
option specified in the Tundrasetup
function. -
:Tundra toggle_dim
: Toggles thedim_inactive_windows.enabled
option specified in the Tundrasetup
function. -
:Tundra toggle_sidebars
: Toggles thesidebars.enabled
option specified in the Tundrasetup
function.
Overwriting syntax groups
The syntax
subtable in Tundra's setup
function can accept foreground or
background colours to overwrite syntax highlight groups. As an example, if you
want to change boolean elements from an orange
shade to an indigo
shade, you
can add the following to the setup
function in your configuration:
local cp = require('nvim-tundra.palette.arctic')
require('nvim-tundra').setup({
-- ...
syntax = {
-- ...
booleans = { fg = cp.indigo._400, bold = true, italic = true },
-- ...
},
-- ...
})
The fg
and bg
flags also accept hexadecimal values if you want to add your
own colours.
Colour shades in Tundra palettes range from
0
to1000
. These numbers represent the lightest and darkest shades of each colour. Shades typically increment in values of100
.
Overwriting Tundra colours
To change a particular colour in the Tundra theme, add it to the
overwrite.colors
subtable in the Tundra setup
function. As an example, if
you want to change the sky._500
colour to a custom shade of blue, you can add
the following to the setup
function in your configuration:
require('nvim-tundra').setup({
-- ...
overwrite = {
colors = {
sky = {
_500 = '#6EABCF', -- An `ocean` colour instead of `sky`.
},
},
},
-- ...
})
Overwriting highlight groups
To change a highlight group in the Tundra theme, add it to the
overwrite.highlights
subtable in the Tundra setup
function. As an example,
if you want to change the @field
treesitter highlight group to have a bold and
red foreground you can add the following to the setup
function in your
configuration:
local cp = require('nvim-tundra.palette.arctic')
require('nvim-tundra').setup({
-- ...
overwrite = {
highlights = {
['@field'] = { fg = cp.red._400, bold = true },
},
},
-- ...
})
Highlights defined in the
overwrite.highlights
subtable take precedence over highlights defined in theeditor
andsyntax
subtables in Tundra'ssetup
function.
The extras folder of this repository contains configurations for Alacritty, fzf, iTerm-2, Kitty, WezTerm, and Windows Terminal. To use these configurations, refer to the respective documentation.
- nvim-lspconfig
- nvim-treesitter
- nvim-treesitter-context
- gitsigns.nvim
- nvim-cmp
- telescope.nvim
- vim-dadbod-ui
- nvim-tree
- lualine.nvim
- Neogit
- vim-textfsm
-
The Catppuccin colorscheme for Neovim, for inspiring the extensible user configuration options for Tundra.
-
The Nightfox colorscheme for Neovim, for inspiring the distinction between colors and palettes for Tundra.
-
The NvChad configuration, for inspiring the UI and highlight groups for Telescope.
-
Logo inspired from the artist RNH.