From 2ee1ada9114459e5c1472648180d243308a7b4a5 Mon Sep 17 00:00:00 2001 From: siduck Date: Sun, 29 Jan 2023 23:30:13 +0530 Subject: [PATCH] reduce some LOC --- lua/core/default_config.lua | 2 -- lua/core/options.lua | 10 ++-------- lua/core/utils.lua | 2 +- lua/plugins/configs/lazy_nvim.lua | 10 ++-------- lua/plugins/configs/nvterm.lua | 27 --------------------------- lua/plugins/configs/treesitter.lua | 8 ++------ lua/plugins/init.lua | 4 +++- 7 files changed, 10 insertions(+), 53 deletions(-) delete mode 100644 lua/plugins/configs/nvterm.lua diff --git a/lua/core/default_config.lua b/lua/core/default_config.lua index bd9e037..6e5e70b 100644 --- a/lua/core/default_config.lua +++ b/lua/core/default_config.lua @@ -14,11 +14,9 @@ M.ui = { -- hl = highlights hl_add = {}, hl_override = {}, - changed_themes = {}, theme_toggle = { "onedark", "one_light" }, theme = "onedark", -- default theme - transparency = false, -- cmp themeing diff --git a/lua/core/options.lua b/lua/core/options.lua index b262013..ee8671c 100644 --- a/lua/core/options.lua +++ b/lua/core/options.lua @@ -49,13 +49,7 @@ opt.whichwrap:append "<>[]hl" g.mapleader = " " -local default_providers = { - "node", - "perl", - "python3", - "ruby", -} - -for _, provider in ipairs(default_providers) do +-- disable some default providers +for _, provider in ipairs { "node", "perl", "python3", "ruby" } do vim.g["loaded_" .. provider .. "_provider"] = 0 end diff --git a/lua/core/utils.lua b/lua/core/utils.lua index b9f70ae..bc20de6 100644 --- a/lua/core/utils.lua +++ b/lua/core/utils.lua @@ -3,7 +3,6 @@ local merge_tb = vim.tbl_deep_extend M.load_config = function() local config = require "core.default_config" - local chadrc_path = vim.api.nvim_get_runtime_file("lua/custom/chadrc.lua", false)[1] if chadrc_path then @@ -57,6 +56,7 @@ M.load_mappings = function(section, mapping_opt) if section_values.plugin then return end + section_values.plugin = nil for mode, mode_values in pairs(section_values) do diff --git a/lua/plugins/configs/lazy_nvim.lua b/lua/plugins/configs/lazy_nvim.lua index 4e357fd..dbb3abc 100644 --- a/lua/plugins/configs/lazy_nvim.lua +++ b/lua/plugins/configs/lazy_nvim.lua @@ -1,12 +1,6 @@ return { - defaults = { - lazy = true, - }, - - install = { - -- try to load one of these colorschemes when starting an installation during startup - colorscheme = { "nvchad" }, - }, + defaults = { lazy = true }, + install = { colorscheme = { "nvchad" } }, ui = { icons = { diff --git a/lua/plugins/configs/nvterm.lua b/lua/plugins/configs/nvterm.lua deleted file mode 100644 index cdcaa59..0000000 --- a/lua/plugins/configs/nvterm.lua +++ /dev/null @@ -1,27 +0,0 @@ -require "base46.term" - -local options = { - terminals = { - list = {}, - type_opts = { - float = { - relative = "editor", - row = 0.3, - col = 0.25, - width = 0.5, - height = 0.4, - border = "single", - }, - horizontal = { location = "rightbelow", split_ratio = 0.3 }, - vertical = { location = "rightbelow", split_ratio = 0.5 }, - }, - }, - behavior = { - close_on_exit = true, - auto_insert = true, - }, - enable_new_mappings = true, -} - -options = require("core.utils").load_override(options, "NvChad/nvterm") -require("nvterm").setup(options) diff --git a/lua/plugins/configs/treesitter.lua b/lua/plugins/configs/treesitter.lua index da8cf3c..782f36d 100644 --- a/lua/plugins/configs/treesitter.lua +++ b/lua/plugins/configs/treesitter.lua @@ -1,18 +1,14 @@ dofile(vim.g.base46_cache .. "syntax") local options = { - ensure_installed = { - "lua", - }, + ensure_installed = { "lua" }, highlight = { enable = true, use_languagetree = true, }, - indent = { - enable = true, - }, + indent = { enable = true }, } -- check for any override diff --git a/lua/plugins/init.lua b/lua/plugins/init.lua index 19fcee0..0c33db9 100644 --- a/lua/plugins/init.lua +++ b/lua/plugins/init.lua @@ -20,7 +20,9 @@ local plugins = { ["NvChad/nvterm"] = { config = function() - require "plugins.configs.nvterm" + require "base46.term" + local options = require("core.utils").load_override({}, "NvChad/nvterm") + require("nvterm").setup(options) end, init = function() require("core.utils").load_mappings "nvterm"