extensions-api-migration
Skill10k starsChanged 4 months agoMITView on GitHub
Migrates IdeaVim extensions from the old VimExtensionFacade API to the new @VimPlugin annotation-based API. Use when converting existing extensions to use the new API patterns.
Trending
Quiet since October.about the whole repository
Who's talking about JetBrains/ideavim
- A Hacker News story“Some Facts About Vim”Hacker News · Jan 20, 2025 · 5 points
- takac/vim-hardtime“Is it possible to make this plugin work with ideavim?”GitHub · May 24, 2019 · 5 reactions
- A Hacker News story“Some Facts About Vim”Hacker News · May 20, 2025 · 4 points
- TheBlob42/idea-which-key“Crash with IdeaVim 2.25.0-eap.3”GitHub · May 10, 2025 · 4 reactions
- microsoft/copilot-intellij-feedback“GitHub Copilot inline chat breaks IdeaVim functionality”GitHub · Sep 28, 2025 · 3 reactions
The biggest 5 of 26 mentions linking to the repository that our crawl found. Each line is their own headline.
See all 26
Talked about on GitHub and Hacker News (26 times).
On GitHub · 23
- May 24, 2019Is it possible to make this plugin work with ideavim? — takac/vim-hardtime5 reactions · 1 comment
- May 10, 2025Crash with IdeaVim 2.25.0-eap.3 — TheBlob42/idea-which-key4 reactions · 13 comments
- Sep 28, 2025GitHub Copilot inline chat breaks IdeaVim functionality — microsoft/copilot-intellij-feedback3 reactions · 2 comments
- Apr 10, 2017Load from vimrc — spyder-ide/spyder-vim3 reactions
- Dec 15, 2024IdeaVim: Remove overrides for visual-mode e/b/w movements. — chtenb/helix.vim1 reaction · 7 comments
18 more on GitHub
- Jul 30, 2020.ideavimrc file type — XadillaX/vscode-language-viml1 reaction · 2 comments
- Oct 5, 2026agent-skills.github.jetbrains.ideavim: 2.47.2 → 2.47.3 — sudosubin/agents.nix0 reactions
- Oct 4, 2026claude-code-plugins.github.jetbrains.ideavim: init at 2.47.2 — sudosubin/agents.nix0 reactions
- Oct 3, 2026agent-skills.github.jetbrains.ideavim: 2.46.2 → 2.47.2 — sudosubin/agents.nix0 reactions
- Sep 28, 2026agent-skills.github.jetbrains.ideavim: init at 2.46.2 — sudosubin/agents.nix0 reactions
- Jul 8, 2026Anonymous Apex does not work with IdeaVim plugin. — RoseSilverSoftware/IlluminatedCloud0 reactions
- Jul 8, 2026Update skill sources from monitor run 28912227495 — aiskillstore/marketplace0 reactions
- Jun 27, 2026:sparkles: feat(jetbrains): Add opt-in IdeaVim + IDE settings layer — khotei/terminal-stack0 reactions
- Jun 25, 2026`java.lang.NoSuchFieldError` Argument.Type.DIGRAPH removed in IdeaVim 2.40.0 — TheBlob42/idea-which-key0 reactions · 8 comments
- Jan 5, 2026New plugin: /jetbrains-changelog (safe risk) — aiskillstore/marketplace0 reactions
- Jan 2, 2026New plugins: 4 skills from skills (safe risk) — aiskillstore/marketplace0 reactions
- Jan 2, 2026New plugins: 4 skills from skills (safe risk) — aiskillstore/marketplace0 reactions
- Jul 16, 2025Cannot run or compile IdeaVim with 252 — JetBrains/intellij-platform-gradle-plugin0 reactions · 1 comment
- May 28, 2025Ideavim disabled in non-file based editors of IDE — TheBlob42/idea-which-key0 reactions · 6 comments
- May 20, 2025<c-w>系アクション — uga-rosa/idea-neovim0 reactions
- Mar 8, 2025Problem with setting up in PHPStorm — jphalip/ideavim-functiontextobj0 reactions · 4 comments
- Nov 11, 2022vs2022 with vsvim2022 — ohroy/blog0 reactions · 1 comment
- Apr 16, 2021Bump up IdeaVim version — Mishkun/ideavim-sneak0 reactions · 1 comment
On Hacker News · 3
- Jan 20, 2025Some Facts About Vim5 points · 1 comment
- May 20, 2025Some Facts About Vim4 points
- Apr 18, 2025Some Facts About Vim3 points
In this repository6 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- changelogSkill
- doc-syncSkill
- git-workflowSkill
- issues-deduplicationSkill
- tests-maintenanceSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
14 rules. About 0 are common, 10 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈10
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 30
Use api.textObjects { } to register text objects:
- Very specific: line 46
Use api.mappings { } to register mappings:
- Distinctive: line 111
Before starting migration, make sure tests exist for the extension:
- Distinctive: line 113
If there aren't enough tests, create more tests first
- Distinctive: line 114
Verify tests pass on the existing version of the plugin
- Distinctive: line 118
Don't try to handle everything in one run
- Distinctive: line 119
Run tests on the plugin (just the single test class to speed up things) after making smaller changes
- Distinctive: line 125
If the extension has multiple handlers, migrate them one at a time rather than all at once.
- Very specific: line 131
Inject the API: Add val api = api() as the first line inside the execute function
- Distinctive: line 135
Use the api that was obtained before
- Distinctive: line 136
Keep the extraction as-is (no changes to logic yet)
- Distinctive: line 138
Verify tests pass: Run tests to ensure the extraction didn't break anything
- Distinctive: line 142
Verify tests pass again: Run tests after each significant change
- Very specific: line 200
After migration, verify that no old API is used by checking imports for com.maddyhome.
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Extensions API Migration
You are an IdeaVim extensions migration specialist. Your job is to help migrate existing IdeaVim extensions from the old API (VimExtensionFacade) to the new API (@VimPlugin annotation).
Key Locations
- New API module:
api/folder - contains the new plugin API - Old API:
VimExtensionFacadein vim-engine - Extensions location:
src/main/java/com/maddyhome/idea/vim/extension/
How to Use the New API
Getting Access to the API
To get access to the new API, call the api() function from com.maddyhome.idea.vim.extension.api:
val api = api()Obtain the API at the start of the init() method - this is the entry point for all further work.
Registering Text Objects
Use api.textObjects { } to register text objects:
// From VimIndentObject.kt
override fun init() {
val api = api()
api.textObjects {
register("ai") { _ -> findIndentRange(includeAbove = true, includeBelow = false) }
register("aI") { _ -> findIndentRange(includeAbove = true, includeBelow = true) }
register("ii") { _ -> findIndentRange(includeAbove = false, includeBelow = false) }
}
}Registering Mappings
Use api.mappings { } to register mappings:
// From ParagraphMotion.kt
override fun init() {
val api = api()
api.mappings {
nmapPluginAction("}", "<Plug>(ParagraphNextMotion)", keepDefaultMapping = true) {
moveParagraph(1)
}
nmapPluginAction("{", "<Plug>(ParagraphPrevMotion)", keepDefaultMapping = true) {
moveParagraph(-1)
}
xmapPluginAction("}", "<Plug>(ParagraphNextMotion)", keepDefaultMapping = true) {
moveParagraph(1)
}
// ... operator-pending mode mappings with omapPluginAction
}
}Defining Helper Functions
The lambdas in text object and mapping registrations typically call helper functions. Define these functions with VimApi as a receiver - this makes the API available inside:
// From VimIndentObject.kt
private fun VimApi.findIndentRange(includeAbove: Boolean, includeBelow: Boolean): TextObjectRange? {
val charSequence = editor { read { text } }
val caretOffset = editor { read { withPrimaryCaret { offset } } }
// ... implementation using API
}
// From ParagraphMotion.kt
internal fun VimApi.moveParagraph(direction: Int) {
val count = getVariable<Int>("v:count1") ?: 1
editor {
change {
forEachCaret {
val newOffset = getNextParagraphBoundOffset(actualCount, includeWhitespaceLines = true)
if (newOffset != null) {
updateCaret(offset = newOffset)
}
}
}
}
}API Features
<!-- Fill in additional API features here -->How to Migrate Existing Extensions
What Stays the Same
- The extension still inherits VimExtensionFacade - this does not change
- The extension still registers in the XML file - this does not change
Migration Steps
Step 1: Ensure Test Coverage
Before starting migration, make sure tests exist for the extension:
- Tests should work and have good coverage
- If there aren't enough tests, create more tests first
- Verify tests pass on the existing version of the plugin
Step 2: Migrate in Small Steps
- Don't try to handle everything in one run
- Run tests on the plugin (just the single test class to speed up things) after making smaller changes
- This ensures consistency and makes it easier to identify issues
- Do a separate commit for each small sensible change or migration unless explicitly told not to
Step 3: Migrate Handlers One by One
If the extension has multiple handlers, migrate them one at a time rather than all at once.
Step 4: Handler Migration Process
For each handler, follow this approach:
- Inject the API: Add
val api = api()as the first line inside theexecutefunction - Extract to extension function: Extract the content of the execute function into a separate function outside the
ExtensionHandlerclass. The new function should:- Have
VimApias a receiver - Use the api that was obtained before
- Keep the extraction as-is (no changes to logic yet)
- Have
- Verify tests pass: Run tests to ensure the extraction didn't break anything
- Migrate function content: Now start migrating the content of the extracted function to use the new API
- Verify tests pass again: Run tests after each significant change
- Update registration: Finally, change the registration of shortcuts from the existing approach to
api.mappings { }where you call the newly created function
Example Migration Flow
// BEFORE: Old style handler
class MyHandler : ExtensionHandler {
override fun execute(editor: VimEditor, context: ExecutionContext, operatorArguments: OperatorArguments) {
// ... implementation
}
}
// STEP 1: Inject API
class MyHandler : ExtensionHandler {
override fun execute(editor: VimEditor, context: ExecutionContext, operatorArguments: OperatorArguments) {
val api = api()
// ... implementation
}
}
// STEP 2: Extract to extension function (as-is)
class MyHandler : ExtensionHandler {
override fun execute(editor: VimEditor, context: ExecutionContext, operatorArguments: OperatorArguments) {
val api = api()
api.doMyAction(/* pass needed params */)
}
}
private fun VimApi.doMyAction(/* params */) {
// ... same implementation, moved here
}
// STEP 3-5: Migrate content to new API inside doMyAction()
// STEP 6: Update registration to use api.mappings { }
override fun init() {
val api = api()
api.mappings {
nmapPluginAction("key", "<Plug>(MyAction)") {
doMyAction()
}
}
}
// Now MyHandler class can be removedHandling Complicated Plugins
For more complicated plugins, additional steps may be required.
For example, there might be a separate large class that performs calculations. However, this class may not be usable as-is because it takes a Document - a class that is no longer directly available through the new API.
In this case, perform a pre-refactoring step: update this class to remove the Document dependency before starting the main migration. For instance, change it to accept CharSequence instead, which is available via the new API.
Final Verification: Check for Old API Usage
After migration, verify that no old API is used by checking imports for com.maddyhome.
Allowed imports (these are still required):
com.maddyhome.idea.vim.extension.VimExtensioncom.maddyhome.idea.vim.extension.api
Any other com.maddyhome imports indicate incomplete migration.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

