### Full Configuration Example Source: https://context7.com/folke/tokyonight.nvim/llms.txt A comprehensive example demonstrating various configuration options for the tokyonight.nvim theme, including style, transparency, terminal colors, and plugin settings. ```lua require("tokyonight").setup({ -- Theme style: "moon", "storm", "night", or "day" style = "moon", -- Style used when background is set to light light_style = "day", -- Enable transparent background transparent = false, -- Configure terminal colors terminal_colors = true, -- Syntax highlighting styles styles = { comments = { italic = true }, keywords = { italic = true }, functions = {}, variables = {}, -- Background styles: "dark", "transparent", or "normal" sidebars = "dark", floats = "dark", }, -- Day theme brightness (0-1) day_brightness = 0.3, -- Dim inactive windows dim_inactive = false, -- Bold lualine section headers lualine_bold = false, -- Enable caching for performance cache = true, -- Plugin configuration plugins = { all = package.loaded.lazy == nil, auto = true, -- telescope = true, -- manually enable specific plugins }, }) ``` -------------------------------- ### Load Style via Setup and Vim Command Source: https://context7.com/folke/tokyonight.nvim/llms.txt Configures the theme to a specific style ('storm') via the setup function and then applies it using a Vim command. ```lua require("tokyonight").setup({ style = "storm" }) vim.cmd[[colorscheme tokyonight]] ``` -------------------------------- ### Setup tokyonight.nvim with Custom Style and Colors Source: https://github.com/folke/tokyonight.nvim/blob/main/doc/tokyonight.nvim.txt This example demonstrates how to set up the tokyonight.nvim theme with the 'night' style, disable italic functions, and override specific colors using the `on_colors` callback. The 'hint' color is changed to 'orange', and 'error' is set to bright red. ```lua require("tokyonight").setup({ -- use the night style style = "night", -- disable italic for functions styles = { functions = {} }, -- Change the "hint" color to the "orange" color, and make the "error" color bright red on_colors = function(colors) colors.hint = colors.orange colors.error = "#ff0000" end }) ``` -------------------------------- ### Install TokyoNight.nvim with lazy.nvim Source: https://github.com/folke/tokyonight.nvim/blob/main/doc/tokyonight.nvim.txt Install the theme using the folke/lazy.nvim package manager. Ensure to set a high priority to load the theme correctly. ```lua { "folke/tokyonight.nvim", lazy = false, priority = 1000, opts = {}, } ``` -------------------------------- ### List Installed Ghostty Themes Source: https://github.com/folke/tokyonight.nvim/blob/main/extras/ghostty/README.md Use this command to view all themes currently available in your Ghostty installation. ```bash ghostty +list-themes ``` -------------------------------- ### Configure Lightline (Vimscript) Source: https://context7.com/folke/tokyonight.nvim/llms.txt Configure the Lightline statusline plugin in Vimscript to use the TokyoNight colorscheme. This includes basic setup and an extended configuration example. ```vim " Basic lightline configuration let g:lightline = {'colorscheme': 'tokyonight'} " Extended configuration let g:lightline = { \ 'colorscheme': 'tokyonight', \ 'active': { \ 'left': [ [ 'mode', 'paste' ], \ [ 'gitbranch', 'readonly', 'filename', 'modified' ] ] \ }, \ 'component_function': { \ 'gitbranch': 'FugitiveHead' \ }, \ } ``` -------------------------------- ### Example Plugin Highlight Group Definition Source: https://github.com/folke/tokyonight.nvim/blob/main/CONTRIBUTING.md A concrete example of defining highlight groups for a plugin. It demonstrates setting foreground and background colors, and linking to existing groups. ```lua local M = {} M.url = "https://github.com/author/plugin-name" ---@type tokyonight.HighlightsFn function M.get(c, opts) -- stylua: ignore return { PluginHighlight1 = { fg = c.blue }, PluginHighlight2 = { fg = c.green, bg = c.bg_dark }, -- ... more highlight groups } end return M ``` -------------------------------- ### Configure Barbecue with TokyoNight Source: https://github.com/folke/tokyonight.nvim/blob/main/doc/tokyonight.nvim.txt Integrate TokyoNight.nvim with the barbecue plugin by setting the 'theme' option to 'tokyonight' in the barbecue setup. ```lua -- Lua require('barbecue').setup { -- ... your barbecue config theme = 'tokyonight', -- ... your barbecue config } ``` -------------------------------- ### Configure Ghostty Theme Source: https://github.com/folke/tokyonight.nvim/blob/main/extras/ghostty/README.md Specify the desired theme in your Ghostty configuration file. Ensure the theme name matches an installed theme. ```ini theme = "tokyonight_night" ``` -------------------------------- ### Install Pygments Extra with uv tool Source: https://github.com/folke/tokyonight.nvim/blob/main/extras/aider/README.md Use this command to install the Tokyo Night Pygments extra for aider, enabling markdown syntax highlighting. Ensure you are using the correct Python environment. ```bash uv tool install --force --python python3.12 aider-chat@latest --with git+https://github.com/folke/tokyonight.nvim.git@main#subdirectory=extras/pygments ``` -------------------------------- ### Customize Telescope UI with TokyoNight.nvim Source: https://github.com/folke/tokyonight.nvim/blob/main/README.md This example demonstrates how to customize the appearance of the Telescope plugin within tokyonight.nvim by overriding specific highlight groups using the `on_highlights` callback. It sets custom background and foreground colors for various Telescope elements. ```lua require("tokyonight").setup({ on_highlights = function(hl, c) local prompt = "#2d3149" hl.TelescopeNormal = { bg = c.bg_dark, fg = c.fg_dark, } hl.TelescopeBorder = { bg = c.bg_dark, fg = c.bg_dark, } hl.TelescopePromptNormal = { bg = prompt, } hl.TelescopePromptBorder = { bg = prompt, fg = prompt, } hl.TelescopePromptTitle = { bg = prompt, fg = prompt, } hl.TelescopePreviewTitle = { bg = c.bg_dark, fg = c.bg_dark, } hl.TelescopeResultsTitle = { bg = c.bg_dark, fg = c.bg_dark, } end, }) ``` -------------------------------- ### Customizing Telescope UI with tokyonight.nvim Source: https://github.com/folke/tokyonight.nvim/blob/main/doc/tokyonight.nvim.txt This example shows how to customize the appearance of the Telescope plugin within tokyonight.nvim by overriding highlight groups using the `on_highlights` callback. It specifically targets border and prompt elements to match a custom background color. ```lua require("tokyonight").setup({ on_highlights = function(hl, c) local prompt = "#2d3149" hl.TelescopeNormal = { bg = c.bg_dark, fg = c.fg_dark, } hl.TelescopeBorder = { bg = c.bg_dark, fg = c.bg_dark, } hl.TelescopePromptNormal = { bg = prompt, } hl.TelescopePromptBorder = { bg = prompt, fg = prompt, } hl.TelescopePromptTitle = { bg = prompt, fg = prompt, } hl.TelescopePreviewTitle = { bg = c.bg_dark, fg = c.bg_dark, } hl.TelescopeResultsTitle = { bg = c.bg_dark, fg = c.bg_dark, } end, }) ``` -------------------------------- ### Setup Transparent Backgrounds Source: https://context7.com/folke/tokyonight.nvim/llms.txt Enable transparent backgrounds for Normal, sidebars, and float windows. You can configure partial transparency by specifying different styles for sidebars and floats. ```lua require("tokyonight").setup({ transparent = true, styles = { sidebars = "transparent", floats = "transparent", }, }) ``` ```lua -- For partial transparency (sidebars dark, floats transparent) require("tokyonight").setup({ transparent = false, styles = { sidebars = "dark", -- Keep dark sidebars floats = "transparent", -- Transparent floating windows }, }) ``` -------------------------------- ### Configure Borderless Telescope UI Source: https://context7.com/folke/tokyonight.nvim/llms.txt Customize Telescope highlight groups to create a seamless, borderless UI by blending with the background. This setup modifies the normal, border, and prompt sections of Telescope. ```lua require("tokyonight").setup({ on_highlights = function(hl, c) local prompt = "#2d3149" -- Main Telescope windows hl.TelescopeNormal = { bg = c.bg_dark, fg = c.fg_dark, } hl.TelescopeBorder = { bg = c.bg_dark, fg = c.bg_dark, } -- Prompt section hl.TelescopePromptNormal = { bg = prompt } hl.TelescopePromptBorder = { bg = prompt, fg = prompt } hl.TelescopePromptTitle = { bg = prompt, fg = prompt } -- Preview and results titles hl.TelescopePreviewTitle = { bg = c.bg_dark, fg = c.bg_dark } hl.TelescopeResultsTitle = { bg = c.bg_dark, fg = c.bg_dark } end, }) ``` -------------------------------- ### Customize Highlights with on_highlights Source: https://context7.com/folke/tokyonight.nvim/llms.txt Example of using the `on_highlights` callback to fine-tune specific highlight groups like comments, functions, cursor line, and diagnostic colors. ```lua require("tokyonight").setup({ on_highlights = function(hl, c) -- Customize comment style hl.Comment = { fg = c.comment, italic = true, bold = false } -- Make functions stand out more hl.Function = { fg = c.blue, bold = true } -- Custom cursor line hl.CursorLine = { bg = c.bg_highlight } hl.CursorLineNr = { fg = c.orange, bold = true } -- Adjust diagnostic colors hl.DiagnosticError = { fg = c.error } hl.DiagnosticWarn = { fg = c.warning } hl.DiagnosticInfo = { fg = c.info } hl.DiagnosticHint = { fg = c.hint } -- LSP reference highlighting hl.LspReferenceText = { bg = c.bg_visual } hl.LspReferenceRead = { bg = c.bg_visual } hl.LspReferenceWrite = { bg = c.bg_visual, bold = true } end, }) ``` -------------------------------- ### Customize Colors with on_colors Source: https://context7.com/folke/tokyonight.nvim/llms.txt Example of using the `on_colors` callback to customize specific semantic colors, base palette colors, and git colors within the TokyoNight theme. ```lua require("tokyonight").setup({ style = "night", on_colors = function(colors) -- Change specific semantic colors colors.hint = colors.orange colors.error = "#ff0000" -- Modify base palette colors colors.bg = "#1a1b26" colors.fg = "#c0caf5" -- Customize git colors colors.git.add = "#9ece6a" colors.git.change = "#7aa2f7" colors.git.delete = "#f7768e" -- Adjust diff colors colors.diff.add = "#20303b" colors.diff.delete = "#37222c" colors.diff.change = "#1f2335" end }) ``` -------------------------------- ### Configure Lualine with TokyoNight Source: https://context7.com/folke/tokyonight.nvim/llms.txt Integrate TokyoNight theme with the Lualine statusline plugin for consistent styling. This includes basic setup and enabling bold section headers. ```lua -- Basic lualine setup with tokyonight require('lualine').setup({ options = { theme = 'tokyonight', section_separators = { left = '', right = '' }, component_separators = { left = '', right = '' }, }, }) -- Enable bold section headers in TokyoNight config require("tokyonight").setup({ lualine_bold = true, -- Makes section headers bold style = "moon", }) -- For mode-specific colors, TokyoNight provides: -- Normal: blue background -- Insert: green background -- Visual: magenta background -- Replace: red background -- Command: yellow background ``` -------------------------------- ### Configure Lualine with TokyoNight Source: https://github.com/folke/tokyonight.nvim/blob/main/doc/tokyonight.nvim.txt Set the 'theme' option to 'tokyonight' within the lualine setup to apply the TokyoNight theme to the lualine statusline. ```lua -- Lua require('lualine').setup { options = { -- ... your lualine config theme = 'tokyonight' -- ... your lualine config } } ``` -------------------------------- ### Define Plugin Highlight Groups Source: https://github.com/folke/tokyonight.nvim/blob/main/CONTRIBUTING.md Create a Lua module to define highlight groups for a custom plugin. This module should export a `get` function that returns a table of highlight definitions. ```lua local M = {} M.url = "https://github.com/author/cool-finder.nvim" --@type tokyonight.HighlightsFn function M.get(c, opts) -- stylua: ignore return { CoolFinderNormal = { fg = c.fg, bg = c.bg_float }, CoolFinderBorder = { fg = c.border_highlight, bg = c.bg_float }, CoolFinderTitle = { fg = c.blue, bold = true }, CoolFinderMatch = { fg = c.magenta, bold = true }, CoolFinderSelected = { fg = c.fg, bg = c.bg_highlight }, } end return M ``` -------------------------------- ### Access TokyoNight Colors Programmatically Source: https://context7.com/folke/tokyonight.nvim/llms.txt Access the full color palette for use in other plugins or custom configurations using the colors module. This allows for consistent theming across your Neovim setup. ```lua -- Get colors with current configuration local colors = require("tokyonight.colors").setup() -- Access specific colors local bg = colors.bg -- "#222436" (moon style) local fg = colors.fg -- "#c8d3f5" local blue = colors.blue -- "#82aaff" local green = colors.green -- "#c3e88d" local red = colors.red -- "#ff757f" local yellow = colors.yellow -- "#ffc777" local purple = colors.purple -- "#fca7ea" local orange = colors.orange -- "#ff966c" local cyan = colors.cyan -- "#86e1fc" local teal = colors.teal -- "#4fd6be" -- Access semantic colors local error_color = colors.error -- "#c53b53" local warning_color = colors.warning -- "#ffc777" local info_color = colors.info -- "#0db9d7" local hint_color = colors.hint -- "#4fd6be" -- Access git colors local git_add = colors.git.add -- "#b8db87" local git_change = colors.git.change -- "#7ca1f2" local git_delete = colors.git.delete -- "#e26a75" -- Use colors in other plugins require("some_plugin").setup({ background = colors.bg_dark, foreground = colors.fg, accent = colors.blue, }) ``` -------------------------------- ### Use Tokyo Night Colors in HTML Source: https://github.com/folke/tokyonight.nvim/blob/main/extras/tailwindv4/README.md Apply the Tokyo Night theme colors to your HTML elements using Tailwind CSS utility classes. The example shows how to set border, background, and text colors. ```html ``` -------------------------------- ### Use Tokyo Night Colors in Other Plugins Source: https://github.com/folke/tokyonight.nvim/blob/main/README.md Access the Tokyo Night color palette within your Neovim configuration to style other plugins. You can pass configuration options to the setup function and lighten colors using the util.lighten function. ```lua local colors = require("tokyonight.colors").setup() -- pass in any of the config options as explained above local util = require("tokyonight.util") aplugin.background = colors.bg_dark aplugin.my_error = util.lighten(colors.red1, 0.3) -- number between 0 and 1. 0 results in white, 1 results in red1 ``` -------------------------------- ### Build Vivaldi Theme Source: https://github.com/folke/tokyonight.nvim/blob/main/extras/vivaldi/README.md Execute this script from the 'extras/vivaldi' directory to automatically build Vivaldi theme zip files. ```bash ./build ``` -------------------------------- ### Add New Plugin to Group Initialization Source: https://github.com/folke/tokyonight.nvim/blob/main/CONTRIBUTING.md Register a new plugin's highlight group file in the main groups initialization file. The key should be the plugin's repository name, and the value should be the name of the group file. ```lua M.plugins = { -- ... existing plugins ... ["plugin-name"] = "plugin-name", -- key is the plugin repo name, value is the group file name } ``` -------------------------------- ### Load Different Styles via Vim Command Source: https://context7.com/folke/tokyonight.nvim/llms.txt Demonstrates loading different TokyoNight styles directly using Vim commands. ```vim vim.cmd[[colorscheme tokyonight]] -- Load specific styles directly vim.cmd[[colorscheme tokyonight-night]] -- Darker variant vim.cmd[[colorscheme tokyonight-storm]] -- Storm style vim.cmd[[colorscheme tokyonight-day]] -- Light theme vim.cmd[[colorscheme tokyonight-moon]] -- Based on Moonlight theme ``` -------------------------------- ### Register Plugin for Theming Source: https://github.com/folke/tokyonight.nvim/blob/main/CONTRIBUTING.md Add an entry to the `plugins` table in `lua/tokyonight/groups/init.lua` to enable automatic theming for a registered plugin. ```lua M.plugins = { -- ... existing entries ... ["cool-finder.nvim"] = "cool-finder", } ``` -------------------------------- ### Configure Plugin Highlight Groups Source: https://context7.com/folke/tokyonight.nvim/llms.txt Control which plugin highlight groups are loaded. Set 'all' to true to enable all when not using lazy.nvim, or 'auto' to auto-detect loaded plugins with lazy.nvim. Manually enable or disable specific plugins as needed. ```lua require("tokyonight").setup({ plugins = { -- Enable all plugins when not using lazy.nvim all = package.loaded.lazy == nil, -- Auto-detect loaded plugins (lazy.nvim only) auto = true, -- Manually enable specific plugins telescope = true, ["neo-tree"] = true, gitsigns = true, cmp = true, treesitter = true, -- Disable specific plugins dashboard = false, notify = false, }, }) ``` -------------------------------- ### Manually Zip Vivaldi Theme Source: https://github.com/folke/tokyonight.nvim/blob/main/extras/vivaldi/README.md Manually create a Vivaldi theme zip file by renaming a theme JSON to 'settings.json' and zipping it. ```bash zip tokyonight_day.zip settings.json ``` -------------------------------- ### Build Script Execution Source: https://github.com/folke/tokyonight.nvim/blob/main/CONTRIBUTING.md Run the build script from the tokyonight plugin directory to generate theme files for all styles from your extra templates. ```sh ./scripts/build ``` -------------------------------- ### Run Test Suite Source: https://github.com/folke/tokyonight.nvim/blob/main/CONTRIBUTING.md Execute the test suite to ensure changes do not break existing functionality. This includes loading, highlight group generation, and plugin integration tests. ```sh ./scripts/test ``` -------------------------------- ### Clone tokyonight.nvim Repository Source: https://github.com/folke/tokyonight.nvim/blob/main/extras/vim/README.md Clone the repository to your desired projects directory. This command downloads the color scheme files. ```sh git clone https://github.com/folke/tokyonight.nvim ~/projects/tokyonight.nvim ``` -------------------------------- ### Apply TokyoNight.nvim Styles Source: https://github.com/folke/tokyonight.nvim/blob/main/doc/tokyonight.nvim.txt Use the 'colorscheme' command to apply different styles of the TokyoNight theme, such as night, storm, day, and moon. ```vim colorscheme tokyonight " There are also colorschemes for the different styles. colorscheme tokyonight-night colorscheme tokyonight-storm colorscheme tokyonight-day colorscheme tokyonight-moon ``` -------------------------------- ### Define Plugin Highlight Groups Source: https://github.com/folke/tokyonight.nvim/blob/main/CONTRIBUTING.md Structure for a plugin module file. Defines the plugin's URL and a function to return its highlight groups, using theme colors and attributes. Ensure to use '-- stylua: ignore' before the return table. ```lua local M = {} M.url = "https://github.com/author/plugin-name" ---@type tokyonight.HighlightsFn function M.get(c, opts) -- stylua: ignore return { HighlightGroup1 = { fg = c.blue, bg = c.bg }, HighlightGroup2 = { fg = c.red, bold = true }, HighlightGroup3 = { link = "Normal" }, } end return M ``` -------------------------------- ### Configure Vim for tokyonight.nvim Source: https://github.com/folke/tokyonight.nvim/blob/main/extras/vim/README.md Add these lines to your `~/.vimrc` file to enable the color scheme. Ensure `termguicolors` is set for true color support. ```vim set termguicolors set rtp+=~/projects/tokyonight.nvim/extras/vim colorscheme tokyonight ``` -------------------------------- ### Default Configuration Options for tokyonight.nvim Source: https://github.com/folke/tokyonight.nvim/blob/main/doc/tokyonight.nvim.txt This table defines the default configuration options for the tokyonight.nvim color scheme. It includes settings for theme style, background, transparency, terminal colors, syntax highlighting styles, day brightness, dimming inactive windows, lualine bolding, and plugin management. ```lua ---@class tokyonight.Config ---@field on_colors fun(colors: ColorScheme) ---@field on_highlights fun(highlights: tokyonight.Highlights, colors: ColorScheme) M.defaults = { style = "moon", -- The theme comes in three styles, `storm`, a darker variant `night` and `day` light_style = "day", -- The theme is used when the background is set to light transparent = false, -- Enable this to disable setting the background color terminal_colors = true, -- Configure the colors used when opening a `:terminal` in Neovim styles = { -- Style to be applied to different syntax groups -- Value is any valid attr-list value for `:help nvim_set_hl` comments = { italic = true }, keywords = { italic = true }, functions = {}, variables = {}, -- Background styles. Can be "dark", "transparent" or "normal" sidebars = "dark", -- style for sidebars, see below floats = "dark", -- style for floating windows }, day_brightness = 0.3, -- Adjusts the brightness of the colors of the **Day** style. Number between 0 and 1, from dull to vibrant colors dim_inactive = false, -- dims inactive windows lualine_bold = false, -- When `true`, section headers in the lualine theme will be bold --- You can override specific color groups to use other groups or a hex color --- function will be called with a ColorScheme table ---@param colors ColorScheme on_colors = function(colors) end, --- You can override specific highlights to use other groups or a hex color --- function will be called with a Highlights and ColorScheme table ---@param highlights tokyonight.Highlights ---@param colors ColorScheme on_highlights = function(highlights, colors) end, cache = true, -- When set to true, the theme will be cached for better performance ---@type table plugins = { -- enable all plugins when not using lazy.nvim -- set to false to manually enable/disable plugins all = package.loaded.lazy == nil, -- uses your plugin manager to automatically enable needed plugins -- currently only lazy.nvim is supported auto = true, -- add any plugins here that you want to enable -- for all possible plugins, see: -- * https://github.com/folke/tokyonight.nvim/tree/main/lua/tokyonight/groups -- telescope = true, }, } ``` -------------------------------- ### Configure Tmux for Undercurl Support Source: https://github.com/folke/tokyonight.nvim/blob/main/doc/tokyonight.nvim.txt Add these lines to your Tmux configuration file to enable undercurl support and colors. Requires tmux-3.0 or later for underscore colors. ```sh # Undercurl set -g default-terminal "${TERM}" set -as terminal-overrides ',*:Smulx=\E[4::%p1%dm' # undercurl support set -as terminal-overrides ',*:Setulc=\E[58::2::::%p1%{65536}%/%d::%p1%{256}%/%{255}%&%d::%p1%{255}%&%d%;m' # underscore colours - needs tmux-3.0 ``` -------------------------------- ### Configure Lightline with TokyoNight Source: https://github.com/folke/tokyonight.nvim/blob/main/doc/tokyonight.nvim.txt Configure the lightline plugin to use the TokyoNight theme by setting the 'g:lightline' dictionary with the 'colorscheme' key. ```vim " Vim Script let g:lightline = {'colorscheme': 'tokyonight'} ``` -------------------------------- ### Set TokyoNight.nvim Colorscheme Source: https://github.com/folke/tokyonight.nvim/blob/main/doc/tokyonight.nvim.txt Apply the TokyoNight color scheme using the vim.cmd command. This is the most basic way to activate the theme. ```lua vim.cmd[[colorscheme tokyonight]] ``` -------------------------------- ### Apply TokyoNight Styles Source: https://github.com/folke/tokyonight.nvim/blob/main/README.md Switch between different TokyoNight styles including night, storm, day, and moon using the colorscheme command. ```vim colorscheme tokyonight " There are also colorschemes for the different styles. colorscheme tokyonight-night colorscheme tokyonight-storm colorscheme tokyonight-day colorscheme tokyonight-moon ``` -------------------------------- ### Automatic Day Style Activation Source: https://context7.com/folke/tokyonight.nvim/llms.txt Configures the theme to automatically use the 'day' style when the Neovim background is set to 'light'. ```vim vim.o.background = "light" vim.cmd[[colorscheme tokyonight]] ``` -------------------------------- ### Configure Tmux for Undercurl Support Source: https://context7.com/folke/tokyonight.nvim/llms.txt Add these settings to your `~/.tmux.conf` to enable undercurl display with proper colors in Tmux. This requires tmux version 3.0 or later. ```sh # Add to ~/.tmux.conf for undercurl support # Use proper terminal type set -g default-terminal "${TERM}" # Enable undercurl support set -as terminal-overrides ',*:Smulx=\E[4::%p1%dm' # Enable undercurl colors (requires tmux 3.0+) set -as terminal-overrides ',*:Setulc=\E[58::2::::%p1%{65536}%/%d::%p1%{256}%/%{255}%&%d::%p1%{255}%&%d%;m' ``` -------------------------------- ### Configure Barbecue Winbar with TokyoNight Source: https://context7.com/folke/tokyonight.nvim/llms.txt Set up the Barbecue breadcrumb plugin to utilize TokyoNight's color scheme for consistent visual appearance. This configuration includes theme selection and other Barbecue options. ```lua require('barbecue').setup({ theme = 'tokyonight', -- Additional barbecue configuration show_dirname = true, show_basename = true, show_modified = false, modified = function(bufnr) return vim.bo[bufnr].modified end, symbols = { modified = "●", ellipsis = "…", separator = "", }, }) ``` -------------------------------- ### Extra Theme Template Structure Source: https://github.com/folke/tokyonight.nvim/blob/main/CONTRIBUTING.md A template for creating custom theme extras. It uses `util.template()` to substitute color variables into a theme configuration string. The `generate` function receives a `colors` table and returns the theme as a string. ```lua local util = require("tokyonight.util") local M = {} --@param colors ColorScheme --@return string function M.generate(colors) return util.template([[ # Example theme for Cool App # name: ${_style_name} background = ${bg} foreground = ${fg} accent = ${blue} ]], colors) end return M ``` -------------------------------- ### Set Gemini CLI Theme Path Source: https://github.com/folke/tokyonight.nvim/blob/main/extras/gemini_cli/README.md Configure the Gemini CLI to use a specific Tokyo Night theme file by providing its absolute path in the ui.theme setting. ```json { "ui": { "theme": "/absolute/path/to/tokyonight_night.json" } } ``` -------------------------------- ### Register New Extra Source: https://github.com/folke/tokyonight.nvim/blob/main/CONTRIBUTING.md Add a new entry to the `extras` table in `lua/tokyonight/extra/init.lua` to register a custom extra. Specify the output file extension (e.g., 'conf', 'json'). ```lua M.extras = { -- ... existing extras ... ["cool-app"] = { ext = "conf" }, -- or .json, .toml, etc. } ``` -------------------------------- ### Import Tokyo Night Theme CSS Source: https://github.com/folke/tokyonight.nvim/blob/main/extras/tailwindv4/README.md Import the theme CSS files into your main CSS file to make the Tokyo Night colors available. Ensure Tailwind CSS is also imported. ```css @import "tailwindcss"; @import "./tokyonight_day.css"; @import "./tokyonight_moon.css"; @import "./tokyonight_night.css"; @import "./tokyonight_storm.css"; ``` -------------------------------- ### Configure Lualine with TokyoNight Source: https://github.com/folke/tokyonight.nvim/blob/main/README.md Set the 'tokyonight' theme for the Lualine statusline plugin in your Neovim configuration. ```lua -- Lua require('lualine').setup { options = { -- ... your lualine config theme = 'tokyonight' -- ... your lualine config } } ``` -------------------------------- ### Use Color Utility Functions Source: https://context7.com/folke/tokyonight.nvim/llms.txt Employ utility functions for color manipulation, such as blending, lightening, and darkening colors. These functions are useful for creating custom color schemes or dynamic UI elements. ```lua local util = require("tokyonight.util") local colors = require("tokyonight.colors").setup() -- Lighten a color (blend toward white) -- Second param: 0 = white, 1 = original color local lighter_red = util.lighten(colors.red, 0.3) local lighter_blue = util.lighten(colors.blue, 0.5) -- Darken a color (blend toward background) -- Second param: 0 = original color, 1 = background local darker_green = util.darken(colors.green, 0.3) -- Blend two colors together -- util.blend(foreground, alpha, background) -- alpha: 0 = background, 1 = foreground local blended = util.blend("#ff0000", 0.5, "#0000ff") -- Purple -- Blend with current background local semi_transparent = util.blend_bg(colors.blue, 0.4) -- Brighten a color (increase lightness and saturation) local vivid_cyan = util.brighten(colors.cyan, 0.1, 0.2) -- Example: Create custom diagnostic virtual text backgrounds local error_bg = util.blend_bg(colors.error, 0.15) local warn_bg = util.blend_bg(colors.warning, 0.15) ``` -------------------------------- ### Test Tokyo Night Theme Styles Source: https://github.com/folke/tokyonight.nvim/blob/main/CONTRIBUTING.md Commands to switch between the different styles of the Tokyo Night theme in Neovim. Essential for verifying highlight group appearance across all variants. ```vim -- In your Neovim config vim.cmd("colorscheme tokyonight-storm") vim.cmd("colorscheme tokyonight-moon") vim.cmd("colorscheme tokyonight-night") vim.cmd("colorscheme tokyonight-day") ``` -------------------------------- ### Define Custom Gemini CLI Theme Source: https://github.com/folke/tokyonight.nvim/blob/main/extras/gemini_cli/README.md Add a custom Tokyo Night theme to the Gemini CLI's settings by defining it within the ui.customThemes object and then setting ui.theme to its name. ```json { "ui": { "customThemes": { "Tokyo Night": { "name": "Tokyo Night", "type": "custom", ... } }, "theme": "Tokyo Night" } } ``` -------------------------------- ### Enable Terminal Undercurl Support Source: https://github.com/folke/tokyonight.nvim/blob/main/README.md Configure your terminal to support undercurl using these tmux settings. Requires tmux version 3.0 or later. ```shell set -g default-terminal "${TERM}" set -as terminal-overrides ',*:Smulx=\E[4::%p1%dm' # undercurl support set -as terminal-overrides ',*:Setulc=\E[58::2::::%p1%{65536}%/%d::%p1%{256}%/%{255}%&%d::%p1%{255}%&%d%;m' # underscore colours - needs tmux-3.0 ``` -------------------------------- ### Tmux Configuration for Undercurls Source: https://github.com/folke/tokyonight.nvim/blob/main/README.md This is a shell command to be added to your Tmux configuration file to ensure that undercurls display correctly and in color within the terminal. ```sh # Set the terminal to use UTF-8 encoding and enable undercurls set -g terminal-overrides 'xterm*:Tc' ``` -------------------------------- ### Clear Theme Cache Source: https://context7.com/folke/tokyonight.nvim/llms.txt Clear all cached theme data to apply configuration changes or troubleshoot. The cache is stored in `vim.fn.stdpath("cache") .. "/tokyonight-{style}.json"`. You can also disable caching entirely. ```lua -- Clear all cached theme data require("tokyonight.util").cache.clear() ``` ```lua -- Disable caching entirely require("tokyonight").setup({ cache = false, }) ``` ```lua -- After clearing cache, reload the colorscheme vim.cmd[[colorscheme tokyonight]] ``` -------------------------------- ### Use Tokyo Night Color Palette in Neovim Plugins Source: https://github.com/folke/tokyonight.nvim/blob/main/doc/tokyonight.nvim.txt Load the Tokyo Night color palette and utility functions to customize colors for other plugins within your Neovim configuration. The lighten function accepts a number between 0 and 1. ```lua local colors = require("tokyonight.colors").setup() -- pass in any of the config options as explained above local util = require("tokyonight.util") aplugin.background = colors.bg_dark aplugin.my_error = util.lighten(colors.red1, 0.3) -- number between 0 and 1. 0 results in white, 1 results in red1 ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.