Neovim
Neovim can be themed using the Noctalia via the base16 colorscheme.
-
Enable User Templates in Noctalia:
- Open Settings → Color Scheme → Templates → Advanced → Enable User Templates
-
Add a user template for neovim
- Copy this into
/.config/noctalia/user-templates.toml
[templates.nvim-base16]input_path = "~/.config/nvim/lua/matugen-template.lua"output_path = "~/.config/nvim/lua/matugen.lua"post_hook = 'pkill -SIGUSR1 nvim' - Copy this into
-
Install the
base16colorscheme by RRethy, using your package manager of choice. e.g. with Lazy:return { 'RRethy/base16-nvim',config = function()require('matugen').setup()end,} -
Add the template to your neovim configuration: Add the following file to you neovim configuration (in
~/.config/nvim/lua/matugen-template.lua, as above):local M = {}function M.setup()require('base16-colorscheme').setup {-- Background tonesbase00 = '{{colors.surface.default.hex}}', -- Default Backgroundbase01 = '{{colors.surface_container.default.hex}}', -- Lighter Background (status bars)base02 = '{{colors.surface_container_high.default.hex}}', -- Selection Backgroundbase03 = '{{colors.outline.default.hex}}', -- Comments, Invisibles-- Foreground tonesbase04 = '{{colors.on_surface_variant.default.hex}}', -- Dark Foreground (status bars)base05 = '{{colors.on_surface.default.hex}}', -- Default Foregroundbase06 = '{{colors.on_surface.default.hex}}', -- Light Foregroundbase07 = '{{colors.on_background.default.hex}}', -- Lightest Foreground-- Accent colorsbase08 = '{{colors.error.default.hex}}', -- Variables, XML Tags, Errorsbase09 = '{{colors.tertiary.default.hex}}', -- Integers, Constantsbase0A = '{{colors.secondary.default.hex}}', -- Classes, Search Backgroundbase0B = '{{colors.primary.default.hex}}', -- Strings, Diff Insertedbase0C = '{{colors.tertiary_fixed_dim.default.hex}}', -- Regex, Escape Charsbase0D = '{{colors.primary_fixed_dim.default.hex}}', -- Functions, Methodsbase0E = '{{colors.secondary_fixed_dim.default.hex}}', -- Keywords, Storagebase0F = '{{colors.error_container.default.hex}}', -- Deprecated, Embedded Tags}end-- Register a signal handler for SIGUSR1 (matugen updates)local signal = vim.uv.new_signal()signal:start('sigusr1',vim.schedule_wrap(function()package.loaded['matugen'] = nilrequire('matugen').setup()end))return MThe
setupfunction applies the theme, while thesignalhandler clears the old theme module out of the lua cache, then applies the new theme, whenever nvim is signalled withSIGUSR1. -
Setup base16 in your init.lua
require('matugen').setup()
When you restart neovim, it should use your noctalia theme.