Skip to content

Feat: Support localleader (#3382)#10012

Open
dheerusri324 wants to merge 1 commit into
VSCodeVim:masterfrom
dheerusri324:support-localleader-keymap
Open

Feat: Support localleader (#3382)#10012
dheerusri324 wants to merge 1 commit into
VSCodeVim:masterfrom
dheerusri324:support-localleader-keymap

Conversation

@dheerusri324
Copy link
Copy Markdown

What this PR does / why we need it:
This PR adds support for the <localleader> keymap, acting analogously to the existing <leader> configuration.

In Vim, <localleader> provides a prefix key for buffer-local or filetype-local mappings (often , or \), separate from the global <leader>. Users often rely heavily on these mappings in their existing .vimrc configurations, and previously, they could not easily port those configurations into VSCodeVim without manual translations.

This PR implements <localleader> across the entire codebase to mirror the precise functionality of <leader>, including:

  • Exposing the vim.localleader extension setting (\ by default, same as Vim).
  • Resolving <localleader> securely through key normalization (Notation.NormalizeKey) and execution action loops (CompareKeypressSequence).
  • Integrating with the .vimrc Vimscript parser so <localleader> is fully supported in user map configurations.
  • Accurately processing <localleader> replacement during UI rendering (showcmd status).
  • Enabling TextMate syntax highlighting for <LocalLeader> within .vim files.

Which issue(s) this PR fixes

fixes #3382

Special notes for reviewer:

  • All changes strictly adhere to the pre-existing <leader> implementation structure. NormalizeKey and printableKey have updated signatures to accept an optional third argument for localLeaderKey.
  • Inside recordedState.ts getters, localleader display replacements explicitly run before leader replacements conditionally to prevent collision clobbering when both variables default to the identical \ key sequence.
  • Tested the integration locally in both normal user configuration bounds and custom remapping contexts to verify functionality.

@dheerusri324 dheerusri324 changed the title Feat: Support 'localleader' (#3382) Feat: Support localleader (#3382) May 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support localleader

1 participant