Skip to content

Commit

Permalink
Local leader key
Browse files Browse the repository at this point in the history
  • Loading branch information
utensil committed Oct 25, 2024
1 parent 35c8724 commit 6bf4873
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
5 changes: 3 additions & 2 deletions init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@ for k, v in pairs(options) do
end

-- set local leader

vim.g.maplocalleader = " "
if vim.g.maplocalleader == nil then
vim.g.maplocalleader = " "
end

-- https://github.com/LunarVim/Neovim-from-scratch/blob/master/lua/user/keymaps.lua

Expand Down
6 changes: 6 additions & 0 deletions lazyvim-init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,13 @@ local current_file = debug.getinfo(1, "S").source:sub(2)
local current_dir = current_file:match "(.*/)"
package.path = package.path .. ";" .. current_dir .. "?.lua"

-- override local leader before loading LazyVim, doesn't work, has to be in lua/lazyvim/config/options.lua
-- vim.g.maplocalleader = " "

-- loading LazyVim
dofile(current_dir .. "init.lua")

-- override other settings after loading LazyVim
dofile(current_dir .. "nvim-init.lua")

vim.schedule(function()
Expand Down
4 changes: 2 additions & 2 deletions trees/uts-002F.tree
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ The leader key is used to trigger many key mappings in normal mode.

The default leader key is a single space, represented by `<leader>` below.

🌕The default local leader key is not set. 💤The default local leader key is set to backslash.
🌕 The default local leader key is not set. I've configure it to be two consecutive spaces. `,` is also a common choice.

I've configure it to be two consecutive spaces. `,` is also a common choice.
💤 The default local leader key is set to backslash. I didn't change it.

With plugin `whichkey` installed, `<leader>` and wait to see some useful mappings.

Expand Down

0 comments on commit 6bf4873

Please sign in to comment.