feat(format): add dot-repeat support for normal mode formatting actions#132
Merged
YousefHadder merged 2 commits intomainfrom Nov 21, 2025
Merged
feat(format): add dot-repeat support for normal mode formatting actions#132YousefHadder merged 2 commits intomainfrom
YousefHadder merged 2 commits intomainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR implements dot-repeat support for normal mode formatting actions in markdown-plus.nvim, enabling users to quickly apply the same formatting to multiple words using Vim's native . command. The implementation uses Neovim's operatorfunc mechanism without requiring external dependencies.
Key Changes:
- Added operatorfunc-based dot-repeat mechanism for formatting commands (bold, italic, strikethrough, code, clear formatting)
- Extended keymap helper to support expression mappings with per-mode configuration
- Updated documentation in README and vimdoc with usage examples
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 7 comments.
| File | Description |
|---|---|
lua/markdown-plus/format/init.lua |
Implements dot-repeat functionality via operatorfunc callbacks and wrapper functions |
lua/markdown-plus/keymap_helper.lua |
Adds support for expression mappings with per-mode expr flag |
doc/markdown-plus.txt |
Documents dot-repeat feature with usage examples |
README.md |
Adds dot-repeat feature description to feature list |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Implements dot-repeat support for normal mode formatting actions, allowing users to quickly apply the same formatting to multiple words using Vim's native
.command.Closes #131
Changes
Implementation
g@loperator mechanism (no external dependencies)Files Modified
lua/markdown-plus/format/init.lua- Core implementation with operatorfunc callbackslua/markdown-plus/keymap_helper.lua- Added expr mapping supportREADME.md- Added feature documentation with examplesdoc/markdown-plus.txt- Updated help docs with usage guideUsage Example
Supported Commands
All normal mode formatting actions are now dot-repeatable:
<leader>mb- Toggle bold<leader>mi- Toggle italic<leader>mc- Toggle inline code<leader>ms- Toggle strikethrough<leader>mC- Clear all formattingTesting
Technical Details
The implementation uses Neovim's operatorfunc mechanism:
expr = trueand return"g@l".command repeats the operatorThis works without any external plugins, though it remains compatible with repeat.vim for enhanced functionality.
Documentation
All documentation has been updated: