使用Vundle安装cpp_doxygen遇问题:Helptags报错、快捷键失效
Troubleshooting cpp_doxygen Plugin Issues
Hey there, let's work through your cpp_doxygen problems one by one:
1. Fixing the Helptags Processing Error
Even though you can access the help docs, the Helptags error usually points to a small issue with the plugin's doc directory:
- Check file permissions: Make sure your user account has read/write access to
~/.vim/bundle/cpp_doxygen/doc. Runls -l ~/.vim/bundle/cpp_doxygen/docin your terminal to verify permissions, and usechmodif needed (e.g.,chmod -R u+rw ~/.vim/bundle/cpp_doxygen/doc). - Regenerate Helptags manually: Run
:helptags ~/.vim/bundle/cpp_doxygen/docdirectly in Vim. This will show you the exact error (like a malformed help file) instead of a generic PluginInstall message. If a specific file is causing issues, you can temporarily rename it or report the bug to the plugin's maintainer. - Reinstall the plugin: If the doc files are corrupted, delete the plugin directory and re-clone it:
Then re-runrm -rf ~/.vim/bundle/cpp_doxygen git clone https://github.com/vim-scripts/cpp_doxygen.git ~/.vim/bundle/cpp_doxygen:PluginInstall(or your plugin manager's install command) to refresh things.
2. Getting the Comment Shortcuts Working
If the help docs load but the shortcuts do nothing, here's what to check:
- Verify the plugin is loaded: Run
:scriptnamesin Vim and look forcpp_doxygen.vimin the list. If it's missing, double-check your plugin manager configuration in.vimrc:- For Pathogen: Ensure
execute pathogen#infect()is near the top of your.vimrc(before other plugin-related config). - For Vundle/Plug: Make sure you have the plugin listed (e.g.,
Plugin 'vim-scripts/cpp_doxygen'for Vundle) and you've run:PluginInstallsuccessfully.
- For Pathogen: Ensure
- Check for conflicting mappings: The plugin's default shortcut is usually
<Leader>d(where<Leader>is\by default). Run:map <Leader>dto see if this mapping is taken by another plugin. If it is, you can manually set a new mapping in your.vimrc:nmap <Leader>doc :call GenerateDoxygen()<CR> imap <Leader>doc <Esc>:call GenerateDoxygen()<CR>a - Ensure filetype is set to C++: The plugin only activates for C++ files. Run
:set filetype?to confirm—if it's notcpp, set it manually with:set filetype=cppand try the shortcut again. You can also addautocmd BufNewFile,BufRead *.cpp,*.hpp set filetype=cppto your.vimrcto automate this. - Check for disabled default mappings: Some plugins let you disable default mappings via a global variable. If you have
let g:cpp_doxygen_no_mappings = 1in your.vimrc, that's why the shortcuts aren't working—you'll need to add the manual mappings like the ones above.
内容的提问来源于stack exchange,提问作者Ben Raber
相关产品推荐
相关产品推荐

