-- Plan9 colorscheme for Neovim
-- Plan 9 / Acme cream background with syntax highlighting
-- Inspired by john2x/plan9-theme.el for Emacs
-- Light theme with muted, earthy colors on #FFFFEA cream
local M = {}
local colors = {
-- Base
bg = "#ffffea",
bg_dim = "#efeed8",
bg_dark = "#e8e8c8",
bg_highlight = "#e8eb98",
fg = "#424242",
fg_dim = "#888888",
fg_faint = "#b8b09a",
-- Acme tag bar
tagbar = "#aeeeee",
tagbar_inactive = "#eaffff",
-- Syntax
comment = "#998f6a",
string = "#b85c57",
keyword = "#2a5db0",
func = "#4a7582",
type = "#1a7f53",
const = "#7a4f30",
preproc = "#5f7f8f",
special = "#6f5f90",
operator = "#555555",
-- Status
error = "#b85c57",
warn = "#8f7634",
info = "#57864e",
hint = "#2a8dc5",
-- Git
git_add = "#57864e",
git_change = "#8f7634",
git_delete = "#b85c57",
-- Diff
diff_add = "#d5ebd0",
diff_delete = "#ebd0d0",
diff_change = "#ebe8d0",
diff_text = "#d8d5b0",
-- UI
selection = "#e8eb98",
cursor_line = "#f5f5d0",
border = "#c8c8a8",
line_nr = "#b0a888",
}
function M.setup()
vim.cmd("hi clear")
if vim.fn.exists("syntax_on") then
vim.cmd("syntax reset")
end
vim.o.background = "light"
vim.g.colors_name = "plan9"
local hi = function(group, opts)
vim.api.nvim_set_hl(0, group, opts)
end
-- Editor
hi("Normal", { fg = colors.fg, bg = colors.bg })
hi("NormalFloat", { fg = colors.fg, bg = colors.bg_dim })
hi("FloatBorder", { fg = colors.border, bg = colors.bg_dim })
hi("Cursor", { fg = colors.bg, bg = colors.fg })
hi("CursorLine", { bg = colors.cursor_line })
hi("CursorLineNr", { fg = colors.fg, bg = colors.cursor_line, bold = true })
hi("CursorColumn", { bg = colors.cursor_line })
hi("LineNr", { fg = colors.line_nr })
hi("SignColumn", { bg = colors.bg })
hi("ColorColumn", { bg = colors.bg_dim })
hi("VertSplit", { fg = colors.border, bg = colors.bg })
hi("WinSeparator", { fg = colors.border, bg = colors.bg })
hi("Folded", { fg = colors.fg_dim, bg = colors.bg_dim })
hi("FoldColumn", { fg = colors.line_nr, bg = colors.bg })
hi("NonText", { fg = colors.border })
hi("SpecialKey", { fg = colors.border })
hi("EndOfBuffer", { fg = colors.bg_dim })
hi("MatchParen", { fg = colors.fg, bg = colors.bg_highlight, bold = true })
hi("Directory", { fg = colors.func, bold = true })
hi("Title", { fg = colors.keyword, bold = true })
hi("Conceal", { fg = colors.fg_dim })
-- Selection
hi("Visual", { bg = colors.selection })
hi("VisualNOS", { bg = colors.selection })
-- Search
hi("Search", { fg = colors.fg, bg = colors.bg_highlight, bold = true })
hi("IncSearch", { fg = colors.bg, bg = colors.keyword, bold = true })
hi("CurSearch", { fg = colors.bg, bg = colors.keyword, bold = true })
-- Spell
hi("SpellBad", { undercurl = true, sp = colors.error })
hi("SpellCap", { undercurl = true, sp = colors.info })
hi("SpellRare", { undercurl = true, sp = colors.hint })
hi("SpellLocal", { undercurl = true, sp = colors.warn })
-- Statusline
hi("StatusLine", { fg = colors.fg, bg = colors.tagbar, bold = true })
hi("StatusLineNC", { fg = colors.fg_dim, bg = colors.tagbar_inactive })
hi("TabLine", { fg = colors.fg_dim, bg = colors.bg_dim })
hi("TabLineFill", { bg = colors.bg_dim })
hi("TabLineSel", { fg = colors.fg, bg = colors.bg, bold = true })
hi("WinBar", { fg = colors.fg, bg = colors.bg })
hi("WinBarNC", { fg = colors.fg_dim, bg = colors.bg_dim })
-- Popup menu
hi("Pmenu", { fg = colors.fg, bg = colors.bg_dim })
hi("PmenuSel", { fg = colors.fg, bg = colors.selection, bold = true })
hi("PmenuSbar", { bg = colors.bg_dark })
hi("PmenuThumb", { bg = colors.border })
-- Messages
hi("ErrorMsg", { fg = colors.error, bold = true })
hi("WarningMsg", { fg = colors.warn, bold = true })
hi("ModeMsg", { fg = colors.fg, bold = true })
hi("MoreMsg", { fg = colors.info, bold = true })
hi("Question", { fg = colors.info })
-- Diagnostics
hi("DiagnosticError", { fg = colors.error })
hi("DiagnosticWarn", { fg = colors.warn })
hi("DiagnosticInfo", { fg = colors.info })
hi("DiagnosticHint", { fg = colors.hint })
hi("DiagnosticUnderlineError", { undercurl = true, sp = colors.error })
hi("DiagnosticUnderlineWarn", { undercurl = true, sp = colors.warn })
hi("DiagnosticUnderlineInfo", { undercurl = true, sp = colors.info })
hi("DiagnosticUnderlineHint", { undercurl = true, sp = colors.hint })
-- Diff
hi("DiffAdd", { bg = colors.diff_add })
hi("DiffDelete", { bg = colors.diff_delete })
hi("DiffChange", { bg = colors.diff_change })
hi("DiffText", { bg = colors.diff_text })
-- Syntax (colored — Plan 9 inspired palette)
hi("Comment", { fg = colors.comment, italic = true })
hi("Constant", { fg = colors.const })
hi("String", { fg = colors.string })
hi("Character", { fg = colors.string })
hi("Number", { fg = colors.const })
hi("Boolean", { fg = colors.const })
hi("Float", { fg = colors.const })
hi("Identifier", { fg = colors.fg })
hi("Function", { fg = colors.func })
hi("Statement", { fg = colors.keyword })
hi("Conditional", { fg = colors.keyword })
hi("Repeat", { fg = colors.keyword })
hi("Label", { fg = colors.keyword })
hi("Operator", { fg = colors.operator })
hi("Keyword", { fg = colors.keyword, italic = true })
hi("Exception", { fg = colors.error })
hi("PreProc", { fg = colors.preproc })
hi("Include", { fg = colors.preproc })
hi("Define", { fg = colors.preproc })
hi("Macro", { fg = colors.preproc })
hi("PreCondit", { fg = colors.preproc })
hi("Type", { fg = colors.type })
hi("StorageClass", { fg = colors.type })
hi("Structure", { fg = colors.type })
hi("Typedef", { fg = colors.type })
hi("Special", { fg = colors.special })
hi("SpecialChar", { fg = colors.special })
hi("Tag", { fg = colors.func })
hi("Delimiter", { fg = colors.operator })
hi("SpecialComment", { fg = colors.comment, bold = true })
hi("Debug", { fg = colors.error })
hi("Underlined", { fg = colors.hint, underline = true })
hi("Ignore", { fg = colors.fg_faint })
hi("Error", { fg = colors.error, bold = true })
hi("Todo", { fg = colors.bg, bg = colors.warn, bold = true })
-- Treesitter
hi("@variable", { fg = colors.fg })
hi("@variable.builtin", { fg = colors.special })
hi("@variable.parameter", { fg = colors.fg })
hi("@variable.member", { fg = colors.fg })
hi("@constant", { fg = colors.const })
hi("@constant.builtin", { fg = colors.const })
hi("@module", { fg = colors.type })
hi("@label", { fg = colors.keyword })
hi("@string", { fg = colors.string })
hi("@string.documentation", { fg = colors.comment })
hi("@string.escape", { fg = colors.special })
hi("@string.special", { fg = colors.special })
hi("@character", { fg = colors.string })
hi("@number", { fg = colors.const })
hi("@boolean", { fg = colors.const })
hi("@float", { fg = colors.const })
hi("@function", { fg = colors.func })
hi("@function.builtin", { fg = colors.func })
hi("@function.call", { fg = colors.func })
hi("@function.macro", { fg = colors.preproc })
hi("@method", { fg = colors.func })
hi("@method.call", { fg = colors.func })
hi("@constructor", { fg = colors.type })
hi("@parameter", { fg = colors.fg })
hi("@keyword", { fg = colors.keyword, italic = true })
hi("@keyword.function", { fg = colors.keyword, italic = true })
hi("@keyword.operator", { fg = colors.keyword })
hi("@keyword.return", { fg = colors.keyword, italic = true })
hi("@conditional", { fg = colors.keyword })
hi("@repeat", { fg = colors.keyword })
hi("@exception", { fg = colors.error })
hi("@include", { fg = colors.preproc })
hi("@type", { fg = colors.type })
hi("@type.builtin", { fg = colors.type })
hi("@type.qualifier", { fg = colors.keyword })
hi("@type.definition", { fg = colors.type })
hi("@storageclass", { fg = colors.keyword })
hi("@attribute", { fg = colors.preproc })
hi("@field", { fg = colors.fg })
hi("@property", { fg = colors.fg })
hi("@punctuation.bracket", { fg = colors.operator })
hi("@punctuation.delimiter", { fg = colors.operator })
hi("@punctuation.special", { fg = colors.special })
hi("@comment", { fg = colors.comment, italic = true })
hi("@tag", { fg = colors.func })
hi("@tag.attribute", { fg = colors.type })
hi("@tag.delimiter", { fg = colors.operator })
hi("@text", { fg = colors.fg })
hi("@text.strong", { fg = colors.fg, bold = true })
hi("@text.emphasis", { fg = colors.fg, italic = true })
hi("@text.underline", { fg = colors.fg, underline = true })
hi("@text.strike", { fg = colors.fg, strikethrough = true })
hi("@text.title", { fg = colors.keyword, bold = true })
hi("@text.literal", { fg = colors.string })
hi("@text.uri", { fg = colors.hint, underline = true })
hi("@text.todo", { fg = colors.bg, bg = colors.warn, bold = true })
hi("@text.note", { fg = colors.bg, bg = colors.info, bold = true })
hi("@text.warning", { fg = colors.bg, bg = colors.warn, bold = true })
hi("@text.danger", { fg = colors.bg, bg = colors.error, bold = true })
-- LSP
hi("LspReferenceText", { bg = colors.selection })
hi("LspReferenceRead", { bg = colors.selection })
hi("LspReferenceWrite", { bg = colors.selection })
hi("LspSignatureActiveParameter", { fg = colors.keyword, bold = true })
-- Git signs
hi("GitSignsAdd", { fg = colors.git_add })
hi("GitSignsChange", { fg = colors.git_change })
hi("GitSignsDelete", { fg = colors.git_delete })
hi("GitSignsCurrentLineBlame", { fg = colors.fg_faint, italic = true })
-- Telescope
hi("TelescopeBorder", { fg = colors.border })
hi("TelescopePromptBorder", { fg = colors.border })
hi("TelescopeResultsBorder", { fg = colors.border })
hi("TelescopePreviewBorder", { fg = colors.border })
hi("TelescopeSelection", { bg = colors.selection })
hi("TelescopeSelectionCaret", { fg = colors.keyword, bg = colors.selection })
hi("TelescopeMatching", { fg = colors.string, bold = true })
-- NeoTree
hi("NeoTreeNormal", { fg = colors.fg, bg = colors.bg_dim })
hi("NeoTreeNormalNC", { fg = colors.fg, bg = colors.bg_dim })
hi("NeoTreeDirectoryName", { fg = colors.func, bold = true })
hi("NeoTreeDirectoryIcon", { fg = colors.func })
hi("NeoTreeRootName", { fg = colors.keyword, bold = true })
hi("NeoTreeFileName", { fg = colors.fg })
hi("NeoTreeGitAdded", { fg = colors.git_add })
hi("NeoTreeGitModified", { fg = colors.git_change })
hi("NeoTreeGitDeleted", { fg = colors.git_delete })
-- Which-key
hi("WhichKey", { fg = colors.func })
hi("WhichKeyGroup", { fg = colors.keyword })
hi("WhichKeyDesc", { fg = colors.fg })
hi("WhichKeySeparator", { fg = colors.fg_faint })
hi("WhichKeyFloat", { bg = colors.bg_dim })
-- Indent blankline
hi("IndentBlanklineChar", { fg = colors.bg_dark })
hi("IndentBlanklineContextChar", { fg = colors.border })
hi("IblIndent", { fg = colors.bg_dark })
hi("IblScope", { fg = colors.border })
-- Notify
hi("NotifyERRORBorder", { fg = colors.error })
hi("NotifyWARNBorder", { fg = colors.warn })
hi("NotifyINFOBorder", { fg = colors.info })
hi("NotifyDEBUGBorder", { fg = colors.fg_faint })
hi("NotifyTRACEBorder", { fg = colors.hint })
hi("NotifyERRORIcon", { fg = colors.error })
hi("NotifyWARNIcon", { fg = colors.warn })
hi("NotifyINFOIcon", { fg = colors.info })
hi("NotifyDEBUGIcon", { fg = colors.fg_faint })
hi("NotifyTRACEIcon", { fg = colors.hint })
hi("NotifyERRORTitle", { fg = colors.error })
hi("NotifyWARNTitle", { fg = colors.warn })
hi("NotifyINFOTitle", { fg = colors.info })
hi("NotifyDEBUGTitle", { fg = colors.fg_faint })
hi("NotifyTRACETitle", { fg = colors.hint })
-- Dashboard
hi("DashboardHeader", { fg = colors.func })
hi("DashboardCenter", { fg = colors.fg })
hi("DashboardFooter", { fg = colors.fg_faint })
hi("DashboardShortCut", { fg = colors.keyword })
-- Lazy
hi("LazyButton", { fg = colors.fg, bg = colors.bg_dim })
hi("LazyButtonActive", { fg = colors.fg, bg = colors.selection, bold = true })
hi("LazyH1", { fg = colors.keyword, bold = true })
hi("LazySpecial", { fg = colors.func })
-- Mini
hi("MiniStatuslineModeNormal", { fg = colors.bg, bg = colors.func, bold = true })
hi("MiniStatuslineModeInsert", { fg = colors.bg, bg = colors.type, bold = true })
hi("MiniStatuslineModeVisual", { fg = colors.bg, bg = colors.keyword, bold = true })
hi("MiniStatuslineModeReplace", { fg = colors.bg, bg = colors.error, bold = true })
hi("MiniStatuslineModeCommand", { fg = colors.bg, bg = colors.const, bold = true })
-- Bufferline
hi("BufferLineFill", { bg = colors.bg_dim })
hi("BufferLineBackground", { fg = colors.fg_dim, bg = colors.bg_dim })
hi("BufferLineBuffer", { fg = colors.fg_dim, bg = colors.bg_dim })
hi("BufferLineBufferSelected", { fg = colors.fg, bg = colors.bg, bold = true })
hi("BufferLineBufferVisible", { fg = colors.fg_dim, bg = colors.bg_dim })
hi("BufferLineCloseButton", { fg = colors.fg_dim, bg = colors.bg_dim })
hi("BufferLineCloseButtonSelected", { fg = colors.error, bg = colors.bg })
hi("BufferLineCloseButtonVisible", { fg = colors.fg_dim, bg = colors.bg_dim })
hi("BufferLineIndicatorSelected", { fg = colors.func, bg = colors.bg })
hi("BufferLineModified", { fg = colors.warn, bg = colors.bg_dim })
hi("BufferLineModifiedSelected", { fg = colors.warn, bg = colors.bg })
hi("BufferLineSeparator", { fg = colors.bg_dim, bg = colors.bg_dim })
hi("BufferLineSeparatorSelected", { fg = colors.bg_dim, bg = colors.bg })
-- Copilot
hi("CopilotSuggestion", { fg = colors.fg_faint })
end
M.setup()
return M