Hi everyone,
I’m new to Neovim and I’m setting up my configuration for the first time. I’ve followed some guides and set up my init.lua file, but I’m running into issues with my leader key commands not working.
Here’s what I’ve done so far:
Set the Leader Key: I’ve defined the leader key as space in my init.lua file with the following line:
vim.g.mapleader = " "
Defined Key Mappings: I’ve added some key mappings using the leader key, like this:
-- Example mapping to clear search highlights
keymap.set("n", "<leader>nh", ":nohl<CR>", { desc = "Clear search highlights" })
Issues:
The leader key commands don’t seem to work. For example, when I enter commands like <leader>sh
, Neovim goes into Insert mode and inserts h
into the file.
following this article : How I Setup Neovim On My Mac To Make it AMAZING in 2024