feat(config): allow default theme to be disabled, (you will need to implement your own statusline if you do this)

This commit is contained in:
Matt Leong 2021-10-28 20:42:10 -07:00
parent d9c294e814
commit f4e75710ea
5 changed files with 19 additions and 7 deletions

View file

@ -17,6 +17,7 @@ local plugins = {
'gitsigns',
'kommentary',
'statusline',
'theme', -- if default theme is disabled, you will need to update add your own statusline
'treesitter',
'telescope',
'terminal',

View file

@ -1,4 +1,9 @@
local themeColors = require('tokyonight.colors').setup()
local ok, theme = pcall(require, 'tokyonight.colors')
if not ok then
return false
end
local themeColors = theme.setup()
local colors = {
white = themeColors.fg_dark,

View file

@ -1,4 +1,7 @@
local colors = require('cosmic.core.theme.colors')
local _, colors = pcall(require, 'cosmic.core.theme.colors')
if not colors then
return
end
local highlight = require('cosmic.utils').highlight
-- diagnostic virtual text highlights

View file

@ -5,7 +5,6 @@ local lsp = vim.lsp
local buf, win
function M.rename()
local colors = require('cosmic.core.theme.colors')
local icons = require('cosmic.core.theme.icons')
local utils = require('cosmic.utils')
local config = require('cosmic.config')
@ -29,8 +28,12 @@ function M.rename()
api.nvim_win_set_option(win, 'sidescrolloff', 0)
api.nvim_buf_set_option(buf, 'modifiable', true)
api.nvim_buf_set_option(buf, 'buftype', 'prompt')
local _, colors = pcall(require, 'cosmic.core.theme.colors')
if colors then
api.nvim_buf_add_highlight(buf, -1, 'LspRenamePrompt', 0, 0, #prompt_str)
highlight('LspRenamePrompt', 'None', colors.selection_caret)
end
vim.fn.prompt_setprompt(buf, prompt_str)

View file

@ -62,7 +62,7 @@ return packer.startup(function()
vim.g.tokyonight_sidebars = { 'qf', 'packer' }
vim.cmd('color tokyonight')
end,
-- disable = vim.tbl_contains(user_plugins.disable, 'theme'),
disable = vim.tbl_contains(user_plugins.disable, 'theme'),
})
use({ -- icons
@ -79,7 +79,7 @@ return packer.startup(function()
require('cosmic.core.statusline')
end,
after = 'nvim-web-devicons',
disable = vim.tbl_contains(user_plugins.disable, 'statusline'),
disable = vim.tbl_contains(user_plugins.disable, 'statusline') or vim.tbl_contains(user_plugins.disable, 'theme'),
})
-- file explorer