Skip to content

Commit

Permalink
feat: added colorscheme names for styles
Browse files Browse the repository at this point in the history
  • Loading branch information
folke committed Sep 5, 2022
1 parent dba4e35 commit a3b558b
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 14 deletions.
1 change: 1 addition & 0 deletions colors/tokyonight-day.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
require("tokyonight").load({ style = "day" })
1 change: 1 addition & 0 deletions colors/tokyonight-night.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
require("tokyonight").load({ style = "night" })
1 change: 1 addition & 0 deletions colors/tokyonight-storm.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
require("tokyonight").load({ style = "storm" })
1 change: 1 addition & 0 deletions colors/tokyonight.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
require("tokyonight").load()
9 changes: 0 additions & 9 deletions colors/tokyonight.vim

This file was deleted.

2 changes: 1 addition & 1 deletion lua/tokyonight/colors.lua
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
local util = require("tokyonight.util")
local config = require("tokyonight.config").options

local M = {}

---@return ColorScheme
function M.setup(opts)
opts = opts or {}
local config = require("tokyonight.config").options

-- Color Palette
---@class ColorScheme
Expand Down
7 changes: 4 additions & 3 deletions lua/tokyonight/config.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
-- shim vim for kitty and other generators
vim = vim or { g = {}, o = {} }

local M = {}

---@class Config
Expand Down Expand Up @@ -32,6 +29,10 @@ function M.setup(options)
M.options = vim.tbl_deep_extend("force", {}, defaults, options or {})
end

function M.extend(options)
M.options = vim.tbl_deep_extend("force", {}, M.options or defaults, options or {})
end

M.setup()

return M
7 changes: 6 additions & 1 deletion lua/tokyonight/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,13 @@ local theme = require("tokyonight.theme")

local M = {}

function M.colorscheme()
function M.load(opts)
if opts then
require("tokyonight.config").extend(opts)
end
util.load(theme.setup())
end

M.colorscheme = M.load

return M

0 comments on commit a3b558b

Please sign in to comment.