Nvim Keymap Skill
Use this skill when editing or explaining custom Neovim keymaps in this repository.
Source Of Truth
- Put custom Neovim keymaps in
nixos/shared-home-manager/taco/nvf/keymaps.nix. - Keep plugin files under
nixos/shared-home-manager/taco/nvf/plugins/focused on plugin setup, not local key ownership. - If a plugin currently defines a repo-local keymap and it can be expressed as a normal
settings.vim.keymapsentry, move it intokeymaps.nix. - Treat
nixos/shared-home-manager/taco/nvf/keymaps.nixas the file to read first when listing or auditing mappings.
Current Layout Rules
Spaceis the main picker/action namespace, modeled after Helix Space mode.gis the goto/jump namespace, modeled after Helix goto mode.mis the match/surround/textobject namespace, modeled after Helix match mode.zis reserved for Helix-like view-mode aliases when view-only scrolling or alignment helpers are needed.,is fallback space for commands that do not fit the Helix-like layout or would collide with more importantSpace/gbindings.- Keep insert-mode ergonomics and command-line remaps at the top of
keymaps.nix. - Add a short comment above each mapping describing intent, not just the literal action.
Preferred Placement
Space namespace
Use Space first for pickers and LSP actions:
- Telescope pickers: file, buffer, grep, branch, marks, history, keymaps, symbols, diagnostics
- file-browser-like entry points such as
:Yazi cwd - LSP actions such as hover, rename, and code actions
- repo-local utility commands that are not jumps, such as
QuickRun, clipboard helpers, andLspRestart, if they do not collide with a more importantSpacebinding
Examples already used in this repo:
Space efor:Yazi cwdSpace ffor tracked filesSpace gfor git statusSpace Gfor git branchesSpace gcfor git commitsSpace /for live grepSpace afor code actionSpace rfor renameSpace kfor hoverSpace p/Space Pfor system clipboard pasteSpace y/Space Yfor system clipboard yankSpace Cfor copying the current working directorySpace Rfor QuickRunSpace \forLspRestart
g namespace
Use g for location changes and jump-like motions:
gddefinitiongytype definitiongrreferencesgiimplementationsgn/gpnext and previous diagnosticsgj/gfHop-based jump motions
If a mapping is fundamentally about moving focus to another location, prefer g over Space.
m namespace
Use m for match-oriented editing helpers, especially bracket matching, surround operations, and textobject entry points.
Examples already used in this repo:
mmmatching bracket jumpmssurround add prefixmrsurround replace prefixmdsurround delete prefixmaaround-textobject visual selection prefixmiinside-textobject visual selection prefix
z namespace
Use z for Helix-like view manipulation that changes the viewport without changing the editing target.
Examples already used in this repo:
zcvertical centeringzj/zkview-only scrollingzmhorizontal alignment helper
, namespace
Use , only when:
- the natural
Spaceorgslot is already occupied by a more important mapping - the command is repo-specific and not meaningfully Helix-like
- the mapping is an overflow command such as
QuickRun
Editing Workflow
- Read
nixos/shared-home-manager/taco/nvf/keymaps.nix. - Search
nixos/shared-home-manager/taco/nvf/plugins/for stray keymaps. - If changing placement, preserve the existing namespace logic above.
- Update comments so the intent stays obvious in-file.
- If keymap ownership moved out of a plugin file, remove the old plugin-local keymap.
- When the user asks for an inventory, include mappings from both
keymaps.nixand any remaining plugin-local keymaps.
Verification
After keymap edits:
- Run
nixfmton changed Nix files. - Run
nix flake checkinnixos/darwin. - Run
nix flake checkinnixos/linux. - If Linux evaluation fails because
NIXOS_PRIVATE_CONFIGis missing, report that explicitly instead of masking it.
File References
nixos/shared-home-manager/taco/nvf/keymaps.nixnixos/shared-home-manager/taco/nvf/default.nixnixos/shared-home-manager/taco/nvf/plugins/
