Can not change leader key on neovim
abhsn opened this issue · comments
I am using neovim with kickstart configuration. And added the line below to my ~/.config/nvim/init.lua
file
vim.g.user_emmet_leader_key = '<C-z>'
I also tried this
{
'mattn/emmet-vim',
config = function()
vim.g.user_emmet_leader_key = '<C-z>'
end
},
But it does not change the leader key. The leader key is still C-y
. Am I missing something?
I had leader mapped to ,
for years and it worked just fine. Switched over yesterday to lazy.nvim
(which the kickstart configuration uses as well) and this has broken. Interestingly, for me I don't even need the trailing ,
for it to expand - in my testing, pressing only <C-Y>
works.
To change leader key you have to declare global variable before loading the emmet plugin. First I put that line after lazy plugin's configuration. Now, it's before the lazy's configuration and working as expected.