1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-01-23 12:50:04 +08:00

Add debug layer

This commit is contained in:
wsdjeg 2017-12-14 21:30:20 +08:00
parent 5b454760f8
commit 190274c4c1
2 changed files with 48 additions and 1 deletions

View File

@ -6,8 +6,17 @@ endfunction
function! SpaceVim#layers#debug#config() abort
call SpaceVim#mapping#space#def('nnoremap', ['d', 'l'], 'call SpaceVim#layers#debug#launching(&ft)', 'launching debugger', 1)
call SpaceVim#mapping#space#def('nnoremap', ['d', 't'], 'VBGtoggleBreakpointThisLine', 'Toggle a breakpoint for the current line', 1)
call SpaceVim#mapping#space#def('nnoremap', ['d', 'b'], 'VBGtoggleBreakpointThisLine', 'Toggle a breakpoint for the current line', 1)
call SpaceVim#mapping#space#def('nnoremap', ['d', 'B'], 'VBGclearBreakpoints', 'Clear all breakpoints', 1)
call SpaceVim#mapping#space#def('nnoremap', ['d', 'c'], 'VBGcontinue', 'Continue the execution', 1)
call SpaceVim#mapping#space#def('nnoremap', ['d', 'o'], 'VBGstepOver', 'step over', 1)
call SpaceVim#mapping#space#def('nnoremap', ['d', 'i'], 'VBGstepIn', 'step into functions', 1)
call SpaceVim#mapping#space#def('nnoremap', ['d', 'o'], 'VBGstepOut', 'step out of current function', 1)
call SpaceVim#mapping#space#def('nnoremap', ['d', 'k'], 'VBGkill', 'Terminates the debugger', 1)
let g:_spacevim_mappings_space.d.e = {'name' : '+Evaluate/Execute'}
call SpaceVim#mapping#space#def('nnoremap', ['d', 'e', 's'], 'VBGevalSelectedText', 'Evaluate and print the selected text', 1)
call SpaceVim#mapping#space#def('nnoremap', ['d', 'e', 'e'], 'VBGevalWordUnderCursor', 'Evaluate the <cword> under the cursor', 1)
call SpaceVim#mapping#space#def('nnoremap', ['d', 'e', 'S'], 'VBGexecuteSelectedText', 'Execute the selected text', 1)
endfunction
function! SpaceVim#layers#debug#launching(ft) abort

38
docs/layers/debug.md Normal file
View File

@ -0,0 +1,38 @@
---
title: "SpaceVim debug layer"
description: "This layer provide debug workflow support in SpaceVim"
---
# [SpaceVim Layers:](https://spacevim.org/layers) debug
<!-- vim-markdown-toc GFM -->
- [Description](#description)
- [Install](#install)
- [Key bindings](#key-bindings)
<!-- vim-markdown-toc -->
## Description
This layer provide a debug workflow for SpaceVim. All of the function is based on [vim-vebugger](https://github.com/idanarye/vim-vebugger).
## Install
To use this configuration layer, add `call SpaceVim#layers#load('debug')` to your custom configuration file.
## Key bindings
| Key Binding | Description |
| ----------- | ---------------------------------------- |
| `SPC d l` | launching debugger |
| `SPC d c` | Continue the execution |
| `SPC d b` | Toggle a breakpoint for the current line |
| `SPC d B` | Clear all breakpoints |
| `SPC d o` | step over |
| `SPC d i` | step into functions |
| `SPC d O` | step out of current function |
| `SPC d e s` | Evaluate and print the selected text |
| `SPC d e e` | Evaluate the `<cword>` under the cursor |
| `SPC d e S` | Execute the selected text |
| `SPC d k` | Terminates the debugger |