@@ -64,6 +64,10 @@ set matchit
6464
6565" Key maps
6666
67+ " Variables for custom keymaps based on the current IDE flavor (:echo &ide).
68+ " https://github.com/JetBrains/ideavim/discussions/375
69+ let is_ide_rider = &ide == 'JetBrains Rider'
70+
6771" https://www.lazyvim.org/configuration/keymaps
6872
6973" To track Action-IDs
@@ -257,6 +261,7 @@ nmap <leader>cc :echo 'There is no equivalent mapping for Run Codelens.'<cr>
257261nmap <leader>cC :echo 'There is no equivalent mapping for Refresh & Display Codelens.'<cr>
258262" Rename File
259263nmap <leader>cR <Action>(RenameFile)
264+ if is_ide_rider | nmap <leader>cR <Action>(RiderRenameFile) | endif
260265" Rename
261266nmap <leader>cr <Action>(RenameElement)
262267" Source Action
@@ -447,26 +452,33 @@ nmap <leader>du <Action>(ActivateDebugToolWindow)
447452
448453" Run Last
449454nmap <leader>tl <Action>(Run)
455+ if is_ide_rider | nmap <leader>tl <Action>(RiderUnitTestRunCurrentSessionAction) | endif
450456" Show Output
451457nmap <leader>to <Action>(ActivateRunToolWindow)
458+ if is_ide_rider | nmap <leader>to <Action>(ActivateUnitTestsToolWindow) | endif
452459" Toggle Output Panel
453460nmap <leader>tO <Action>(ActivateRunToolWindow)
461+ if is_ide_rider | nmap <leader>tO <Action>(ActivateUnitTestsToolWindow) | endif
454462" Run Nearest
455463nmap <leader>tr <Action>(RunClass)
464+ if is_ide_rider | nmap <leader>tr <Action>(RiderUnitTestRunContextAction) | endif
456465" Toggle Summary
457466nmap <leader>ts :echo 'Not yet implmented.'<cr>
458467" Stop
459468nmap <leader>tS <Action>(Stop)
460469" Run File
461470nmap <leader>tt <Action>(RunClass)
471+ if is_ide_rider | nmap <leader>tt <Action>(RiderUnitTestRunContextAction) | endif
462472" Run All Test Files
463473nmap <leader>tT :echo 'Not yet implmented.'<cr>
474+ if is_ide_rider | nmap <leader>tT <Action>(RiderUnitTestRunSolutionAction) | endif
464475" Toggle Watch
465476nmap <leader>tw :echo 'Not yet implmented.'<cr>
466477
467478" nvim-dap
468479" Debug Nearest
469480nmap <leader>td <Action>(ChooseDebugConfiguration)
481+ if is_ide_rider | nmap <leader>td <Action>(RiderUnitTestDebugContextAction) | endif
470482
471483" Buffer Keymaps
472484
0 commit comments