DeBug调试插件

https://github.com/puremourning/vimspector

  1. call plug#begin()
  2. Plug 'puremourning/vimspector'
  3. call plug#end()
  1. :VimspectorInstall <language-name-debug>
  2. language-name-debug e.g.: python is debugpy ; go is delve

调试会话配置

项目的调试会话的文件位于以下两个位置:

  1. /configurations///*.json

**[nvim cmd]:set runtimeapth 查看 your-path-to-vimspector**

  1. 项目根目录中的 .vimspector.json
    1. {
    2. "configurations": {
    3. "Python Current File": {
    4. "adapter": "debugpy",
    5. "filetypes": [ "python" ],
    6. "configuration": {
    7. "name": "Python Current File",
    8. "type": "python",
    9. "request": "launch",
    10. "cwd": ".",
    11. "python": "./.env/bin/python", //python interpreter path
    12. "stopOnEntry": true,
    13. "console": "integratedTerminal",
    14. "debugOptions": [],
    15. "program": "${file}"
    16. }
    17. }
    18. }
    19. }
    linux
    1. {
    2. "configurations": {
    3. "run": {
    4. "adapter": "delve",
    5. "filetypes": [ "go" ], // optional
    6. "variables": {
    7. // example, to disable delve's go version check
    8. // "dlvFlags": "--check-go-version=false"
    9. },
    10. "configuration": {
    11. "request": "launch",
    12. "program": "${fileDirname}",
    13. "mode": "debug"
    14. }
    15. }
    16. }
    17. }
    Windows下
    1. {
    2. "configurations": {
    3. "run": {
    4. "adapter": "vscode-go",
    5. "filetypes": [ "go" ],
    6. "configuration": {
    7. "request": "launch",
    8. "program": "${fileDirname}",
    9. "mode": "debug",
    10. "dlvToolPath": "C:/Users/yzh/AppData/Local/nvim-data/plugged/vimspector/gadgets/windows/delve/bin/dlv.exe" //dlv local uri
    11. }
    12. }
    13. }
    14. }