Update docs for new mappings

This commit is contained in:
Ben Jackson 2021-03-12 21:50:37 +00:00
commit 6b67d165b9

View file

@ -656,18 +656,23 @@ personal and so you should work out what you like and use vim's powerful mapping
features to set your own mappings. To that end, Vimspector defines the following features to set your own mappings. To that end, Vimspector defines the following
`<Plug>` mappings: `<Plug>` mappings:
* `<Plug>VimspectorContinue` | Mapping | Function | API |
* `<Plug>VimspectorStop` | --- | --- | --- |
* `<Plug>VimspectorRestart` | `<Plug>VimspectorContinue` | When debugging, continue. Otherwise start debugging. | `vimspector#Continue()` |
* `<Plug>VimspectorPause` | `<Plug>VimspectorStop` | Stop debugging. | `vimspector#Stop()` |
* `<Plug>VimspectorToggleBreakpoint` | `<Plug>VimpectorRestart` | Restart debugging with the same configuration. | `vimspector#Restart()` |
* `<Plug>VimspectorToggleConditionalBreakpoint` | `<Plug>VimspectorPause` | Pause debuggee. | `vimspector#Pause()` |
* `<Plug>VimspectorAddFunctionBreakpoint` | `<Plug>VimspectorToggleBreakpoint` | Toggle line breakpoint on the current line. | `vimspector#ToggleBreakpoint()` |
* `<Plug>VimspectorStepOver` | `<Plug>VimspectorToggleConditionalBreakpoint` | Toggle conditional line breakpoint on the current line. | `vimspector#ToggleBreakpoint( { trigger expr, hit count expr } )` |
* `<Plug>VimspectorStepInto` | `<Plug>VimspectorAddFunctionBreakpoint` | Add a function breakpoint for the expression under cursor | `vimspector#AddFunctionBreakpoint( '<cexpr>' )` |
* `<Plug>VimspectorStepOut` | `<Plug>VimspectorRunToCursor` | Run to Cursor | `vimspector#RunToCursor()` |
* `<Plug>VimspectorRunToCursor` | `<Plug>VimspectorStepOver` | Step Over | `vimspector#StepOver()` |
* `<Plug>VimspectorBalloonEval` | `<Plug>VimspectorStepInto` | Step Into | `vimspector#StepInto()` |
| `<Plug>VimspectorStepOut` | Step out of current function scope | `vimspector#StepOut()` |
| `<Plug>VimspectorUpFrame` | Move up a frame in the current call stack | `vimspector#UpFrame()` |
| `<Plug>VimspectorDownFrame` | Move down a frame in the current call stack | `vimspector#DownFrame()` |
| `<Plug>VimspectorBalloonEval` | Evaluate expression under cursor (or visual) in popup | *internal* |
These map roughly 1-1 with the API functions below. These map roughly 1-1 with the API functions below.
@ -695,17 +700,17 @@ loading vimspector**:
let g:vimspector_enable_mappings = 'VISUAL_STUDIO' let g:vimspector_enable_mappings = 'VISUAL_STUDIO'
``` ```
| Key | Function | API | | Key | Mapping | Function
| --- | --- | --- | | --- | --- | ---
| `F5` | When debugging, continue. Otherwise start debugging. | `vimspector#Continue()` | | `F5` | `<Plug>VimspectorContinue` | When debugging, continue. Otherwise start debugging.
| `Shift F5` | Stop debugging. | `vimspector#Stop()` | | `Shift F5` | `<Plug>VimspectorStop` | Stop debugging.
| `Ctrl Shift F5` | Restart debugging with the same configuration. | `vimspector#Restart()` | | `Ctrl Shift F5` | `<Plug>VimspectorRestart` | Restart debugging with the same configuration.
| `F6` | Pause debuggee. | `vimspector#Pause()` | | `F6` | `<Plug>VimspectorPause` | Pause debuggee.
| `F9` | Toggle line breakpoint on the current line. | `vimspector#ToggleBreakpoint()` | | `F9` | `<Plug>VimspectorToggleBreakpoint` | Toggle line breakpoint on the current line.
| `Shift F9` | Add a function breakpoint for the expression under cursor | `vimspector#AddFunctionBreakpoint( '<cexpr>' )` | | `Shift F9` | `<Plug>VimspectorAddFunctionBreakpoint` | Add a function breakpoint for the expression under cursor
| `F10` | Step Over | `vimspector#StepOver()` | | `F10` | `<Plug>VimspectorStepOver` | Step Over
| `F11` | Step Into | `vimspector#StepInto()` | | `F11` | `<Plug>VimspectorStepInto` | Step Into
| `Shift F11` | Step out of current function scope | `vimspector#StepOut()` | | `Shift F11` | `<Plug>VimspectorStepOut` | Step out of current function scope
## Human Mode ## Human Mode
@ -720,19 +725,19 @@ loading vimspector**:
let g:vimspector_enable_mappings = 'HUMAN' let g:vimspector_enable_mappings = 'HUMAN'
``` ```
| Key | Function | API | | Key | Mapping | Function
| --- | --- | --- | | --- | --- | ---
| `F5` | When debugging, continue. Otherwise start debugging. | `vimspector#Continue()` | | `F5` | `<Plug>VimspectorContinue` | When debugging, continue. Otherwise start debugging.
| `F3` | Stop debugging. | `vimspector#Stop()` | | `F3` | `<Plug>VimspectorStop` | Stop debugging.
| `F4` | Restart debugging with the same configuration. | `vimspector#Restart()` | | `F4` | `<Plug>VimspectorRestart` | Restart debugging with the same configuration.
| `F6` | Pause debuggee. | `vimspector#Pause()` | | `F6` | `<Plug>VimspectorPause` | Pause debuggee.
| `F9` | Toggle line breakpoint on the current line. | `vimspector#ToggleBreakpoint()` | | `F9` | `<Plug>VimspectorToggleBreakpoint` | Toggle line breakpoint on the current line.
| `<leader>F9` | Toggle conditional line breakpoint on the current line. | `vimspector#ToggleBreakpoint( { trigger expr, hit count expr } )` | | `<leader>F9` | `<Plug>VimspectorToggleConditionalBreakpoint` | Toggle conditional line breakpoint on the current line.
| `F8` | Add a function breakpoint for the expression under cursor | `vimspector#AddFunctionBreakpoint( '<cexpr>' )` | | `F8` | `<Plug>VimspectorAddFunctionBreakpoint` | Add a function breakpoint for the expression under cursor
| `<leader>F8` | Run to Cursor | `vimspector#RunToCursor()` | | `<leader>F8` | `<Plug>VimspectorRunToCursor` | Run to Cursor
| `F10` | Step Over | `vimspector#StepOver()` | | `F10` | `<Plug>VimspectorStepOver` | Step Over
| `F11` | Step Into | `vimspector#StepInto()` | | `F11` | `<Plug>VimspectorStepInto` | Step Into
| `F12` | Step out of current function scope | `vimspector#StepOut()` | | `F12` | `<Plug>VimspectorStepOut` | Step out of current function scope
In addition, I recommend adding a mapping to `<Plug>VimspectorBalloonEval`, in In addition, I recommend adding a mapping to `<Plug>VimspectorBalloonEval`, in
normal and visual modes, for example: normal and visual modes, for example:
@ -746,6 +751,13 @@ nmap <Leader>di <Plug>VimspectorBalloonEval
xmap <Leader>di <Plug>VimspectorBalloonEval xmap <Leader>di <Plug>VimspectorBalloonEval
``` ```
You may also wish to add mappings for up/down the stack, for example:
```viml
nmap <LocalLeader><F11> <Plug>VimspectorUpFrame
nmap <LocalLeader><F12> <Plug>VimspectorDownFrame
```
# Usage and API # Usage and API
This section defines detailed usage instructions, organised by feature. For most This section defines detailed usage instructions, organised by feature. For most