Skip to content

akthe-at/carbon.nvim

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Carbon.nvim

Welcome to Carbon

A modern Lua-based Neovim colorscheme based on the Carbon theme for IntelliJ IDEs by Luis Fernando Jiménez.

This is a rewrite of michaeldyrynda/carbon.vim with full Lua implementation, Treesitter support, and extensive plugin integrations.

Features

  • Modern Lua-based implementation for Neovim
  • Dark and Light variants (carbon, carbon-day)
  • Treesitter support
  • LSP semantic highlighting
  • Plugin integrations (Telescope, NvimTree, Neo-tree, WhichKey, Cmp, and more)
  • Lualine theme included
  • Ghostty terminal theme included
  • Customizable colors and highlight groups
  • Terminal colors support

Requirements

  • Neovim >= 0.8.0
  • termguicolors enabled

Installation

Using lazy.nvim (recommended)

{
  "akthe-at/carbon.nvim",
  lazy = false,
  priority = 1000,
  config = function()
    require("carbon").setup({
      -- your configuration comes here
      -- or leave it empty to use the default settings
    })
    vim.cmd.colorscheme("carbon")
  end,
}

Using packer.nvim

use({
	"akthe-at/carbon.nvim",
	config = function()
		require("carbon").setup()
		vim.cmd.colorscheme("carbon")
	end,
})

Using vim-plug

Plug 'akthe-at/carbon.nvim'

Then add to your config:

require("carbon").setup()
vim.cmd.colorscheme("carbon")

Manual Installation

Clone the repository and add to your runtime path:

git clone https://github.com/akthe-at/carbon.nvim ~/.local/share/nvim/site/pack/plugins/start/carbon.nvim

Configuration

Carbon comes with sensible defaults, but you can customize it:

require("carbon").setup({
	style = "carbon", -- "auto", "carbon", "carbon_contrast", "carbon_day", "carbon_day_neutral", "carbon_day_contrast"
	dark_variant = "carbon", -- Used when style = "auto"
	light_variant = "carbon_day", -- Used when style = "auto"
	transparent = false, -- Enable transparent background
	terminal_colors = true, -- Enable terminal colors
	dim_inactive = false, -- Dim inactive windows

	styles = {
		comments = { italic = true },
		keywords = {},
		functions = { bold = true },
		variables = {},
		properties = { bold = true },
	},

	groups = {
		border = "border",
		panel = "cursor_line_bg",
		link = "link",
		error = "error",
		warning = "warning",
		info = "info",
		hint = "hint",
		ok = "git_add",
		todo = "html_tag",
	},

	-- Override colors
	on_colors = function(colors)
		colors.bg = "#1a1a1a"
	end,

	-- Override highlight groups
	on_highlights = function(highlights, colors)
		highlights.Keyword = { fg = colors.keyword, italic = true }
	end,

	-- Customize highlights before they are applied
	before_highlight = function(group, highlight, colors)
		-- highlight.undercurl = false
	end,
})

vim.cmd.colorscheme("carbon")

Theme Variants

Carbon includes dark, light, and contrast variants:

  • carbon (default dark)
  • carbon_contrast (high contrast dark)
  • carbon_day (light)
  • carbon_day_neutral (cool neutral light)
  • carbon_day_contrast (high contrast light)

The active colors_name matches the chosen style (e.g. carbon-contrast, carbon-day-neutral), so other plugins can detect the exact variant.

Use style = "auto" to follow vim.o.background, or set a specific style:

require("carbon").setup({
	style = "carbon_day",
})
vim.cmd.colorscheme("carbon")

Light variants also work with:

vim.cmd.colorscheme("carbon-day")
vim.cmd.colorscheme("carbon-day-neutral")
vim.cmd.colorscheme("carbon-day-contrast")

Dark variants can also be loaded via:

vim.cmd.colorscheme("carbon-contrast")

Lualine Integration

Carbon includes a lualine theme that matches the colorscheme:

require("lualine").setup({
	options = {
		theme = "carbon",
	},
})

Ghostty Terminal Theme

Carbon includes theme files for the Ghostty terminal emulator.

Installation

Copy the theme file to your Ghostty config directory:

# For dark theme
cp ~/.local/share/nvim/lazy/carbon.nvim/extras/ghostty/carbon ~/.config/ghostty/themes/

# For light theme
cp ~/.local/share/nvim/lazy/carbon.nvim/extras/ghostty/carbon-day ~/.config/ghostty/themes/

Then add to your Ghostty config (~/.config/ghostty/config):

theme = carbon
# or
theme = carbon-day

Plugin Support

Carbon includes highlight groups for popular plugins:

Screenshots

Go Sample Go

Light Go Sample Go - Light Variant

Lua Sample, with picker shown Lua w/ a floating window

Light Lua Sample Lua - Light Variant

Python Sample Python

Light Python Sample Python - Light Variant

Credits

License

Apache License 2.0

See NOTICE for attribution details.

About

A lua port of a vim port of the IntelliJ Carbon theme

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Lua 100.0%