Skip to main content
Magictt provides a comprehensive set of keybindings for efficient Neovim navigation and editing. All keymaps are configured in lua/magictt/core/keymaps.lua.

Leader Key

The leader key is set to Space:
vim.g.mapleader = " "
All keybindings that start with <leader> use the space bar as the prefix.

General Keymaps

Insert Mode

KeymapActionDescription
jk<ESC>Exit insert mode (alternative to ESC)

File Navigation & UI

KeymapActionDescription
<leader>pv:ExOpen file explorer (netrw)
<leader>mm:MasonOpen Mason package manager
<leader>ln:LazyOpen Lazy plugin manager
KeymapActionDescription
<leader>nh:nohlClear search highlights

Number Operations

KeymapActionDescription
<leader>+<C-a>Increment number under cursor
<leader>-<C-x>Decrement number under cursor

Window Management

Efficiently manage split windows:
KeymapActionDescription
<leader>sv<C-w>vSplit window vertically
<leader>sh<C-w>sSplit window horizontally
<leader>se<C-w>=Make splits equal size
<leader>sx:closeClose current split
Combine window splits with the built-in window navigation commands (<C-w>h/j/k/l) to move between splits efficiently.

Tab Management

Manage tabs for organizing multiple buffers:
KeymapActionDescription
<leader>to:tabnewOpen new tab
<leader>tx:tabcloseClose current tab
<leader>tn:tabnGo to next tab
<leader>tp:tabpGo to previous tab
<leader>tf:tabnew %Open current buffer in new tab

LSP Keymaps

These keymaps are automatically configured when an LSP server attaches to a buffer. They are defined in lua/magictt/lsp.lua.

Code Navigation

KeymapActionDescription
gRTelescope LSP referencesShow all references to symbol under cursor
gDGo to declarationJump to declaration
gdGo to definitionJump to definition
giTelescope LSP implementationsShow all implementations
gtTelescope LSP type definitionsShow type definitions

Code Actions & Refactoring

KeymapModesActionDescription
<leader>caNormal, VisualCode actionShow available code actions
<leader>rnNormalRenameSmart rename symbol

Diagnostics

KeymapActionDescription
<leader>DTelescope diagnosticsShow all diagnostics for current buffer
<leader>dOpen floatShow diagnostics for current line
[dJump to previousGo to previous diagnostic
]dJump to nextGo to next diagnostic

Documentation

KeymapActionDescription
KHoverShow documentation for symbol under cursor

LSP Control

KeymapActionDescription
<leader>rs:LspRestartRestart LSP server
LSP keymaps are only available in buffers where an LSP server is attached. For example, gd (go to definition) will only work in files with language server support.

Keymap Categories Summary

General

Basic editing, navigation, and UI controls

Window Management

Create, resize, and navigate split windows

Tab Management

Organize work across multiple tabs

LSP Features

Code intelligence, navigation, and refactoring

Customizing Keymaps

To add your own keymaps, edit lua/magictt/core/keymaps.lua:
local keymap = vim.keymap

-- Example: Add a custom keymap
keymap.set("n", "<leader>w", ":w<CR>", { desc = "Save file" })
Keymap function signature:
keymap.set(mode, lhs, rhs, opts)
  • mode: “n” (normal), “i” (insert), “v” (visual), or for multiple
  • lhs: The key combination to trigger
  • rhs: The action to perform
  • opts: Options table (include desc for documentation)

Vim Options

Core Vim settings and behavior

LSP Setup

Language server configuration

Build docs developers (and LLMs) love