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