feat: clean up packerInit file
This commit is contained in:
parent
981b309aeb
commit
aeecb23382
4 changed files with 10 additions and 36 deletions
4
init.lua
4
init.lua
|
@ -1,5 +1,5 @@
|
|||
if vim.fn.has('nvim-0.6') == 0 then
|
||||
error('Need NVIM 0.6 in order to run Cosmic!!')
|
||||
if vim.fn.has('nvim-0.7') == 0 then
|
||||
error('Need Neovim v0.7+ in order to run Cosmic!')
|
||||
end
|
||||
|
||||
do
|
||||
|
|
|
@ -1,22 +1,8 @@
|
|||
local present, cosmic_packer = pcall(require, 'cosmic.packer')
|
||||
|
||||
if not present then
|
||||
return false
|
||||
end
|
||||
|
||||
local user_config = require('cosmic.core.user')
|
||||
local cosmic_packer = require('cosmic.packer')
|
||||
local packer = cosmic_packer.packer
|
||||
local use = packer.use
|
||||
|
||||
local ok, user_config = pcall(require, 'cosmic.core.user')
|
||||
if not ok then
|
||||
user_config = {
|
||||
add_plugins = {},
|
||||
disable_builtin_plugins = {},
|
||||
}
|
||||
end
|
||||
|
||||
local config = require('cosmic.core.user')
|
||||
|
||||
return packer.startup(function()
|
||||
use({
|
||||
'wbthomason/packer.nvim',
|
||||
|
@ -26,14 +12,14 @@ return packer.startup(function()
|
|||
})
|
||||
|
||||
-- initialize theme plugins
|
||||
require('cosmic.theme.plugins').init(use, config)
|
||||
require('cosmic.theme.plugins').init(use, user_config)
|
||||
|
||||
use({
|
||||
'rcarriga/nvim-notify',
|
||||
config = function()
|
||||
require('cosmic.plugins.notify')
|
||||
end,
|
||||
after = config.theme,
|
||||
after = user_config.theme,
|
||||
disable = vim.tbl_contains(user_config.disable_builtin_plugins, 'notify'),
|
||||
})
|
||||
|
||||
|
@ -45,7 +31,7 @@ return packer.startup(function()
|
|||
config = function()
|
||||
require('cosmic.plugins.galaxyline')
|
||||
end,
|
||||
after = config.theme,
|
||||
after = user_config.theme,
|
||||
disable = vim.tbl_contains(user_config.disable_builtin_plugins, 'galaxyline'),
|
||||
})
|
||||
|
||||
|
|
|
@ -1,11 +1,9 @@
|
|||
-- DO NOT TOUCH :)
|
||||
local ok, user_config = pcall(require, 'cosmic.config.config')
|
||||
|
||||
if not ok then
|
||||
user_config = {}
|
||||
end
|
||||
|
||||
-- these settings will be merged with any settings definined in config.lua
|
||||
local default_config = {
|
||||
border = 'rounded',
|
||||
disable_builtin_plugins = {},
|
||||
|
@ -14,26 +12,16 @@ local default_config = {
|
|||
lsp = {
|
||||
format_on_save = true, -- true/false or table of filetypes {'.ts', '.js',}
|
||||
rename_notification = true,
|
||||
-- vim.diagnostic.config settiings
|
||||
servers = {
|
||||
-- enable/disable server + formatting
|
||||
-- enable non-default servers
|
||||
-- rust_analyzer = true,
|
||||
|
||||
-- or override lsp server options
|
||||
--[[ rust_analyzer = {
|
||||
opts = {}
|
||||
}, ]]
|
||||
|
||||
jsonls = {
|
||||
format = false,
|
||||
},
|
||||
sumneko_lua = {
|
||||
format = false, -- disable formatting all together
|
||||
format = false,
|
||||
},
|
||||
html = true,
|
||||
tsserver = {
|
||||
format = false, -- disable formatting all together
|
||||
format = false,
|
||||
},
|
||||
},
|
||||
},
|
||||
|
|
|
@ -33,7 +33,7 @@ function M.init(use, config)
|
|||
local catppuccin = require('catppuccin')
|
||||
catppuccin.setup({
|
||||
styles = {
|
||||
comments = 'NONE',
|
||||
comments = 'italic',
|
||||
functions = 'NONE',
|
||||
keywords = 'NONE',
|
||||
strings = 'NONE',
|
||||
|
|
Loading…
Add table
Reference in a new issue