From 6b06bb9ed4f3c97b3886ab5f7d96fe12aa67d7e5 Mon Sep 17 00:00:00 2001 From: Akianonymus Date: Mon, 31 Jan 2022 10:58:52 +0530 Subject: [PATCH] Remove duplicate code, missed in d8dabe9 | Format files --- lua/core/options.lua | 7 ------- lua/core/utils.lua | 11 ++++++----- lua/plugins/configs/cmp.lua | 3 +-- 3 files changed, 7 insertions(+), 14 deletions(-) diff --git a/lua/core/options.lua b/lua/core/options.lua index 2b6c7d5..539c8e6 100644 --- a/lua/core/options.lua +++ b/lua/core/options.lua @@ -3,13 +3,6 @@ local g = vim.g local options = require("core.utils").load_config().options ---Defer loading shada until after startup -vim.opt.shadafile = "NONE" -vim.defer_fn(function() - vim.opt.shadafile = vim.fn.expand("$HOME") .. "/.local/share/nvim/shada/main.shada" - vim.cmd[[ rsh ]] -end, 0) - opt.title = true opt.clipboard = options.clipboard opt.cmdheight = options.cmdheight diff --git a/lua/core/utils.lua b/lua/core/utils.lua index c9f84f8..2099817 100644 --- a/lua/core/utils.lua +++ b/lua/core/utils.lua @@ -280,13 +280,14 @@ M.tbl_override_req = function(name, default_table) return vim.tbl_deep_extend("force", default_table, override) end - M.remove_default_plugins = function(plugin_table) local removals = require("core.utils").load_config().plugins.default_plugin_remove or {} - if vim.tbl_isempty(removals) then return plugin_table end - newtable = {} + if vim.tbl_isempty(removals) then + return plugin_table + end + local newtable = {} local i = 1 - for index, value in ipairs(plugin_table) do + for _, value in ipairs(plugin_table) do local removed = false for _, removal in ipairs(removals) do if value[1] == removal then @@ -295,7 +296,7 @@ M.remove_default_plugins = function(plugin_table) end if not removed then newtable[i] = value - i = i+1 + i = i + 1 end end return newtable diff --git a/lua/plugins/configs/cmp.lua b/lua/plugins/configs/cmp.lua index 3a05e18..936779c 100644 --- a/lua/plugins/configs/cmp.lua +++ b/lua/plugins/configs/cmp.lua @@ -14,8 +14,7 @@ local default = { require("luasnip").lsp_expand(args.body) end, }) or { - expand = function(args) - end, + expand = function(args) end, }, formatting = { format = function(entry, vim_item)