Qt Creator 4.5.0中Fakevim的:%s/gc命令无法逐个确认替换
:%s///gc Doesn't Prompt for Confirmation I've run into this exact issue with Fakevim's substitute command ignoring the c flag before, so here are some troubleshooting directions and workarounds to try:
Version Compatibility Limitation
Qt Creator 4.5.0 is a fairly old release (from 2018), and the Fakevim plugin at that time had incomplete support for interactive Vim commands. The confirmation prompt for thegcflag wasn't fully implemented in this version. Upgrading to Qt Creator 4.10 or newer would likely resolve this—later releases significantly improved Fakevim's compatibility with Vim-style interactive commands, including this substitution confirmation flow.Double-Check Fakevim Settings
Even though you mentioned not finding relevant settings, take another look atTools > Options > Text Editor > Fakevim. In slightly newer versions (near 4.10), there's an "Advanced" section with a toggle for enabling interactive command support. Unfortunately, this option might not exist in 4.5.0, which again makes upgrading a solid solution.Manual Workaround for Selective Replacement
If upgrading isn't feasible right now, you can mimic thegcbehavior manually with these steps:- Use
/exprAto search for the first match - Press
cgnto replace the current match with your desired text (exprB) - After replacing, press
.to repeat the replacement on the next match, ornto skip to the next match without replacing
It's not as streamlined as:%s///gc, but it gives you full control over each match in Fakevim 4.5.0.
- Use
Check Custom Fakevim Configurations
Take a look at your Fakevim rc file—on Linux/macOS it's~/.config/QtProject/qtcreator/fakevimrc, on Windows it's%APPDATA%\QtProject\qtcreator\fakevimrc. If you've added any custom mappings or overrides for thescommand, they might be interfering with the defaultgcbehavior. Try commenting out any lines that modify substitute commands and restart Qt Creator to test.
内容的提问来源于stack exchange,提问作者v2v1

