mattn / emmet-vim

emmet for vim: http://emmet.io/
http://mattn.github.io/emmet-vim
MIT License
6.39k stars 411 forks source link

Can not change leader key on neovim #548

Closed abhsn closed 1 year ago

abhsn commented 1 year ago

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?

zeitchef commented 1 year ago

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.

abhsn commented 1 year ago

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.