[SETTINGS] Ensure <Leader> is mapped before plugin configs are sourced. (#863)

This commit is contained in:
James Walmsley 2021-07-11 09:21:21 +01:00 committed by GitHub
parent f2e4f540a3
commit afe079d821
WARNING! Although there is a key with this ID in the database it does not verify this commit! This commit is SUSPICIOUS.
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 9 deletions

View file

@ -8,15 +8,6 @@ end
which_key.setup(O.plugin.which_key.setup) which_key.setup(O.plugin.which_key.setup)
-- Set leader
if O.leader_key == " " or O.leader_key == "space" then
vim.api.nvim_set_keymap("n", "<Space>", "<NOP>", { noremap = true, silent = true })
vim.g.mapleader = " "
else
vim.api.nvim_set_keymap("n", O.leader_key, "<NOP>", { noremap = true, silent = true })
vim.g.mapleader = O.leader_key
end
local opts = O.plugin.which_key.opts local opts = O.plugin.which_key.opts
local vopts = O.plugin.which_key.vopts local vopts = O.plugin.which_key.vopts

View file

@ -43,6 +43,13 @@ local disabled_built_ins = {
"spellfile_plugin", "spellfile_plugin",
-- 'matchit', 'matchparen', 'shada_plugin', -- 'matchit', 'matchparen', 'shada_plugin',
} }
if O.leader_key == " " or O.leader_key == "space" then
vim.g.mapleader = ' '
else
vim.g.mapleader = O.leader_key
end
for _, plugin in pairs(disabled_built_ins) do for _, plugin in pairs(disabled_built_ins) do
vim.g["loaded_" .. plugin] = 1 vim.g["loaded_" .. plugin] = 1
end end