nvim/lua/cosmic/core/user.lua
Matthew Leong daaafc1f8d
Lazy.nvim (#88)
* feat: init lazy.nvim

* refactor: easy plugin init

* feat: user defined plugins

* refactor: clean up user config

* refactor: clean up lsp plugins

* fix: lsp signature

* fix: null ls user config

* feat: replace commands

* feat: optimize lazy loading

* fix: lsp_signature working

* fix: documentation hover/sig help

* fix: autopairs

* feat: clean up luasnips

* fix auto complete

* moar laziness

* feat: add markdown_inline to ensured_installed for TS

* clean up

* clean up auto-session
2022-12-29 08:34:17 -08:00

46 lines
1 KiB
Lua

-- DEFAULT USER SETTINGS
local user_config = require('cosmic.config.config')
local default_config = {
border = 'rounded',
disable_builtin_plugins = {},
add_plugins = {},
lsp = {
format_on_save = true, -- true/false or table of filetypes {'.ts', '.js',}
format_timeout = 3000,
rename_notification = true,
servers = {
astro = true,
tailwindcss = true,
jsonls = {
format = false,
},
pyright = true,
sumneko_lua = {
format = false,
},
html = true,
tsserver = {
format = false,
},
},
},
}
local u = require('cosmic.utils')
local config = u.merge(default_config, user_config)
local user_servers = vim.tbl_keys(config.lsp.servers)
function config.lsp.can_client_format(client_name)
if config.lsp.servers[client_name] == true then
return true
end
if vim.tbl_contains(user_servers, client_name) and config.lsp.servers[client_name] then
return (config.lsp.servers[client_name].format == true)
end
return true
end
return config