1.生成STL代码补全支持

cd /usr/include/c++/X.x  机器上的Cpp版本
sudo ctags -R --sort=1 --c++-kinds=+p --fields=+iaS --extra=+q --language-force=C++ -f Cpp_STL_tags  

          -f 参数是规定生成出来的文件的文件名(默认为tags),现在规定为 Cpp_STL_tags

   在~/.vimrc中加入


"设置tags的目录 set tags+=/存放路径/ Cpp_STL_tags
" OmniCppComplete
let OmniCpp_NamespaceSearch = 1
let OmniCpp_GlobalScopeSearch = 1
let OmniCpp_ShowAccess = 1
let OmniCpp_ShowPrototypeInAbbr = 1 " show function parameters
let OmniCpp_MayCompleteDot = 1 " autocomplete after .
let OmniCpp_MayCompleteArrow = 1 " autocomplete after ->
let OmniCpp_MayCompleteScope = 1 " autocomplete after ::
let OmniCpp_DefaultNamespaces = ["std", "_GLIBCXX_STD"]
" automatically open and close the popup menu / preview window
au CursorMovedI,InsertLeave * if pumvisible() == 0|silent! pclose|endif
set completeopt=menuone,menu,longest,preview

2.Vim生成tags时, 整个屏幕都成了空白,只能c-b c-f上下翻页才会被刷新

方法一: 通过CTRL+L来刷新屏幕

方法二: 在生成tags的函数最后再增加一句执行::redr! (强制刷新屏幕,!表示先清屏)


相关文章:

  • 2021-12-12
  • 2021-05-03
  • 2021-12-09
  • 2021-06-12
  • 2021-09-29
  • 2021-06-09
猜你喜欢
  • 2021-06-13
  • 2021-07-28
  • 2021-08-08
  • 2021-08-31
  • 2022-01-30
  • 2022-01-16
  • 2021-04-20
相关资源
相似解决方案