rebase: fix mappings
This commit is contained in:
parent
6102571a7f
commit
2be3e66c3c
3 changed files with 10 additions and 17 deletions
|
@ -8,6 +8,8 @@ end
|
||||||
-- these settings will be merged with any settings definined in config.lua
|
-- 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 = {},
|
||||||
|
add_plugins = {},
|
||||||
theme = 'tokyonight',
|
theme = 'tokyonight',
|
||||||
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',}
|
||||||
|
|
|
@ -1,16 +1,14 @@
|
||||||
local map = require('cosmic.utils').map
|
local map = require('cosmic.utils').map
|
||||||
local ok, user_plugins = pcall(require, 'cosmic.config.plugins')
|
local user_plugins = require('cosmic.config')
|
||||||
|
|
||||||
-- Mappings for plugins that need to be lazy loaded
|
-- Mappings for plugins that need to be lazy loaded
|
||||||
if ok then
|
if not vim.tbl_contains(user_plugins.disable_builtin_plugins, 'nvim-tree') then
|
||||||
if not vim.tbl_contains(user_plugins.disable, 'nvim-tree') then
|
|
||||||
require('cosmic.plugins.nvim-tree.mappings')
|
require('cosmic.plugins.nvim-tree.mappings')
|
||||||
end
|
end
|
||||||
|
|
||||||
if not vim.tbl_contains(user_plugins.disable, 'auto-session') then
|
if not vim.tbl_contains(user_plugins.disable_builtin_plugins, 'auto-session') then
|
||||||
require('cosmic.plugins.auto-session.mappings')
|
require('cosmic.plugins.auto-session.mappings')
|
||||||
end
|
end
|
||||||
end
|
|
||||||
|
|
||||||
-- Quickfix mappings
|
-- Quickfix mappings
|
||||||
map('n', '<leader>ck', ':cexpr []<cr>')
|
map('n', '<leader>ck', ':cexpr []<cr>')
|
||||||
|
|
|
@ -10,18 +10,11 @@ local use = packer.use
|
||||||
local ok, user_config = pcall(require, 'cosmic.config')
|
local ok, user_config = pcall(require, 'cosmic.config')
|
||||||
if not ok then
|
if not ok then
|
||||||
user_config = {
|
user_config = {
|
||||||
add = {},
|
add_plugins = {},
|
||||||
disable = {},
|
disable_builtin_plugins = {},
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
if not vim.tbl_islist(user_config.add) then
|
|
||||||
user_config.add_plugins = {}
|
|
||||||
end
|
|
||||||
if not vim.tbl_islist(user_config.disable) then
|
|
||||||
user_config.disable_builtin_plugins = {}
|
|
||||||
end
|
|
||||||
|
|
||||||
local config = require('cosmic.config')
|
local config = require('cosmic.config')
|
||||||
|
|
||||||
return packer.startup(function()
|
return packer.startup(function()
|
||||||
|
|
Loading…
Add table
Reference in a new issue