▲ 我的vim配置仓库: gitee,vim相关优先在gitee更新,博客vim专栏作为部分补充和使用说明
▲ 本文提供vimspector调试的一个示例,和keil的调试功能比当然还是有很大差距,不过简单的调试功能如单步、复位、运行这些都跑通了,编译,下载也可以,vim终于还是成为了IDE。。。
▲ linux上软件兼容性和配置要比windows好很多
▲ 其他废话(与本文无关,可以不看):想用neovim的,但windows下nvim-treesitter一旦安装c的语法高亮就会崩溃,连checkhealth都运行不了,还有些其他显示问题不清楚怎么解决,在不同电脑上尝试过很多次都是这样,无奈下又换回了gvim,还挺喜欢Astro Nvim这个配置的,有清楚为什么的小伙伴可以留言或私信。让子弹飞吧。。。。
:VimspectorInstall -enable-c
hack
字体,测试所有图标终端下都显示正常,并不是所有nerd font
字体都能正常显示大多图标集。。openocd -f stlink.cfg -c 'transport select hla_swd' -f stm32f1x.cfg
{
"configurations": {
"Launch STM32": {
"adapter": "vscode-cpptools",
"configuration": {
"type": "cppdbg",
"request": "launch",
"program": "${workspaceRoot}/build/f103.elf",
"cwd": "${workspaceRoot}",
"targetArchitecture":"arm",
"MImode": "gdb",
"stopOnEntry": true,
"stopAtConnect":true,
"MIDebuggerPath": "C:\\GreenSoft\\gcc-arm-none-eabi-10.3-2021.10\\bin\\arm-none-eabi-gdb.exe",
"setupCommands":[
{
"description":"connect",
"text": "target extended-remote :3333"
},
{
"description":"reset halt 0x08000000",
"text": "monitor reset"
},
{
"description":"init",
"text": "monitor reset init"
}
],
"launchCompleteCommand": "exec-run",
"breakpointers": {
"exception": {
"cpp_throw": "Y",
"cpp_catch": "N"
}
}
}
},
"Launch STM32 with loading elf": {
"adapter": "vscode-cpptools",
"configuration": {
"type": "cppdbg",
"request": "launch",
"program": "${workspaceRoot}/build/f103.elf",
"cwd": "${workspaceRoot}",
"targetArchitecture":"arm",
"MImode": "gdb",
"stopOnEntry": true,
"stopAtConnect":true,
"MIDebuggerPath": "C:\\GreenSoft\\gcc-arm-none-eabi-10.3-2021.10\\bin\\arm-none-eabi-gdb.exe",
"setupCommands":[
{
"description":"connect",
"text": "target extended-remote :3333"
},
{
"description":"reset halt 0x08000000",
"text": "monitor reset"
},
{
"description":"halt",
"text": "monitor halt"
},
{
"description":"load elf",
"text": "monitor program ./build/f103.elf"
},
{
"description":"reset",
"text": "monitor reset init"
}
],
"launchCompleteCommand": "exec-run",
"breakpointers": {
"exception": {
"cpp_throw": "Y",
"cpp_catch": "N"
}
}
}
}
}
}
vimspector提供了两套快捷键,使用自己喜欢的即可
let g:vimspector_enable_mappings = 'VISUAL_STUDIO'
"let g:vimspector_enable_mappings = 'HUMAN'
enjoy~~
{
// 使用 IntelliSense 了解相关属性。
// 悬停以查看现有属性的描述。
// 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Cortex Debug",
"cwd": "${workspaceFolder}",
"executable": "./build/f103.elf",
"request": "launch",
"type": "cortex-debug",
"runToEntryPoint": "main",
"servertype": "openocd",
"configFiles": [
//"./stlink.cfg",
"${env:openocdhome}/scripts/interface/stlink.cfg",
"${env:openocdhome}/scripts/target/stm32f1x.cfg"
]
}
]
}