Search code examples
luaneovim

Can't use or set localleader in neovim


I'm pretty new to neovim and vim in general and I tried to use the localleader key (default: \) and nothing happened.

Then I tried to set the localleader key in the config (lua) in various ways I could find online, none of which worked.

However when I type :echo maplocalleader in neovim it shows the key I set.

Setting maplocalleader from within neovim also yielded the same result.

My question is, what might be preventing my localleader key from working?


Solution

  • After setting up neovim again from scratch and copying over my configs piece by piece, I found out that I had to put vim.g.maplocalleader = ";" at the very top of init.lua in order for it to work.