feat(themes): clean up theme config names

This commit is contained in:
Matt Leong 2021-11-15 07:23:41 -08:00
parent 4796732c93
commit 2fb6bddbc1
9 changed files with 47 additions and 27 deletions

View file

@ -18,11 +18,11 @@ config.statusline = {
config.treesitter = {}
-- theming, don't forget to run :PackerSync and reload CosmicNvim when chaning themes
-- 'Catppuccino.nvim'
-- 'gruvbox.nvim'
-- 'nord.nvim'
-- 'catppuccino'
-- 'gruvbox'
-- 'nord'
-- 'rose-pine'
config.theme = 'tokyonight.nvim' -- don't define or set to nil, if you want to enable your own theme in cosmic/config/plugins.lua
config.theme = 'tokyonight' -- don't define or set to nil, if you want to enable your own theme in cosmic/config/plugins.lua
-- lsp settings
config.lsp = {

View file

@ -30,7 +30,6 @@ local default_config = {
tsserver = {
format = false, -- disable formatting all together
},
null_ls = {},
},
},
}

View file

@ -1,24 +1,27 @@
local config = require('cosmic.config')
local colors = {}
local mod = 'cosmic.core.theme.integrated.'
local supported_themes = {
'tokyonight',
'catppuccino',
'gruvbox',
'rose-pine',
'nord',
}
if config.theme == 'tokyonight.nvim' then
colors = require('cosmic.core.theme.integrated.tokyonight')
elseif config.theme == 'Catppuccino.nvim' then
colors = require('cosmic.core.theme.integrated.catppuccin')
elseif config.theme == 'gruvbox.nvim' then
colors = require('cosmic.core.theme.integrated.gruvbox')
elseif config.theme == 'rose-pine' then
colors = require('cosmic.core.theme.integrated.rosepine')
elseif config.theme == 'nord.nvim' then
colors = require('cosmic.core.theme.integrated.nord')
for _, theme in pairs(supported_themes) do
if theme == config.theme then
colors = require(mod .. theme)
end
end
if vim.tbl_isempty(colors) then
return false
end
-- @TODO: move elsewhere
colors.notify_bg = 'Normal'
if config.theme == 'gruvbox.nvim' then
if config.theme == 'gruvbox' then
colors.notify_bg = colors.bg
end

View file

@ -1,9 +1,9 @@
local theme = require('nord.colors')
local colors = {
white = theme.nord4_gui,
bg = theme.nord2_gui,
bg_highlight = theme.nord2_gui,
statusline_bg = theme.nord0_gui,
bg = theme.nord1_gui,
bg_highlight = theme.nord1_gui,
statusline_bg = theme.nord2_gui,
normal = theme.nord9_gui,
insert = theme.nord14_gui,
command = theme.nord13_gui,

View file

@ -1,4 +1,20 @@
local theme = require('rose-pine.palette')
--[[ base = '#191724',
surface = '#1f1d2e',
overlay = '#26233a',
inactive = '#555169',
subtle = '#6e6a86',
text = '#e0def4',
love = '#eb6f92',
gold = '#f6c177',
rose = '#ebbcba',
pine = '#31748f',
foam = '#9ccfd8',
iris = '#c4a7e7',
highlight = '#2a2837',
highlight_inactive = '#211f2d',
highlight_overlay = '#3a384a',
none = 'NONE', ]]
local colors = {
white = theme.text,
bg = theme.surface,

View file

@ -1,4 +1,5 @@
local cosmic_modules = {
'cosmic.compiled',
'cosmic.disabled',
'cosmic.pluginsInit',
'cosmic.commands',
@ -15,7 +16,6 @@ for _, mod in ipairs(cosmic_modules) do
end
local user_config_modules = {
'cosmic.compiled',
'cosmic.config.editor',
'cosmic.config.mappings',
}

View file

@ -19,8 +19,6 @@ lsp_installer.settings({
-- initial default serverse
local requested_servers = {
-- 'eslint',
-- 'efm',
'tsserver',
'sumneko_lua',
'jsonls',

View file

@ -19,7 +19,7 @@ null_ls.config(vim.tbl_deep_extend('force', {
}),
null_ls.builtins.code_actions.gitsigns,
},
}, config.lsp.servers.null_ls))
}, config.lsp.servers.null_ls or {}))
require('lspconfig')['null-ls'].setup({
on_attach = on_attach,

View file

@ -34,42 +34,46 @@ return packer.startup(function()
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.nvim',
disable = config.theme ~= 'tokyonight',
})
use({
'Pocco81/Catppuccino.nvim',
as = 'catppuccino',
config = function()
vim.cmd('color catppuccin')
end,
branch = 'dev-remaster',
disable = config.theme ~= 'Catppuccino.nvim',
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.nvim',
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.nvim',
disable = config.theme ~= 'gruvbox',
})
use({