feat(plugins): move some configs to core
This commit is contained in:
parent
92734a9af6
commit
7c0be72d08
3 changed files with 37 additions and 36 deletions
23
lua/cosmic/core/comments/init.lua
Normal file
23
lua/cosmic/core/comments/init.lua
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
local icons = require('cosmic.core.theme.icons')
|
||||||
|
require('todo-comments').setup({
|
||||||
|
keywords = {
|
||||||
|
FIX = {
|
||||||
|
icon = icons.debug, -- icon used for the sign, and in search results
|
||||||
|
color = 'error', -- can be a hex color, or a named color (see below)
|
||||||
|
alt = { 'FIXME', 'BUG', 'FIXIT', 'ISSUE', 'fix', 'fixme', 'bug' }, -- a set of other keywords that all map to this FIX keywords
|
||||||
|
-- signs = false, -- configure signs for some keywords individually
|
||||||
|
},
|
||||||
|
TODO = { icon = icons.check, color = 'info' },
|
||||||
|
HACK = { icon = icons.flame, color = 'warning' },
|
||||||
|
WARN = { icon = icons.warn, color = 'warning', alt = { 'WARNING', 'XXX' } },
|
||||||
|
PERF = { icon = icons.perf, alt = { 'OPTIM', 'PERFORMANCE', 'OPTIMIZE' } },
|
||||||
|
NOTE = { icon = icons.note, color = 'hint', alt = { 'INFO' } },
|
||||||
|
},
|
||||||
|
colors = {
|
||||||
|
error = { 'DiagnosticError', 'ErrorMsg', '#DC2626' },
|
||||||
|
warning = { 'DiagnosticWarning', 'WarningMsg', '#FBBF24' },
|
||||||
|
info = { 'DiagnosticInformation', '#2563EB' },
|
||||||
|
hint = { 'DiagnosticHint', '#10B981' },
|
||||||
|
default = { 'Identifier', '#7C3AED' },
|
||||||
|
},
|
||||||
|
})
|
12
lua/cosmic/core/notifications/init.lua
Normal file
12
lua/cosmic/core/notifications/init.lua
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
local icons = require('cosmic.core.theme.icons')
|
||||||
|
require('notify').setup({
|
||||||
|
icons = {
|
||||||
|
ERROR = icons.error,
|
||||||
|
WARN = icons.warn,
|
||||||
|
INFO = icons.info,
|
||||||
|
DEBUG = icons.debug,
|
||||||
|
TRACE = icons.trace,
|
||||||
|
},
|
||||||
|
background_colour = require('cosmic.core.theme.colors').notify_bg,
|
||||||
|
})
|
||||||
|
vim.notify = require('notify')
|
|
@ -37,18 +37,7 @@ return packer.startup(function()
|
||||||
use({
|
use({
|
||||||
'rcarriga/nvim-notify',
|
'rcarriga/nvim-notify',
|
||||||
config = function()
|
config = function()
|
||||||
local icons = require('cosmic.core.theme.icons')
|
require('cosmic.core.notifications')
|
||||||
require('notify').setup({
|
|
||||||
icons = {
|
|
||||||
ERROR = icons.error,
|
|
||||||
WARN = icons.warn,
|
|
||||||
INFO = icons.info,
|
|
||||||
DEBUG = icons.debug,
|
|
||||||
TRACE = icons.trace,
|
|
||||||
},
|
|
||||||
background_colour = require('cosmic.core.theme.colors').notify_bg,
|
|
||||||
})
|
|
||||||
vim.notify = require('notify')
|
|
||||||
end,
|
end,
|
||||||
after = config.theme,
|
after = config.theme,
|
||||||
disable = vim.tbl_contains(user_plugins.disable, 'notify'),
|
disable = vim.tbl_contains(user_plugins.disable, 'notify'),
|
||||||
|
@ -234,7 +223,6 @@ return packer.startup(function()
|
||||||
'nvim-treesitter/nvim-treesitter-refactor',
|
'nvim-treesitter/nvim-treesitter-refactor',
|
||||||
},
|
},
|
||||||
run = ':TSUpdate',
|
run = ':TSUpdate',
|
||||||
-- event = 'BufEnter',
|
|
||||||
config = function()
|
config = function()
|
||||||
require('cosmic.core.treesitter')
|
require('cosmic.core.treesitter')
|
||||||
end,
|
end,
|
||||||
|
@ -253,29 +241,7 @@ return packer.startup(function()
|
||||||
'folke/todo-comments.nvim',
|
'folke/todo-comments.nvim',
|
||||||
requires = 'nvim-lua/plenary.nvim',
|
requires = 'nvim-lua/plenary.nvim',
|
||||||
config = function()
|
config = function()
|
||||||
local icons = require('cosmic.core.theme.icons')
|
require('cosmic.core.comments')
|
||||||
require('todo-comments').setup({
|
|
||||||
keywords = {
|
|
||||||
FIX = {
|
|
||||||
icon = icons.debug, -- icon used for the sign, and in search results
|
|
||||||
color = 'error', -- can be a hex color, or a named color (see below)
|
|
||||||
alt = { 'FIXME', 'BUG', 'FIXIT', 'ISSUE', 'fix', 'fixme', 'bug' }, -- a set of other keywords that all map to this FIX keywords
|
|
||||||
-- signs = false, -- configure signs for some keywords individually
|
|
||||||
},
|
|
||||||
TODO = { icon = icons.check, color = 'info' },
|
|
||||||
HACK = { icon = icons.flame, color = 'warning' },
|
|
||||||
WARN = { icon = icons.warn, color = 'warning', alt = { 'WARNING', 'XXX' } },
|
|
||||||
PERF = { icon = icons.perf, alt = { 'OPTIM', 'PERFORMANCE', 'OPTIMIZE' } },
|
|
||||||
NOTE = { icon = icons.note, color = 'hint', alt = { 'INFO' } },
|
|
||||||
},
|
|
||||||
colors = {
|
|
||||||
error = { 'DiagnosticError', 'ErrorMsg', '#DC2626' },
|
|
||||||
warning = { 'DiagnosticWarning', 'WarningMsg', '#FBBF24' },
|
|
||||||
info = { 'DiagnosticInformation', '#2563EB' },
|
|
||||||
hint = { 'DiagnosticHint', '#10B981' },
|
|
||||||
default = { 'Identifier', '#7C3AED' },
|
|
||||||
},
|
|
||||||
})
|
|
||||||
end,
|
end,
|
||||||
event = 'BufWinEnter',
|
event = 'BufWinEnter',
|
||||||
disable = vim.tbl_contains(user_plugins.disable, 'todo-comments'),
|
disable = vim.tbl_contains(user_plugins.disable, 'todo-comments'),
|
||||||
|
|
Loading…
Add table
Reference in a new issue