Skip to main content
This configuration uses a carefully organized system of keymaps with <Space> as the leader key. Keymaps are defined in multiple locations based on their scope and purpose.

Keymap organization

Keymaps in this configuration are organized into three categories:
  1. Global keymaps - Defined in lua/config/keymaps.lua for universal operations
  2. LSP keymaps - Buffer-local keymaps set in lua/plugins/lsp/init.lua when LSP attaches
  3. Plugin keymaps - Defined within individual plugin configuration files

Leader key configuration

The leader key is set to <Space> at the very beginning of initialization:
init.lua:2-3
vim.g.mapleader = " "
vim.g.maplocalleader = " "
The leader key must be set before lazy.nvim loads to ensure all plugin keymaps use the correct leader.

Global keymaps

Editing operations

KeyModeDescription
JvisualMove selected lines down
KvisualMove selected lines up
<visualIndent left (stays in visual mode)
>visualIndent right (stays in visual mode)
XnormalSplit line at cursor position
dnormal, visualDelete without copying to clipboard
Dnormal, visualDelete to end of line without copying
KeyModeDescription
Hnormal, visual, operatorJump to start of line (^)
Lnormal, visual, operatorJump to end of line (g_)
<Left>normalPrevious buffer
<Right>normalNext buffer

Centered search navigation

All search operations keep results centered for better visibility:
KeyModeDescription
nnormalNext match (centered)
NnormalPrevious match (centered)
*normalSearch word under cursor (centered)
#normalSearch word backward (centered)
g*normalSearch partial word (centered)
g#normalSearch partial word backward (centered)
lua/config/keymaps.lua:25-31
vim.keymap.set("n", "n", "nzzzv", { desc = "Next Match (centered)" })
vim.keymap.set("n", "N", "Nzzzv", { desc = "Prev Match (centered)" })
vim.keymap.set("n", "*", "*zzzv", { desc = "Search Word (centered)" })
vim.keymap.set("n", "#", "#zzzv", { desc = "Search Word Back (centered)" })
vim.keymap.set("n", "g*", "g*zz", { desc = "Search Partial (centered)" })
vim.keymap.set("n", "g#", "g#zz", { desc = "Search Partial Back (centered)" })

Lua execution

Execute Lua code directly in Neovim:
KeyModeDescription
<leader>rcnormalSource current file
<leader>xnormalExecute current line as Lua
<leader>xvisualExecute selection as Lua

Quickfix and diagnostics

KeyModeDescription
<M-j>normalNext quickfix item
<M-k>normalPrevious quickfix item
<M-q>normalOpen quickfix list
<leader>qnormalOpen diagnostic quickfix list
<leader>denormalShow diagnostic error messages in float

Utility keymaps

Line numbers in visual mode

Get highlighted line numbers when selecting code:
lua/config/keymaps.lua:33-39
vim.keymap.set(
  "v",
  "<leader>ln",
  ':lua require("core.utils").get_highlighted_line_numbers()<CR>',
  { desc = "Copy Line Numbers", silent = true }
)

File path copying

Copy the current file path with line number:
lua/config/keymaps.lua:136-138
vim.keymap.set("n", "<leader>cp", function()
  require("core.utils").copyFilePathAndLineNumber()
end, { desc = "Copy file path with line number" })
Open URLs or file paths under cursor:
lua/config/keymaps.lua:64-71
vim.keymap.set("n", "gX", function()
  local target = vim.fn.expand("<cfile>")
  if target == nil or target == "" then
    vim.notify("No link under cursor", vim.log.levels.WARN)
    return
  end
  vim.ui.open(target)
end, { desc = "Open link under cursor" })

Terminal mode

KeyModeDescription
<Esc><Esc>terminalExit terminal mode to normal mode

Window management

Floating window focus

Jump into floating windows (diagnostic floats, hover windows, etc.):
lua/config/keymaps.lua:91-100
vim.keymap.set("n", "<C-w>f", function()
  local wins = vim.api.nvim_list_wins()
  for _, win in ipairs(wins) do
    local config = vim.api.nvim_win_get_config(win)
    if config.relative ~= "" then -- This is a floating window
      vim.api.nvim_set_current_win(win)
      break
    end
  end
end, { desc = "Focus floating [W]indow" })

Code actions

Tiny code action

Enhanced code action UI:
lua/config/keymaps.lua:114-116
vim.keymap.set({ "n", "x" }, "<leader>ca", function()
  require("tiny-code-action").code_action({})
end, { noremap = true, silent = true, desc = "[C]ode [A]ction" })

Code lens

Run available code lens actions:
lua/config/keymaps.lua:119
vim.keymap.set("n", "<leader>cl", vim.lsp.codelens.run, { desc = "Run [C]ode[L]ens actions" })

Call hierarchy

LSP call hierarchy navigation:
lua/config/keymaps.lua:122-134
-- Show incoming calls (who calls this function)
vim.keymap.set(
  "n",
  "<leader>ci",
  vim.lsp.buf.incoming_calls,
  { desc = "Show [C]all hierarchy [I]ncoming" }
)

-- Show outgoing calls (what this function calls)
vim.keymap.set(
  "n",
  "<leader>co",
  vim.lsp.buf.outgoing_calls,
  { desc = "Show [C]all hierarchy [O]utgoing" }
)

Diagnostic yank

Copy diagnostic message under cursor to clipboard:
lua/config/keymaps.lua:74-88
vim.keymap.set("n", "<leader>dy", function()
  local diagnostics = vim.diagnostic.get(0, { lnum = vim.fn.line(".") - 1 })
  if #diagnostics > 0 then
    local messages = {}
    for _, diag in ipairs(diagnostics) do
      table.insert(messages, diag.message)
    end
    local full_message = table.concat(messages, "\n")
    vim.fn.setreg("+", full_message)
    vim.fn.setreg('"', full_message)
    vim.notify("Diagnostic message(s) yanked to clipboard", vim.log.levels.INFO)
  else
    vim.notify("No diagnostic message on this line", vim.log.levels.WARN)
  end
end, { desc = "[D]iagnostic [Y]ank message" })

Disabled keymaps

Command-line window (q:)

The command-line window is disabled to prevent accidental activation:
lua/config/keymaps.lua:141-143
vim.keymap.set({ "n", "v" }, "q:", function()
  vim.notify("Command-line window (q:) is disabled. Use :q to quit.", vim.log.levels.INFO)
end, { desc = "Disable command-line window (q:)" })

Customization

For complete keymap references organized by feature, see:

General keymaps

Editing, navigation, and utility keymaps

LSP keymaps

Language server protocol keybindings

Git keymaps

Git operations and version control

Navigation keymaps

File and buffer navigation

Adding custom keymaps

To add your own keymaps, edit lua/config/keymaps.lua:
lua/config/keymaps.lua
-- Add at the end of the file
vim.keymap.set("n", "<leader>my", function()
  -- Your custom function
end, { desc = "My custom keymap" })
Always provide a descriptive desc field for keymaps. This makes them discoverable in which-key (<leader>?) and helps with documentation.
For plugin-specific keymaps, define them in the plugin’s configuration file in lua/plugins/. For LSP keymaps, modify the setup_keymaps() function in lua/plugins/lsp/init.lua.

Build docs developers (and LLMs) love