feat(plugins): move theme plugins to new file
This commit is contained in:
parent
2fb6bddbc1
commit
8e4c45a213
3 changed files with 69 additions and 60 deletions
|
@ -1,13 +1,7 @@
|
||||||
local config = require('cosmic.config')
|
local config = require('cosmic.config')
|
||||||
local colors = {}
|
local colors = {}
|
||||||
local mod = 'cosmic.core.theme.integrated.'
|
local mod = 'cosmic.core.theme.integrated.'
|
||||||
local supported_themes = {
|
local supported_themes = require('cosmic.core.theme.plugins').supported_themes
|
||||||
'tokyonight',
|
|
||||||
'catppuccino',
|
|
||||||
'gruvbox',
|
|
||||||
'rose-pine',
|
|
||||||
'nord',
|
|
||||||
}
|
|
||||||
|
|
||||||
for _, theme in pairs(supported_themes) do
|
for _, theme in pairs(supported_themes) do
|
||||||
if theme == config.theme then
|
if theme == config.theme then
|
||||||
|
|
67
lua/cosmic/core/theme/plugins.lua
Normal file
67
lua/cosmic/core/theme/plugins.lua
Normal file
|
@ -0,0 +1,67 @@
|
||||||
|
local M = {}
|
||||||
|
|
||||||
|
M.supported_themes = {
|
||||||
|
'tokyonight',
|
||||||
|
'catppuccino',
|
||||||
|
'gruvbox',
|
||||||
|
'rose-pine',
|
||||||
|
'nord',
|
||||||
|
}
|
||||||
|
|
||||||
|
function M.init(use, config)
|
||||||
|
use({ -- color scheme
|
||||||
|
'folke/tokyonight.nvim',
|
||||||
|
as = 'tokyonight',
|
||||||
|
config = function()
|
||||||
|
vim.g.tokyonight_style = 'night'
|
||||||
|
vim.g.tokyonight_sidebars = { 'qf' }
|
||||||
|
vim.cmd('color tokyonight')
|
||||||
|
end,
|
||||||
|
disable = config.theme ~= 'tokyonight',
|
||||||
|
})
|
||||||
|
|
||||||
|
use({
|
||||||
|
'Pocco81/Catppuccino.nvim',
|
||||||
|
as = 'catppuccino',
|
||||||
|
config = function()
|
||||||
|
vim.cmd('color catppuccin')
|
||||||
|
end,
|
||||||
|
branch = 'dev-remaster',
|
||||||
|
disable = config.theme ~= 'catppuccino',
|
||||||
|
})
|
||||||
|
|
||||||
|
use({
|
||||||
|
'shaunsingh/nord.nvim',
|
||||||
|
as = 'nord',
|
||||||
|
config = function()
|
||||||
|
vim.g.nord_contrast = true
|
||||||
|
vim.g.nord_borders = true
|
||||||
|
require('nord').set()
|
||||||
|
end,
|
||||||
|
disable = config.theme ~= 'nord',
|
||||||
|
})
|
||||||
|
|
||||||
|
use({
|
||||||
|
'ellisonleao/gruvbox.nvim',
|
||||||
|
as = 'gruvbox',
|
||||||
|
requires = { 'rktjmp/lush.nvim' },
|
||||||
|
config = function()
|
||||||
|
-- todo: does nothing
|
||||||
|
vim.o.background = 'dark'
|
||||||
|
vim.cmd('colorscheme gruvbox')
|
||||||
|
end,
|
||||||
|
disable = config.theme ~= 'gruvbox',
|
||||||
|
})
|
||||||
|
|
||||||
|
use({
|
||||||
|
'rose-pine/neovim',
|
||||||
|
as = 'rose-pine',
|
||||||
|
config = function()
|
||||||
|
vim.g.rose_pine_variant = 'moon'
|
||||||
|
vim.cmd('colorscheme rose-pine')
|
||||||
|
end,
|
||||||
|
disable = config.theme ~= 'rose-pine',
|
||||||
|
})
|
||||||
|
end
|
||||||
|
|
||||||
|
return M
|
|
@ -32,59 +32,7 @@ return packer.startup(function()
|
||||||
'nvim-lua/plenary.nvim',
|
'nvim-lua/plenary.nvim',
|
||||||
})
|
})
|
||||||
|
|
||||||
use({ -- color scheme
|
require('cosmic.core.theme.plugins').init(use, config)
|
||||||
'folke/tokyonight.nvim',
|
|
||||||
as = 'tokyonight',
|
|
||||||
config = function()
|
|
||||||
vim.g.tokyonight_style = 'night'
|
|
||||||
vim.g.tokyonight_sidebars = { 'qf' }
|
|
||||||
vim.cmd('color tokyonight')
|
|
||||||
end,
|
|
||||||
disable = config.theme ~= 'tokyonight',
|
|
||||||
})
|
|
||||||
|
|
||||||
use({
|
|
||||||
'Pocco81/Catppuccino.nvim',
|
|
||||||
as = 'catppuccino',
|
|
||||||
config = function()
|
|
||||||
vim.cmd('color catppuccin')
|
|
||||||
end,
|
|
||||||
branch = 'dev-remaster',
|
|
||||||
disable = config.theme ~= 'catppuccino',
|
|
||||||
})
|
|
||||||
|
|
||||||
use({
|
|
||||||
'shaunsingh/nord.nvim',
|
|
||||||
as = 'nord',
|
|
||||||
config = function()
|
|
||||||
vim.g.nord_contrast = true
|
|
||||||
vim.g.nord_borders = true
|
|
||||||
require('nord').set()
|
|
||||||
end,
|
|
||||||
disable = config.theme ~= 'nord',
|
|
||||||
})
|
|
||||||
|
|
||||||
use({
|
|
||||||
'ellisonleao/gruvbox.nvim',
|
|
||||||
as = 'gruvbox',
|
|
||||||
requires = { 'rktjmp/lush.nvim' },
|
|
||||||
config = function()
|
|
||||||
-- todo: does nothing
|
|
||||||
vim.o.background = 'dark'
|
|
||||||
vim.cmd('colorscheme gruvbox')
|
|
||||||
end,
|
|
||||||
disable = config.theme ~= 'gruvbox',
|
|
||||||
})
|
|
||||||
|
|
||||||
use({
|
|
||||||
'rose-pine/neovim',
|
|
||||||
as = 'rose-pine',
|
|
||||||
config = function()
|
|
||||||
vim.g.rose_pine_variant = 'moon'
|
|
||||||
vim.cmd('colorscheme rose-pine')
|
|
||||||
end,
|
|
||||||
disable = config.theme ~= 'rose-pine',
|
|
||||||
})
|
|
||||||
|
|
||||||
use({
|
use({
|
||||||
'rcarriga/nvim-notify',
|
'rcarriga/nvim-notify',
|
||||||
|
|
Loading…
Add table
Reference in a new issue