diff --git a/README.md b/README.md index 42d4765..ed5cfe2 100644 --- a/README.md +++ b/README.md @@ -695,17 +695,17 @@ loading vimspector**: let g:vimspector_enable_mappings = 'VISUAL_STUDIO' ``` -| Key | Function | API | -| --- | --- | --- | -| `F5` | When debugging, continue. Otherwise start debugging. | `vimspector#Continue()` | -| `Shift F5` | Stop debugging. | `vimspector#Stop()` | -| `Ctrl Shift F5` | Restart debugging with the same configuration. | `vimspector#Restart()` | -| `F6` | Pause debuggee. | `vimspector#Pause()` | -| `F9` | Toggle line breakpoint on the current line. | `vimspector#ToggleBreakpoint()` | -| `Shift F9` | Add a function breakpoint for the expression under cursor | `vimspector#AddFunctionBreakpoint( '' )` | -| `F10` | Step Over | `vimspector#StepOver()` | -| `F11` | Step Into | `vimspector#StepInto()` | -| `Shift F11` | Step out of current function scope | `vimspector#StepOut()` | +| Key | Function | API | +| --- | --- | --- | +| `F5` | When debugging, continue. Otherwise start debugging. | `vimspector#Continue()` | +| `Shift F5` | Stop debugging. | `vimspector#Stop()` | +| `Ctrl Shift F5` | Restart debugging with the same configuration. | `vimspector#Restart()` | +| `F6` | Pause debuggee. | `vimspector#Pause()` | +| `F9` | Toggle line breakpoint on the current line. | `vimspector#ToggleBreakpoint()` | +| `Shift F9` | Add a function breakpoint for the expression under cursor | `vimspector#AddFunctionBreakpoint( '' )` | +| `F10` | Step Over | `vimspector#StepOver()` | +| `F11` | Step Into | `vimspector#StepInto()` | +| `Shift F11` | Step out of current function scope | `vimspector#StepOut()` | ## Human Mode @@ -720,19 +720,20 @@ loading vimspector**: let g:vimspector_enable_mappings = 'HUMAN' ``` -| Key | Function | API | -| --- | --- | --- | -| `F5` | When debugging, continue. Otherwise start debugging. | `vimspector#Continue()` | -| `F3` | Stop debugging. | `vimspector#Stop()` | -| `F4` | Restart debugging with the same configuration. | `vimspector#Restart()` | -| `F6` | Pause debuggee. | `vimspector#Pause()` | -| `F9` | Toggle line breakpoint on the current line. | `vimspector#ToggleBreakpoint()` | +| Key | Function | API | +| --- | --- | --- | +| `F5` | When debugging, continue. Otherwise start debugging. | `vimspector#Continue()` | +| `F5` | Start debugging, do not default the debug profile | `vimspector#Launch( v:true )` | +| `F3` | Stop debugging. | `vimspector#Stop()` | +| `F4` | Restart debugging with the same configuration. | `vimspector#Restart()` | +| `F6` | Pause debuggee. | `vimspector#Pause()` | +| `F9` | Toggle line breakpoint on the current line. | `vimspector#ToggleBreakpoint()` | | `F9` | Toggle conditional line breakpoint on the current line. | `vimspector#ToggleBreakpoint( { trigger expr, hit count expr } )` | -| `F8` | Add a function breakpoint for the expression under cursor | `vimspector#AddFunctionBreakpoint( '' )` | -| `F8` | Run to Cursor | `vimspector#RunToCursor()` | -| `F10` | Step Over | `vimspector#StepOver()` | -| `F11` | Step Into | `vimspector#StepInto()` | -| `F12` | Step out of current function scope | `vimspector#StepOut()` | +| `F8` | Add a function breakpoint for the expression under cursor | `vimspector#AddFunctionBreakpoint( '' )` | +| `F8` | Run to Cursor | `vimspector#RunToCursor()` | +| `F10` | Step Over | `vimspector#StepOver()` | +| `F11` | Step Into | `vimspector#StepInto()` | +| `F12` | Step out of current function scope | `vimspector#StepOut()` | In addition, I recommend adding a mapping to `VimspectorBalloonEval`, in normal and visual modes, for example: @@ -746,6 +747,10 @@ nmap di VimspectorBalloonEval xmap di VimspectorBalloonEval ``` +If you would like to have custom mappings, or mappings active only while +debugging, then take a look at the +[customisation sectoin](#custom-mappings-while-debugging). + # Usage and API This section defines detailed usage instructions, organised by feature. For most diff --git a/tests/mappings.test.vim b/tests/mappings.test.vim index b0e288c..862b06d 100644 --- a/tests/mappings.test.vim +++ b/tests/mappings.test.vim @@ -141,3 +141,29 @@ function! Test_Use_Mappings_HUMAN() %bwipeout! endfunction + +function! SetUp_Test_Use_Mappings_HUMAN_ForceMenu() + let g:vimspector_enable_mappings = 'HUMAN' +endfunction + +function! Test_Use_Mappings_HUMAN_ForceMenu() + call ThisTestIsFlaky() + lcd testdata/cpp/simple + edit simple.cpp + call setpos( '.', [ 0, 15, 1 ] ) + + " Comma is the leader + py3 <", "xt" )' ) + sfl.assert_called() +EOF + + call vimspector#test#signs#AssertCursorIsAtLineInBuffer( 'simple.cpp', 15, 1 ) + + call vimspector#test#setup#Reset() + + lcd - + %bwipeout! +endfunction