puremourning/vimspector

[Feature Request]: Load mappings on demand, restore mappings when done debugging

Open

#920 创建于 2025年7月22日

在 GitHub 查看
 (1 评论) (0 反应) (0 负责人)Vim Script (179 fork)batch import
Severity 3+enhancementgood first issueneeds votes

仓库指标

Star
 (4,303 star)
PR 合并指标
 (30 天内没有已合并 PR)

描述

Is your feature request related to a problem? Please describe.

When I installed vimspector, I only really expected to use it every now and again (debugging real-time systems is usually better via a UART and gdb only comes out in desperate cases). The "Human" mappings sounded sensible for general use, but I was then surprised that all my previous F-key mappings had disappeared - I expected them to appear when I first ran vimspector or did a packadd or something like that.

Describe the solution you'd like

Include an autoload command called something like vimspector#LoadMappings "human" (perhaps with a default that can be saved in vimrc) that saves existing F-key mappings (useful reference here) somewhere and then installs the F-key mappings. Also include an autoload command called something like vimspector#UnloadMappings that restores whatever you had before loading vimspector.

Loading mappings could also be automatic when you first run a Vimspector command/function, but I wouldn't mind it being a (single) manual step.

Describe alternatives you've considered

For now, I've removed the g:vimspector_enable_mappings thing from my vimrc, but that means that when I want to debug something I have to do one of:

  • Edit vimrc and then restart vim (which loses all the tabs, splits etc)
  • Manually do the mappings, then manually undo them when I'm done
  • Write my own function to do LoadMappings / UnloadMappings

贡献者指南