From baea053e84cdda9ad20250787eb979a066ac0c8d Mon Sep 17 00:00:00 2001 From: Ben Jackson Date: Tue, 9 Jan 2024 21:53:47 +0000 Subject: [PATCH] Add C-F10 mapping for RunToCursor in VS Assuming your terminal and Vim can interpret that key combination. Fixes #822 --- README.md | 6 ++++++ plugin/vimspector.vim | 1 + tests/mappings.test.vim | 1 + 3 files changed, 8 insertions(+) diff --git a/README.md b/README.md index d43430ac5..cc48df843 100644 --- a/README.md +++ b/README.md @@ -738,10 +738,16 @@ let g:vimspector_enable_mappings = 'VISUAL_STUDIO' | `F9` | `VimspectorToggleBreakpoint` | Toggle line breakpoint on the current line. | `Shift F9` | `VimspectorAddFunctionBreakpoint` | Add a function breakpoint for the expression under cursor | `F10` | `VimspectorStepOver` | Step Over +| `Ctrl F10` | `VimspectorRunToCursor` | Run to cursor* | `F11` | `VimspectorStepInto` | Step Into | `Shift F11` | `VimspectorStepOut` | Step out of current function scope | `Alt 8` | `VimspectorDisassemble` | Show disassembly +***NOTE: Some mappings, such as ctrl and F-keys may not work depending on your +terminal, keyboard, windowing system and all sorts of other things. +See `:help modifyOtherKeys` and other sources. If you are unable to make this +work, just use the "human mode" mappings.*** + ## Human Mode If, like me, you only have 2 hands and 10 fingers, you probably don't like diff --git a/plugin/vimspector.vim b/plugin/vimspector.vim index 900933eb3..ca6aa2275 100644 --- a/plugin/vimspector.vim +++ b/plugin/vimspector.vim @@ -130,6 +130,7 @@ if s:mappings ==# 'VISUAL_STUDIO' nmap VimspectorToggleBreakpoint nmap VimspectorAddFunctionBreakpoint nmap VimspectorStepOver + nmap VimspectorRunToCursor nmap VimspectorStepInto nmap VimspectorStepOut nmap VimspectorDisassemble diff --git a/tests/mappings.test.vim b/tests/mappings.test.vim index fc1102c2f..a1720d16e 100644 --- a/tests/mappings.test.vim +++ b/tests/mappings.test.vim @@ -45,6 +45,7 @@ function! Test_Mappings_Are_Added_VISUAL_STUDIO() call assert_true( hasmapto( 'vimspector#StepOver()' ) ) call assert_true( hasmapto( 'vimspector#StepInto()' ) ) call assert_true( hasmapto( 'vimspector#StepOut()' ) ) + call assert_true( hasmapto( 'vimspector#RunToCursor()' ) ) endfunction function! SetUp_Test_Use_Mappings_HUMAN()