mattn / emmet-vim

emmet for vim: http://emmet.io/

Home Page:http://mattn.github.io/emmet-vim

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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.