BREAKING CHANGE | re-implementation of custom config
This commit is contained in:
parent
d906bb0d9c
commit
adecbe719f
20 changed files with 835 additions and 1309 deletions
|
@ -1,4 +1,3 @@
|
|||
local settings=require("core.utils").load_config().options.nvChad
|
||||
-- uncomment this if you want to open nvim with a dir
|
||||
-- vim.cmd [[ autocmd BufEnter * if &buftype != "terminal" | lcd %:p:h | endif ]]
|
||||
|
||||
|
@ -6,16 +5,6 @@ local settings=require("core.utils").load_config().options.nvChad
|
|||
-- vim.cmd[[ au InsertEnter * set norelativenumber ]]
|
||||
-- vim.cmd[[ au InsertLeave * set relativenumber ]]
|
||||
|
||||
-- Don't show any numbers inside terminals
|
||||
if not settings.terminal_numbers then
|
||||
vim.cmd [[ au TermOpen term://* setlocal nonumber norelativenumber | setfiletype terminal ]]
|
||||
end
|
||||
|
||||
-- Don't show status line on certain windows
|
||||
if not require("core.utils").load_config().plugins.options.statusline.hide_disable then
|
||||
vim.cmd [[ autocmd BufEnter,BufRead,BufWinEnter,FileType,WinEnter * lua require("core.utils").hide_statusline() ]]
|
||||
end
|
||||
|
||||
-- Open a file from its last left off position
|
||||
-- vim.cmd [[ au BufReadPost * if expand('%:p') !~# '\m/\.git/' && line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif ]]
|
||||
-- File extension specific tabbing
|
||||
|
|
|
@ -1,279 +1,51 @@
|
|||
-- IMPORTANT NOTE : This is default config, so dont change anything here.
|
||||
-- use custom/chadrc.lua instead
|
||||
-- chadrc overrides this file
|
||||
|
||||
local M = {}
|
||||
|
||||
M.options = {
|
||||
-- custom = {}
|
||||
-- general nvim/vim options , check :h optionname to know more about an option
|
||||
|
||||
clipboard = "unnamedplus",
|
||||
cmdheight = 1,
|
||||
ruler = false,
|
||||
hidden = true,
|
||||
ignorecase = true,
|
||||
smartcase = true,
|
||||
mapleader = " ",
|
||||
mouse = "a",
|
||||
number = true,
|
||||
numberwidth = 2,
|
||||
relativenumber = false,
|
||||
expandtab = true,
|
||||
shiftwidth = 2,
|
||||
smartindent = true,
|
||||
tabstop = 8,
|
||||
timeoutlen = 400,
|
||||
updatetime = 250,
|
||||
undofile = true,
|
||||
fillchars = { eob = " " },
|
||||
shadafile = vim.opt.shadafile,
|
||||
path = "", -- path to file that overrides core.options
|
||||
|
||||
-- NvChad options
|
||||
nvChad = {
|
||||
copy_cut = true, -- copy cut text ( x key ), visual and normal mode
|
||||
copy_del = true, -- copy deleted text ( dd key ), visual and normal mode
|
||||
insert_nav = true, -- navigation in insertmode
|
||||
window_nav = true,
|
||||
terminal_numbers = false,
|
||||
|
||||
-- updater
|
||||
update_url = "https://github.com/NvChad/NvChad",
|
||||
update_branch = "main",
|
||||
},
|
||||
terminal = {
|
||||
behavior = {
|
||||
close_on_exit = true,
|
||||
},
|
||||
window = {
|
||||
vsplit_ratio = 0.5,
|
||||
split_ratio = 0.4,
|
||||
},
|
||||
location = {
|
||||
horizontal = "rightbelow",
|
||||
vertical = "rightbelow",
|
||||
float = {
|
||||
relative = 'editor',
|
||||
row = 0.3,
|
||||
col = 0.25,
|
||||
width = 0.5,
|
||||
height = 0.4,
|
||||
border = "single",
|
||||
}
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
---- UI -----
|
||||
|
||||
M.ui = {
|
||||
hl_override = "", -- path of your file that contains highlights
|
||||
hl_override = "",
|
||||
colors = "", -- path of your file that contains colors
|
||||
italic_comments = false,
|
||||
theme = "onedark", -- default theme
|
||||
|
||||
-- Change terminal bg to nvim theme's bg color so it'll match well
|
||||
-- For Ex : if you have onedark set in nvchad, set onedark's bg color on your terminal
|
||||
transparency = false,
|
||||
}
|
||||
|
||||
---- PLUGIN OPTIONS ----
|
||||
|
||||
M.plugins = {
|
||||
override = {},
|
||||
|
||||
-- builtin nvim plugins are disabled
|
||||
builtins = {
|
||||
"2html_plugin",
|
||||
"getscript",
|
||||
"getscriptPlugin",
|
||||
"gzip",
|
||||
"logipat",
|
||||
"netrw",
|
||||
"netrwPlugin",
|
||||
"netrwSettings",
|
||||
"netrwFileHandlers",
|
||||
"matchit",
|
||||
"tar",
|
||||
"tarPlugin",
|
||||
"rrhelper",
|
||||
"spellfile_plugin",
|
||||
"vimball",
|
||||
"vimballPlugin",
|
||||
"zip",
|
||||
"zipPlugin",
|
||||
},
|
||||
|
||||
-- enable/disable plugins (false for disable)
|
||||
status = {
|
||||
blankline = true, -- indentline stuff
|
||||
bufferline = true, -- manage and preview opened buffers
|
||||
colorizer = false, -- color RGB, HEX, CSS, NAME color codes
|
||||
comment = true, -- easily (un)comment code, language aware
|
||||
alpha = false, -- dashboard
|
||||
better_escape = true, -- map to <ESC> with no lag
|
||||
feline = true, -- statusline
|
||||
gitsigns = true,
|
||||
lspsignature = true, -- lsp enhancements
|
||||
vim_matchup = true, -- improved matchit
|
||||
cmp = true,
|
||||
nvimtree = true,
|
||||
autopairs = true,
|
||||
},
|
||||
options = {
|
||||
packer = {
|
||||
init_file = "plugins.packerInit",
|
||||
},
|
||||
autopairs = { loadAfter = "nvim-cmp" },
|
||||
cmp = {
|
||||
lazy_load = true,
|
||||
},
|
||||
lspconfig = {
|
||||
setup_lspconf = "", -- path of file containing setups of different lsps
|
||||
},
|
||||
nvimtree = {
|
||||
-- packerCompile required after changing lazy_load
|
||||
lazy_load = true,
|
||||
},
|
||||
luasnip = {
|
||||
snippet_path = {},
|
||||
setup_lspconf = "", -- path of lspconfig file
|
||||
},
|
||||
statusline = {
|
||||
hide_disable = false,
|
||||
-- hide, show on specific filetypes
|
||||
hidden = {
|
||||
"help",
|
||||
"NvimTree",
|
||||
"terminal",
|
||||
"alpha",
|
||||
},
|
||||
shown = {},
|
||||
|
||||
-- truncate statusline on small screens
|
||||
shortline = true,
|
||||
style = "default", -- default, round , slant , block , arrow
|
||||
style = "default", -- default/round/slant/block/arrow
|
||||
},
|
||||
esc_insertmode_timeout = 300,
|
||||
},
|
||||
default_plugin_config_replace = {},
|
||||
default_plugin_remove = {},
|
||||
install = nil,
|
||||
|
||||
-- add, modify, remove plugins
|
||||
user = {},
|
||||
}
|
||||
|
||||
-- Don't use a single keymap twice
|
||||
|
||||
--- MAPPINGS ----
|
||||
|
||||
-- non plugin
|
||||
-- non plugin only
|
||||
M.mappings = {
|
||||
-- custom = {}, -- custom user mappings
|
||||
|
||||
misc = {
|
||||
cheatsheet = "<leader>ch",
|
||||
close_buffer = "<leader>x",
|
||||
cp_whole_file = "<C-c>", -- copy all contents of current buffer
|
||||
lineNR_toggle = "<leader>n", -- toggle line number
|
||||
lineNR_rel_toggle = "<leader>rn",
|
||||
update_nvchad = "<leader>uu",
|
||||
new_buffer = "<S-t>",
|
||||
new_tab = "<C-t>b",
|
||||
save_file = "<C-s>", -- save file using :w
|
||||
},
|
||||
|
||||
-- navigation in insert mode, only if enabled in options
|
||||
|
||||
insert_nav = {
|
||||
backward = "<C-h>",
|
||||
end_of_line = "<C-e>",
|
||||
forward = "<C-l>",
|
||||
next_line = "<C-j>",
|
||||
prev_line = "<C-k>",
|
||||
beginning_of_line = "<C-a>",
|
||||
},
|
||||
|
||||
-- better window movement
|
||||
window_nav = {
|
||||
moveLeft = "<C-h>",
|
||||
moveRight = "<C-l>",
|
||||
moveUp = "<C-k>",
|
||||
moveDown = "<C-j>",
|
||||
},
|
||||
|
||||
-- terminal related mappings
|
||||
terminal = {
|
||||
-- multiple mappings can be given for esc_termmode, esc_hide_termmode
|
||||
|
||||
-- get out of terminal mode
|
||||
esc_termmode = { "jk" },
|
||||
|
||||
-- get out of terminal mode and hide it
|
||||
esc_hide_termmode = { "JK" },
|
||||
-- show & recover hidden terminal buffers in a telescope picker
|
||||
pick_term = "<leader>W",
|
||||
|
||||
-- spawn a single terminal and toggle it
|
||||
-- this just works like toggleterm kinda
|
||||
new_horizontal = "<leader>h",
|
||||
new_vertical = "<leader>v",
|
||||
new_float = "<A-i>",
|
||||
|
||||
-- spawn new terminals
|
||||
spawn_horizontal = "<A-h>",
|
||||
spawn_vertical = "<A-v>",
|
||||
spawn_window = "<leader>w",
|
||||
},
|
||||
}
|
||||
|
||||
-- plugins related mappings
|
||||
-- To disable a mapping, equate the variable to "" or false or nil in chadrc
|
||||
M.mappings.plugins = {
|
||||
bufferline = {
|
||||
next_buffer = "<TAB>",
|
||||
prev_buffer = "<S-Tab>",
|
||||
},
|
||||
comment = {
|
||||
toggle = "<leader>/",
|
||||
},
|
||||
|
||||
-- map to <ESC> with no lag
|
||||
better_escape = { -- <ESC> will still work
|
||||
esc_insertmode = { "jk" }, -- multiple mappings allowed
|
||||
},
|
||||
|
||||
lspconfig = {
|
||||
declaration = "gD",
|
||||
definition = "gd",
|
||||
hover = "K",
|
||||
implementation = "gi",
|
||||
signature_help = "gk",
|
||||
add_workspace_folder = "<leader>wa",
|
||||
remove_workspace_folder = "<leader>wr",
|
||||
list_workspace_folders = "<leader>wl",
|
||||
type_definition = "<leader>D",
|
||||
rename = "<leader>ra",
|
||||
code_action = "<leader>ca",
|
||||
references = "gr",
|
||||
float_diagnostics = "ge",
|
||||
goto_prev = "[d",
|
||||
goto_next = "]d",
|
||||
set_loclist = "<leader>q",
|
||||
formatting = "<leader>fm",
|
||||
},
|
||||
|
||||
nvimtree = {
|
||||
toggle = "<C-n>",
|
||||
focus = "<leader>e",
|
||||
},
|
||||
|
||||
telescope = {
|
||||
buffers = "<leader>fb",
|
||||
find_files = "<leader>ff",
|
||||
find_hiddenfiles = "<leader>fa",
|
||||
git_commits = "<leader>cm",
|
||||
git_status = "<leader>gt",
|
||||
help_tags = "<leader>fh",
|
||||
live_grep = "<leader>fw",
|
||||
oldfiles = "<leader>fo",
|
||||
themes = "<leader>th", -- NvChad theme picker
|
||||
},
|
||||
misc = nil,
|
||||
}
|
||||
|
||||
return M
|
||||
|
|
|
@ -1,207 +1,200 @@
|
|||
local utils = require "core.utils"
|
||||
|
||||
local config = utils.load_config()
|
||||
local map_wrapper = utils.map
|
||||
local map = utils.map
|
||||
|
||||
local user_cmd = vim.api.nvim_create_user_command
|
||||
|
||||
local maps = config.mappings
|
||||
local plugin_maps = maps.plugins
|
||||
local nvChad_options = config.options.nvChad
|
||||
local terminal_options = config.options.terminal
|
||||
|
||||
local mappings = config.mappings
|
||||
|
||||
local cmd = vim.cmd
|
||||
|
||||
-- This is a wrapper function made to disable a plugin mapping from chadrc
|
||||
-- If keys are nil, false or empty string, then the mapping will be not applied
|
||||
-- Useful when one wants to use that keymap for any other purpose
|
||||
local map = function(...)
|
||||
local keys = select(2, ...)
|
||||
if not keys or keys == "" then
|
||||
return
|
||||
|
||||
-- Don't copy the replaced text after pasting in visual mode
|
||||
map("v", "p", "p:let @+=@0<CR>")
|
||||
|
||||
-- Allow moving the cursor through wrapped lines with j, k, <Up> and <Down>
|
||||
-- http<cmd> ://www.reddit.com/r/vim/comments/2k4cbr/problem_with_gj_and_gk/
|
||||
-- empty mode is same as using <cmd> :map
|
||||
-- also don't use g[j|k] when in operator pending mode, so it doesn't alter d, y or c behaviour
|
||||
|
||||
map({ "n", "x", "o" }, "j", 'v:count || mode(1)[0:1] == "no" ? "j" : "gj"', { expr = true })
|
||||
map({ "n", "x", "o" }, "k", 'v:count || mode(1)[0:1] == "no" ? "k" : "gk"', { expr = true })
|
||||
map("", "<Down>", 'v:count || mode(1)[0:1] == "no" ? "j" : "gj"', { expr = true })
|
||||
map("", "<Up>", 'v:count || mode(1)[0:1] == "no" ? "k" : "gk"', { expr = true })
|
||||
|
||||
-- use ESC to turn off search highlighting
|
||||
map("n", "<Esc>", "<cmd> :noh <CR>")
|
||||
|
||||
-- move cursor within insert mode
|
||||
map("i", "<C-h>", "<Left>")
|
||||
map("i", "<C-e>", "<End>")
|
||||
map("i", "<C-l>", "<Right>")
|
||||
map("i", "<C-j>", "<Down>")
|
||||
map("i", "<C-k>", "<Up>")
|
||||
map("i", "<C-a>", "<ESC>^i")
|
||||
|
||||
-- navigation between windows
|
||||
map("n", "<C-h>", "<C-w>h")
|
||||
map("n", "<C-l>", "<C-w>l")
|
||||
map("n", "<C-k>", "<C-w>k")
|
||||
map("n", "<C-j>", "<C-w>j")
|
||||
|
||||
map("n", "<leader>x", function()
|
||||
require("core.utils").close_buffer()
|
||||
end)
|
||||
|
||||
map("n", "<C-c>", "<cmd> :%y+ <CR>") -- copy whole file content
|
||||
map("n", "<S-t>", "<cmd> :enew <CR>") -- new buffer
|
||||
map("n", "<C-t>b", "<cmd> :tabnew <CR>") -- new tabs
|
||||
map("n", "<leader>n", "<cmd> :set nu! <CR>")
|
||||
map("n", "<leader>rn", "<cmd> :set rnu! <CR>") -- relative line numbers
|
||||
map("n", "<C-s>", "<cmd> :w <CR>") -- ctrl + s to save file
|
||||
|
||||
-- terminal mappings
|
||||
|
||||
-- get out of terminal mode
|
||||
map("t", { "jk" }, "<C-\\><C-n>")
|
||||
|
||||
-- hide a term from within terminal mode
|
||||
map("t", { "JK" }, function()
|
||||
require("nvchad.terminal").hide()
|
||||
end)
|
||||
|
||||
-- Add Packer commands because we are not loading it at startup
|
||||
|
||||
local packer_cmd = function(callback)
|
||||
return function()
|
||||
require "plugins"
|
||||
require("packer")[callback]()
|
||||
end
|
||||
map_wrapper(...)
|
||||
end
|
||||
|
||||
user_cmd("PackerClean", packer_cmd "clean", {})
|
||||
user_cmd("PackerCompile", packer_cmd "compile", {})
|
||||
user_cmd("PackerInstall", packer_cmd "install", {})
|
||||
user_cmd("PackerStatus", packer_cmd "status", {})
|
||||
user_cmd("PackerSync", packer_cmd "sync", {})
|
||||
user_cmd("PackerUpdate", packer_cmd "update", {})
|
||||
|
||||
-- add NvChadUpdate command and mapping
|
||||
cmd "silent! command! NvChadUpdate lua require('nvchad').update_nvchad()"
|
||||
map("n", "<leader>uu", "<cmd> :NvChadUpdate <CR>")
|
||||
|
||||
-- load overriden misc mappings
|
||||
|
||||
if mappings.misc ~= nil and type(mappings.misc) == "function" then
|
||||
mappings.misc()
|
||||
end
|
||||
|
||||
local M = {}
|
||||
|
||||
-- these mappings will only be called during initialization
|
||||
M.misc = function()
|
||||
local function non_config_mappings()
|
||||
-- Don't copy the replaced text after pasting in visual mode
|
||||
map_wrapper("v", "p", "p:let @+=@0<CR>")
|
||||
|
||||
-- Allow moving the cursor through wrapped lines with j, k, <Up> and <Down>
|
||||
-- http://www.reddit.com/r/vim/comments/2k4cbr/problem_with_gj_and_gk/
|
||||
-- empty mode is same as using :map
|
||||
-- also don't use g[j|k] when in operator pending mode, so it doesn't alter d, y or c behaviour
|
||||
map_wrapper({ "n", "x", "o" }, "j", 'v:count || mode(1)[0:1] == "no" ? "j" : "gj"', { expr = true })
|
||||
map_wrapper({ "n", "x", "o" }, "k", 'v:count || mode(1)[0:1] == "no" ? "k" : "gk"', { expr = true })
|
||||
map_wrapper("", "<Down>", 'v:count || mode(1)[0:1] == "no" ? "j" : "gj"', { expr = true })
|
||||
map_wrapper("", "<Up>", 'v:count || mode(1)[0:1] == "no" ? "k" : "gk"', { expr = true })
|
||||
|
||||
-- use ESC to turn off search highlighting
|
||||
map_wrapper("n", "<Esc>", ":noh <CR>")
|
||||
|
||||
-- center cursor when moving (goto_definition)
|
||||
end
|
||||
|
||||
local function optional_mappings()
|
||||
-- don't yank text on cut ( x )
|
||||
if not nvChad_options.copy_cut then
|
||||
map_wrapper({ "n", "v" }, "x", '"_x')
|
||||
end
|
||||
|
||||
-- don't yank text on delete ( dd )
|
||||
if not nvChad_options.copy_del then
|
||||
map_wrapper({ "n", "v" }, "d", '"_d')
|
||||
end
|
||||
|
||||
-- navigation within insert mode
|
||||
if nvChad_options.insert_nav then
|
||||
local inav = maps.insert_nav
|
||||
|
||||
map("i", inav.backward, "<Left>")
|
||||
map("i", inav.end_of_line, "<End>")
|
||||
map("i", inav.forward, "<Right>")
|
||||
map("i", inav.next_line, "<Down>")
|
||||
map("i", inav.prev_line, "<Up>")
|
||||
map("i", inav.beginning_of_line, "<ESC>^i")
|
||||
end
|
||||
|
||||
-- easier navigation between windows
|
||||
if nvChad_options.window_nav then
|
||||
local wnav = maps.window_nav
|
||||
|
||||
map("n", wnav.moveLeft, "<C-w>h")
|
||||
map("n", wnav.moveRight, "<C-w>l")
|
||||
map("n", wnav.moveUp, "<C-w>k")
|
||||
map("n", wnav.moveDown, "<C-w>j")
|
||||
end
|
||||
end
|
||||
|
||||
local function required_mappings()
|
||||
map("n", maps.misc.cheatsheet, ":lua require('nvchad.cheatsheet').show() <CR>") -- show keybinds
|
||||
map("n", maps.misc.close_buffer, ":lua require('core.utils').close_buffer() <CR>") -- close buffer
|
||||
map("n", maps.misc.cp_whole_file, ":%y+ <CR>") -- copy whole file content
|
||||
map("n", maps.misc.new_buffer, ":enew <CR>") -- new buffer
|
||||
map("n", maps.misc.new_tab, ":tabnew <CR>") -- new tabs
|
||||
map("n", maps.misc.lineNR_toggle, ":set nu! <CR>")
|
||||
map("n", maps.misc.lineNR_rel_toggle, ":set rnu! <CR>") -- relative line numbers
|
||||
map("n", maps.misc.save_file, ":w <CR>") -- ctrl + s to save file
|
||||
|
||||
-- terminal mappings --
|
||||
local term_maps = maps.terminal
|
||||
-- get out of terminal mode
|
||||
map("t", term_maps.esc_termmode, "<C-\\><C-n>")
|
||||
-- hide a term from within terminal mode
|
||||
map("t", term_maps.esc_hide_termmode, "<CMD>lua require('nvchad.terminal').hide() <CR>")
|
||||
-- pick a hidden term
|
||||
map("n", term_maps.pick_term, ":Telescope terms <CR>")
|
||||
-- Open terminals
|
||||
-- TODO this opens on top of an existing vert/hori term, fixme
|
||||
map(
|
||||
{ "n", "t" },
|
||||
term_maps.new_horizontal,
|
||||
"<CMD>lua require('nvchad.terminal').new_or_toggle('horizontal', "
|
||||
.. tostring(terminal_options.window.split_height)
|
||||
.. ")<CR>"
|
||||
)
|
||||
map(
|
||||
{ "n", "t" },
|
||||
term_maps.new_vertical,
|
||||
"<CMD>lua require('nvchad.terminal').new_or_toggle('vertical', "
|
||||
.. tostring(terminal_options.window.vsplit_width)
|
||||
.. ")<CR>"
|
||||
)
|
||||
map(
|
||||
{ "n", "t" },
|
||||
term_maps.new_float,
|
||||
"<CMD>lua require('nvchad.terminal').new_or_toggle('float')<CR>"
|
||||
)
|
||||
|
||||
-- spawns terminals
|
||||
map(
|
||||
"n",
|
||||
term_maps.spawn_horizontal,
|
||||
":execute 15 .. 'new +terminal' | let b:term_type = 'hori' | startinsert <CR>"
|
||||
)
|
||||
map("n", term_maps.spawn_vertical, ":execute 'vnew +terminal' | let b:term_type = 'vert' | startinsert <CR>")
|
||||
map("n", term_maps.spawn_window, ":execute 'terminal' | let b:term_type = 'wind' | startinsert <CR>")
|
||||
|
||||
-- terminal mappings end --
|
||||
|
||||
-- Add Packer commands because we are not loading it at startup
|
||||
cmd "silent! command PackerClean lua require 'plugins' require('packer').clean()"
|
||||
cmd "silent! command PackerCompile lua require 'plugins' require('packer').compile()"
|
||||
cmd "silent! command PackerInstall lua require 'plugins' require('packer').install()"
|
||||
cmd "silent! command PackerStatus lua require 'plugins' require('packer').status()"
|
||||
cmd "silent! command PackerSync lua require 'plugins' require('packer').sync()"
|
||||
cmd "silent! command PackerUpdate lua require 'plugins' require('packer').update()"
|
||||
|
||||
-- add NvChadUpdate command and mapping
|
||||
cmd "silent! command! NvChadUpdate lua require('nvchad').update_nvchad()"
|
||||
map("n", maps.misc.update_nvchad, ":NvChadUpdate <CR>")
|
||||
end
|
||||
|
||||
non_config_mappings()
|
||||
optional_mappings()
|
||||
required_mappings()
|
||||
end
|
||||
|
||||
-- below are all plugin related mappings
|
||||
|
||||
M.bufferline = function()
|
||||
local m = plugin_maps.bufferline
|
||||
|
||||
map("n", m.next_buffer, ":BufferLineCycleNext <CR>")
|
||||
map("n", m.prev_buffer, ":BufferLineCyclePrev <CR>")
|
||||
map("n", "<TAB>", "<cmd> :BufferLineCycleNext <CR>")
|
||||
map("n", "<S-Tab>", "<cmd> :BufferLineCyclePrev <CR>")
|
||||
end
|
||||
|
||||
M.comment = function()
|
||||
local m = plugin_maps.comment.toggle
|
||||
map("n", m, ":lua require('Comment.api').toggle_current_linewise()<CR>")
|
||||
map("v", m, ":lua require('Comment.api').toggle_linewise_op(vim.fn.visualmode())<CR>")
|
||||
map("n", "<leader>/", "<cmd> :lua require('Comment.api').toggle_current_linewise()<CR>")
|
||||
map("v", "<leader>/", "<cmd> :lua require('Comment.api').toggle_linewise_op(vim.fn.visualmode())<CR>")
|
||||
end
|
||||
|
||||
M.lspconfig = function()
|
||||
local m = plugin_maps.lspconfig
|
||||
-- See `<cmd> :help vim.lsp.*` for documentation on any of the below functions
|
||||
map("n", "gD", function()
|
||||
vim.lsp.buf.declaration()
|
||||
end)
|
||||
|
||||
-- See `:help vim.lsp.*` for documentation on any of the below functions
|
||||
map("n", m.declaration, "<cmd>lua vim.lsp.buf.declaration()<CR>")
|
||||
map("n", m.definition, "<cmd>lua vim.lsp.buf.definition()<CR>")
|
||||
map("n", m.hover, "<cmd>lua vim.lsp.buf.hover()<CR>")
|
||||
map("n", m.implementation, "<cmd>lua vim.lsp.buf.implementation()<CR>")
|
||||
map("n", m.signature_help, "<cmd>lua vim.lsp.buf.signature_help()<CR>")
|
||||
map("n", m.add_workspace_folder, "<cmd>lua vim.lsp.buf.add_workspace_folder()<CR>")
|
||||
map("n", m.remove_workspace_folder, "<cmd>lua vim.lsp.buf.remove_workspace_folder()<CR>")
|
||||
map("n", m.list_workspace_folders, "<cmd>lua print(vim.inspect(vim.lsp.buf.list_workspace_folders()))<CR>")
|
||||
map("n", m.type_definition, "<cmd>lua vim.lsp.buf.type_definition()<CR>")
|
||||
map("n", m.rename, "<cmd>lua vim.lsp.buf.rename()<CR>")
|
||||
map("n", m.code_action, "<cmd>lua vim.lsp.buf.code_action()<CR>")
|
||||
map("n", m.references, "<cmd>lua vim.lsp.buf.references()<CR>")
|
||||
map("n", m.float_diagnostics, "<cmd>lua vim.diagnostic.open_float()<CR>")
|
||||
map("n", m.goto_prev, "<cmd>lua vim.diagnostic.goto_prev()<CR>")
|
||||
map("n", m.goto_next, "<cmd>lua vim.diagnostic.goto_next()<CR>")
|
||||
map("n", m.set_loclist, "<cmd>lua vim.diagnostic.setloclist()<CR>")
|
||||
map("n", m.formatting, "<cmd>lua vim.lsp.buf.formatting()<CR>")
|
||||
map("n", "gd", function()
|
||||
vim.lsp.buf.definition()
|
||||
end)
|
||||
|
||||
map("n", "K", function()
|
||||
vim.lsp.buf.hover()
|
||||
end)
|
||||
|
||||
map("n", "gi", function()
|
||||
vim.lsp.buf.implementation()
|
||||
end)
|
||||
|
||||
map("n", "<C-k>", function()
|
||||
vim.lsp.buf.signature_help()
|
||||
end)
|
||||
|
||||
map("n", "<space>D", function()
|
||||
vim.lsp.buf.type_definition()
|
||||
end)
|
||||
|
||||
map("n", "<space>ra", function()
|
||||
vim.lsp.buf.rename()
|
||||
end)
|
||||
|
||||
map("n", "<space>ca", function()
|
||||
vim.lsp.buf.code_action()
|
||||
end)
|
||||
|
||||
map("n", "gr", function()
|
||||
vim.lsp.buf.references()
|
||||
end)
|
||||
|
||||
map("n", "<space>f", function()
|
||||
vim.diagnostic.open_float()
|
||||
end)
|
||||
|
||||
map("n", "[d", function()
|
||||
vim.diagnostic.goto_prev()
|
||||
end)
|
||||
|
||||
map("n", "d]", function()
|
||||
vim.diagnostic.goto_next()
|
||||
end)
|
||||
|
||||
map("n", "<space>q", function()
|
||||
vim.diagnostic.setloclist()
|
||||
end)
|
||||
|
||||
map("n", "<space>fm", function()
|
||||
vim.lsp.buf.formatting()
|
||||
end)
|
||||
|
||||
map("n", "<space>wa", function()
|
||||
vim.lsp.buf.add_workspace_folder()
|
||||
end)
|
||||
|
||||
map("n", "<space>wr", function()
|
||||
vim.lsp.buf.remove_workspace_folder()
|
||||
end)
|
||||
|
||||
map("n", "<space>wl", function()
|
||||
print(vim.inspect(vim.lsp.buf.list_workspace_folders()))
|
||||
end)
|
||||
end
|
||||
|
||||
M.nvimtree = function()
|
||||
map("n", plugin_maps.nvimtree.toggle, ":NvimTreeToggle <CR>")
|
||||
map("n", plugin_maps.nvimtree.focus, ":NvimTreeFocus <CR>")
|
||||
map("n", "<C-n>", "<cmd> :NvimTreeToggle <CR>")
|
||||
map("n", "<leader>e", "<cmd> :NvimTreeFocus <CR>")
|
||||
end
|
||||
|
||||
M.telescope = function()
|
||||
local m = plugin_maps.telescope
|
||||
map("n", "<leader>fb", "<cmd> :Telescope buffers <CR>")
|
||||
map("n", "<leader>ff", "<cmd> :Telescope find_files <CR>")
|
||||
map("n", "<leader>fa", "<cmd> :Telescope find_files follow=true no_ignore=true hidden=true <CR>")
|
||||
map("n", "<leader>cm", "<cmd> :Telescope git_commits <CR>")
|
||||
map("n", "<leader>gt", "<cmd> :Telescope git_status <CR>")
|
||||
map("n", "<leader>fh", "<cmd> :Telescope help_tags <CR>")
|
||||
map("n", "<leader>fw", "<cmd> :Telescope live_grep <CR>")
|
||||
map("n", "<leader>fo", "<cmd> :Telescope oldfiles <CR>")
|
||||
map("n", "<leader>th", "<cmd> :Telescope themes <CR>")
|
||||
|
||||
map("n", m.buffers, ":Telescope buffers <CR>")
|
||||
map("n", m.find_files, ":Telescope find_files <CR>")
|
||||
map("n", m.find_hiddenfiles, ":Telescope find_files follow=true no_ignore=true hidden=true <CR>")
|
||||
map("n", m.git_commits, ":Telescope git_commits <CR>")
|
||||
map("n", m.git_status, ":Telescope git_status <CR>")
|
||||
map("n", m.help_tags, ":Telescope help_tags <CR>")
|
||||
map("n", m.live_grep, ":Telescope live_grep <CR>")
|
||||
map("n", m.oldfiles, ":Telescope oldfiles <CR>")
|
||||
map("n", m.themes, ":Telescope themes <CR>")
|
||||
-- pick a hidden term
|
||||
map("n", "<leader>W", "<cmd> :Telescope terms <CR>")
|
||||
end
|
||||
|
||||
return M
|
||||
|
|
|
@ -1,31 +1,34 @@
|
|||
local opt = vim.opt
|
||||
local g = vim.g
|
||||
|
||||
local options = require("core.utils").load_config().options
|
||||
-- use filetype.lua instead of filetype.vim
|
||||
g.did_load_filetypes = 0
|
||||
g.do_filetype_lua = 1
|
||||
|
||||
opt.laststatus = 3 -- global statusline
|
||||
opt.title = true
|
||||
opt.clipboard = options.clipboard
|
||||
opt.cmdheight = options.cmdheight
|
||||
opt.clipboard = "unnamedplus"
|
||||
opt.cmdheight = 1
|
||||
opt.cul = true -- cursor line
|
||||
|
||||
-- Indentline
|
||||
opt.expandtab = options.expandtab
|
||||
opt.shiftwidth = options.shiftwidth
|
||||
opt.smartindent = options.smartindent
|
||||
opt.expandtab = true
|
||||
opt.shiftwidth = 2
|
||||
opt.smartindent = true
|
||||
|
||||
-- disable tilde on end of buffer: https://github.com/neovim/neovim/pull/8546#issuecomment-643643758
|
||||
opt.fillchars = options.fillchars
|
||||
opt.fillchars = { eob = " " }
|
||||
|
||||
opt.hidden = options.hidden
|
||||
opt.ignorecase = options.ignorecase
|
||||
opt.smartcase = options.smartcase
|
||||
opt.mouse = options.mouse
|
||||
opt.hidden = true
|
||||
opt.ignorecase = true
|
||||
opt.smartcase = true
|
||||
opt.mouse = "a"
|
||||
|
||||
-- Numbers
|
||||
opt.number = options.number
|
||||
opt.numberwidth = options.numberwidth
|
||||
opt.relativenumber = options.relativenumber
|
||||
opt.ruler = options.ruler
|
||||
opt.number = true
|
||||
opt.numberwidth = 2
|
||||
opt.relativenumber = false
|
||||
opt.ruler = false
|
||||
|
||||
-- disable nvim intro
|
||||
opt.shortmess:append "sI"
|
||||
|
@ -33,31 +36,54 @@ opt.shortmess:append "sI"
|
|||
opt.signcolumn = "yes"
|
||||
opt.splitbelow = true
|
||||
opt.splitright = true
|
||||
opt.tabstop = options.tabstop
|
||||
opt.tabstop = 8
|
||||
opt.termguicolors = true
|
||||
opt.timeoutlen = options.timeoutlen
|
||||
opt.undofile = options.undofile
|
||||
opt.timeoutlen = 400
|
||||
opt.undofile = true
|
||||
|
||||
-- interval for writing swap file to disk, also used by gitsigns
|
||||
opt.updatetime = options.updatetime
|
||||
opt.updatetime = 250
|
||||
|
||||
-- go to previous/next line with h,l,left arrow and right arrow
|
||||
-- when cursor reaches end/beginning of line
|
||||
opt.whichwrap:append "<>[]hl"
|
||||
|
||||
g.mapleader = options.mapleader
|
||||
g.mapleader = " "
|
||||
|
||||
-- disable some builtin vim plugins
|
||||
local disabled_built_ins = require("core.utils").load_config().plugins.builtins
|
||||
|
||||
for _, plugin in pairs(disabled_built_ins) do
|
||||
local default_plugins = {
|
||||
"2html_plugin",
|
||||
"getscript",
|
||||
"getscriptPlugin",
|
||||
"gzip",
|
||||
"logipat",
|
||||
"netrw",
|
||||
"netrwPlugin",
|
||||
"netrwSettings",
|
||||
"netrwFileHandlers",
|
||||
"matchit",
|
||||
"tar",
|
||||
"tarPlugin",
|
||||
"rrhelper",
|
||||
"spellfile_plugin",
|
||||
"vimball",
|
||||
"vimballPlugin",
|
||||
"zip",
|
||||
"zipPlugin",
|
||||
}
|
||||
|
||||
for _, plugin in pairs(default_plugins) do
|
||||
g["loaded_" .. plugin] = 1
|
||||
end
|
||||
|
||||
--Defer loading shada until after startup_
|
||||
vim.opt.shadafile = "NONE"
|
||||
|
||||
vim.schedule(function()
|
||||
vim.opt.shadafile = require("core.utils").load_config().options.shadafile
|
||||
vim.opt.shadafile = "NONE"
|
||||
vim.cmd [[ silent! rsh ]]
|
||||
end)
|
||||
|
||||
-- load user options if the file exists
|
||||
|
||||
local load_ifExists = require("core.utils").load_ifExists
|
||||
local user_options = require("core.utils").load_config().options.path
|
||||
|
||||
load_ifExists(user_options)
|
||||
|
|
|
@ -1,141 +1,13 @@
|
|||
local M = {}
|
||||
|
||||
local cmd = vim.cmd
|
||||
|
||||
M.close_buffer = function(force)
|
||||
-- This is a modification of a NeoVim plugin from
|
||||
-- Author: ojroques - Olivier Roques
|
||||
-- Src: https://github.com/ojroques/nvim-bufdel
|
||||
-- (Author has okayed copy-paste)
|
||||
|
||||
-- Options
|
||||
local opts = {
|
||||
next = "cycle", -- how to retrieve the next buffer
|
||||
quit = false, -- exit when last buffer is deleted
|
||||
--TODO make this a chadrc flag/option
|
||||
}
|
||||
|
||||
-- ----------------
|
||||
-- Helper functions
|
||||
-- ----------------
|
||||
|
||||
-- Switch to buffer 'buf' on each window from list 'windows'
|
||||
local function switch_buffer(windows, buf)
|
||||
local cur_win = vim.fn.winnr()
|
||||
for _, winid in ipairs(windows) do
|
||||
winid = tonumber(winid) or 0
|
||||
vim.cmd(string.format("%d wincmd w", vim.fn.win_id2win(winid)))
|
||||
vim.cmd(string.format("buffer %d", buf))
|
||||
end
|
||||
vim.cmd(string.format("%d wincmd w", cur_win)) -- return to original window
|
||||
end
|
||||
|
||||
-- Select the first buffer with a number greater than given buffer
|
||||
local function get_next_buf(buf)
|
||||
local next = vim.fn.bufnr "#"
|
||||
if opts.next == "alternate" and vim.fn.buflisted(next) == 1 then
|
||||
return next
|
||||
end
|
||||
for i = 0, vim.fn.bufnr "$" - 1 do
|
||||
next = (buf + i) % vim.fn.bufnr "$" + 1 -- will loop back to 1
|
||||
if vim.fn.buflisted(next) == 1 then
|
||||
return next
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- ----------------
|
||||
-- End helper functions
|
||||
-- ----------------
|
||||
|
||||
local buf = vim.fn.bufnr()
|
||||
if vim.fn.buflisted(buf) == 0 then -- exit if buffer number is invalid
|
||||
vim.cmd "close"
|
||||
return
|
||||
end
|
||||
|
||||
if #vim.fn.getbufinfo { buflisted = 1 } < 2 then
|
||||
if opts.quit then
|
||||
-- exit when there is only one buffer left
|
||||
if force then
|
||||
vim.cmd "qall!"
|
||||
else
|
||||
vim.cmd "confirm qall"
|
||||
end
|
||||
return
|
||||
end
|
||||
|
||||
local chad_term, _ = pcall(function()
|
||||
return vim.api.nvim_buf_get_var(buf, "term_type")
|
||||
end)
|
||||
|
||||
if chad_term then
|
||||
-- Must be a window type
|
||||
vim.cmd(string.format("setlocal nobl", buf))
|
||||
vim.cmd "enew"
|
||||
return
|
||||
end
|
||||
-- don't exit and create a new empty buffer
|
||||
vim.cmd "enew"
|
||||
vim.cmd "bp"
|
||||
end
|
||||
|
||||
local next_buf = get_next_buf(buf)
|
||||
local windows = vim.fn.getbufinfo(buf)[1].windows
|
||||
|
||||
-- force deletion of terminal buffers to avoid the prompt
|
||||
if force or vim.fn.getbufvar(buf, "&buftype") == "terminal" then
|
||||
local chad_term, type = pcall(function()
|
||||
return vim.api.nvim_buf_get_var(buf, "term_type")
|
||||
end)
|
||||
|
||||
-- TODO this scope is error prone, make resilient
|
||||
if chad_term then
|
||||
if type == "wind" then
|
||||
-- hide from bufferline
|
||||
vim.cmd(string.format("%d bufdo setlocal nobl", buf))
|
||||
-- switch to another buff
|
||||
-- TODO switch to next buffer, this works too
|
||||
vim.cmd "BufferLineCycleNext"
|
||||
else
|
||||
local cur_win = vim.fn.winnr()
|
||||
-- we can close this window
|
||||
vim.cmd(string.format("%d wincmd c", cur_win))
|
||||
return
|
||||
end
|
||||
else
|
||||
switch_buffer(windows, next_buf)
|
||||
vim.cmd(string.format("bd! %d", buf))
|
||||
end
|
||||
if force or not vim.bo.buflisted then
|
||||
cmd ":bd!"
|
||||
else
|
||||
switch_buffer(windows, next_buf)
|
||||
vim.cmd(string.format("silent! confirm bd %d", buf))
|
||||
cmd "bd"
|
||||
end
|
||||
-- revert buffer switches if user has canceled deletion
|
||||
if vim.fn.buflisted(buf) == 1 then
|
||||
switch_buffer(windows, buf)
|
||||
end
|
||||
end
|
||||
|
||||
-- hide statusline
|
||||
-- tables fetched from load_config function
|
||||
M.hide_statusline = function()
|
||||
local hidden = require("core.utils").load_config().plugins.options.statusline.hidden
|
||||
local shown = require("core.utils").load_config().plugins.options.statusline.shown
|
||||
local api = vim.api
|
||||
local buftype = api.nvim_buf_get_option(0, "ft")
|
||||
|
||||
-- shown table from config has the highest priority
|
||||
if vim.tbl_contains(shown, buftype) then
|
||||
api.nvim_set_option("laststatus", 2)
|
||||
return
|
||||
end
|
||||
|
||||
if vim.tbl_contains(hidden, buftype) then
|
||||
api.nvim_set_option("laststatus", 0)
|
||||
return
|
||||
end
|
||||
|
||||
api.nvim_set_option("laststatus", 2)
|
||||
end
|
||||
|
||||
M.load_config = function()
|
||||
|
@ -146,10 +18,10 @@ M.load_config = function()
|
|||
if chadrc_exists then
|
||||
-- merge user config if it exists and is a table; otherwise display an error
|
||||
local user_config = require "custom.chadrc"
|
||||
if type(user_config) == 'table' then
|
||||
if type(user_config) == "table" then
|
||||
conf = vim.tbl_deep_extend("force", conf, user_config)
|
||||
else
|
||||
error("User config (chadrc.lua) *must* return a table!")
|
||||
error "User config (chadrc.lua) *must* return a table!"
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -158,52 +30,19 @@ end
|
|||
|
||||
M.map = function(mode, keys, command, opt)
|
||||
local options = { noremap = true, silent = true }
|
||||
|
||||
if opt then
|
||||
options = vim.tbl_extend("force", options, opt)
|
||||
end
|
||||
|
||||
-- all valid modes allowed for mappings
|
||||
-- :h map-modes
|
||||
local valid_modes = {
|
||||
[""] = true,
|
||||
["n"] = true,
|
||||
["v"] = true,
|
||||
["s"] = true,
|
||||
["x"] = true,
|
||||
["o"] = true,
|
||||
["!"] = true,
|
||||
["i"] = true,
|
||||
["l"] = true,
|
||||
["c"] = true,
|
||||
["t"] = true,
|
||||
}
|
||||
|
||||
-- helper function for M.map
|
||||
-- can gives multiple modes and keys
|
||||
local function map_wrapper(sub_mode, lhs, rhs, sub_options)
|
||||
if type(lhs) == "table" then
|
||||
for _, key in ipairs(lhs) do
|
||||
map_wrapper(sub_mode, key, rhs, sub_options)
|
||||
end
|
||||
else
|
||||
if type(sub_mode) == "table" then
|
||||
for _, m in ipairs(sub_mode) do
|
||||
map_wrapper(m, lhs, rhs, sub_options)
|
||||
end
|
||||
else
|
||||
if valid_modes[sub_mode] and lhs and rhs then
|
||||
vim.api.nvim_set_keymap(sub_mode, lhs, rhs, sub_options)
|
||||
else
|
||||
sub_mode, lhs, rhs = sub_mode or "", lhs or "", rhs or ""
|
||||
print(
|
||||
"Cannot set mapping [ mode = '" .. sub_mode .. "' | key = '" .. lhs .. "' | cmd = '" .. rhs .. "' ]"
|
||||
)
|
||||
end
|
||||
end
|
||||
if type(keys) == "table" then
|
||||
for _, keymap in ipairs(keys) do
|
||||
M.map(mode, keymap, command, opt)
|
||||
end
|
||||
return
|
||||
end
|
||||
|
||||
map_wrapper(mode, keys, command, options)
|
||||
vim.keymap.set(mode, keys, command, opt)
|
||||
end
|
||||
|
||||
-- load plugin after entering vim ui
|
||||
|
@ -241,81 +80,49 @@ M.fg_bg = function(group, fgcol, bgcol)
|
|||
cmd("hi " .. group .. " guifg=" .. fgcol .. " guibg=" .. bgcol)
|
||||
end
|
||||
|
||||
-- Override default config of a plugin based on the path provided in the chadrc
|
||||
-- Arguments:
|
||||
-- 1st - name of plugin
|
||||
-- 2nd - default config path
|
||||
-- 3rd - optional function name which will called from default_config path
|
||||
-- e.g: if given args - "telescope", "plugins.configs.telescope", "setup"
|
||||
-- then return "require('plugins.configs.telescope').setup()"
|
||||
-- if 3rd arg not given, then return "require('plugins.configs.telescope')"
|
||||
-- if override is a table, mark set the override flag for the default config to true
|
||||
-- override flag being true tells the plugin to call tbl_override_req as part of configuration
|
||||
M.load_ifExists = function(module)
|
||||
if #module ~= 0 then
|
||||
if type(module) == "string" then
|
||||
require(module)
|
||||
|
||||
M.override_req = function(name, default_config, config_function)
|
||||
local override, apply_table_override =
|
||||
require("core.utils").load_config().plugins.default_plugin_config_replace[name], "false"
|
||||
local result = default_config
|
||||
if type(override) == "string" and override ~= "" then
|
||||
return "require('" .. override .. "')"
|
||||
elseif type(override) == "table" then
|
||||
apply_table_override = "true"
|
||||
elseif type(override) == "function" then
|
||||
return override
|
||||
end
|
||||
|
||||
result = "('" .. result .. "')"
|
||||
if type(config_function) == "string" and config_function ~= "" then
|
||||
-- add the . to call the functions and concatenate true or false as argument
|
||||
result = result .. "." .. config_function .. "(" .. apply_table_override .. ")"
|
||||
end
|
||||
|
||||
return "require" .. result
|
||||
end
|
||||
|
||||
-- Override parts of default config of a plugin based on the table provided in the chadrc
|
||||
|
||||
-- FUNCTION: tbl_override_req, use `chadrc` plugin config override to modify default config if present
|
||||
-- name = name inside `default_config` / `chadrc`
|
||||
-- default_table = the default configuration table of the plugin
|
||||
-- returns the modified configuration table
|
||||
M.tbl_override_req = function(name, default_table)
|
||||
local override = require("core.utils").load_config().plugins.default_plugin_config_replace[name] or {}
|
||||
return vim.tbl_deep_extend("force", default_table, override)
|
||||
end
|
||||
|
||||
--provide labels to plugins instead of integers
|
||||
M.label_plugins = function(plugins)
|
||||
local plugins_labeled = {}
|
||||
for _, plugin in ipairs(plugins) do
|
||||
plugins_labeled[plugin[1]] = plugin
|
||||
end
|
||||
return plugins_labeled
|
||||
end
|
||||
|
||||
-- remove plugins specified by user from the plugins table
|
||||
M.remove_default_plugins = function(plugins)
|
||||
local removals = require("core.utils").load_config().plugins.default_plugin_remove or {}
|
||||
if not vim.tbl_isempty(removals) then
|
||||
for _, plugin in pairs(removals) do
|
||||
plugins[plugin] = nil
|
||||
-- file[1] = module & file[2] = function
|
||||
elseif type(module) == "table" then
|
||||
require(module[1])[module[2]]()
|
||||
end
|
||||
end
|
||||
return plugins
|
||||
end
|
||||
|
||||
-- append user plugins to default plugins
|
||||
M.add_user_plugins = function(plugins)
|
||||
local user_Plugins = require("core.utils").load_config().plugins.install or {}
|
||||
if type(user_Plugins) == "string"
|
||||
then user_Plugins=require(user_Plugins)
|
||||
-- merge default/user plugin tables
|
||||
|
||||
M.plugin_list = function(default_plugins)
|
||||
local user_plugins = require("core.utils").load_config().plugins.user
|
||||
local plug_override = require("core.default_config").plugins.override
|
||||
|
||||
-- merge default + user plugin table
|
||||
default_plugins = vim.tbl_deep_extend("force", default_plugins, user_plugins)
|
||||
|
||||
local final_table = {}
|
||||
|
||||
for key, _ in pairs(default_plugins) do
|
||||
default_plugins[key][1] = key
|
||||
|
||||
final_table[#final_table + 1] = default_plugins[key]
|
||||
plug_override[#plug_override + 1] = default_plugins[key]
|
||||
end
|
||||
if not vim.tbl_isempty(user_Plugins) then
|
||||
for _, v in pairs(user_Plugins) do
|
||||
plugins[v[1]] = v
|
||||
end
|
||||
|
||||
return final_table
|
||||
end
|
||||
|
||||
M.load_override = function(default_table, plugin_name)
|
||||
local user_table = require("core.utils").load_config().plugins.override[plugin_name]
|
||||
|
||||
if type(user_table) == "table" then
|
||||
default_table = vim.tbl_deep_extend("force", default_table, user_table)
|
||||
else
|
||||
default_table = default_table
|
||||
end
|
||||
return plugins
|
||||
|
||||
return default_table
|
||||
end
|
||||
|
||||
return M
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue