vim 编辑器是否有任何实用程序/插件可以添加注释/标题? [英] Is there any utility/plugin for vim editor to add comments/headers?

查看:36
本文介绍了vim 编辑器是否有任何实用程序/插件可以添加注释/标题?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我搜索了许多插件,用于在 vim 编辑器中打开时在任何 C/C++ 文件中添加自动/手动标题/注释/函数详细信息,甚至尝试使用 .vimrc 文件使用 自动命令.但它们是在打开一个新文件时使用的.已经存在的文件是否有相同之处?

I have searched a number of plugins for adding automatic/manual headers/comments/function details in any C/C++ file when open in vim editor, even tried using .vimrc file using autocommands. But they are for while opening a new file. Is there any same for already existing files?

在大型代码库中添加有关代码/函数的信息非常繁琐.

Its very tedious for adding information about a code/function in a large code-base.

推荐答案

lh-cpp 提供:

  • 可定制的模板用于文件头
    • 在从文件模板创建新文件时自动加载,然后扩展专用的 .h/.cpp 文件模板
    • 或按需,因为它们是触发模板/代码段扩展的 3 种方式(自动在新文件上,或按需使用 :MuTemplate c/internals/c-file-header 此处(您可以还为其他内容设置别名)或在代码段扩展中).由于 lh-cpp/mu-template 片段/模板实际上类似于函数/变体点,您可以要求仅扩展文件头(可在每个项目的基础上自定义)或反重新包含保护等.
    • customisable templates for file headers
      • loaded automatically when a new file is created from the file template, before expanding the dedicated .h/.cpp file template
      • or on demand as they are 3 ways to trigger a template/snippet expansion (automatically on new files, or on demand with :MuTemplate c/internals/c-file-header here (you can also set an alias to something else) or on snippet expansion). As lh-cpp/mu-template snippets/templates are actually similar to functions/variations points, you can ask to expand only file headers (which are customizable on a per-project basis), or anti-reinclusion guards, and so on.

      这篇关于vim 编辑器是否有任何实用程序/插件可以添加注释/标题?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆