• ubuntu下安装ctags和taglist


    1.首先安装ctags
    sudo apt-get install ctags 
    关于ctags的使用
    在想要查看的文档下使用
    1.$ctags -R *(对所有文档进行-R(递归的查找))
    2.$vim -t tag (请吧tag替换为你想要查找的名称比如main)
    用#define定义的宏
    枚举型变量的值
    函数的定义、原型和声明
    名字空间(namespace)
    类型定义(typedefs)
    变量(包括定义和声明)
    类(class)、结构(struct)、枚举类型(enum)和联合(union)
    类、结构和联合中成员变量或函数
    3.进入一个文档可以查看文件的内容,并且通过c+]可以进入函数的定义(),c+t可以返回。
    注意:在运行vim的时候,必须在tags生成的目录下,如果不在使用vim 的时候要加上set tags =路径
    部分引用自以下两个博客
     
    2.根据vim的文档来安装taglist
    1.首先下载taglist
    2.解压出两个目录doc和plugin,拷贝到~/.vim/下,即生成~/.vim/doc~/.vim/plugin两个文件夹,启动vim运行:helptags命令来执行taglist的help文件,如果没有这步,你不能够调到taglist的帮助文档
    使用taglist
    1.你可以让taglist在你编辑文本的时候打开,你可以选择一个tag(一个变量,一个函数,一个类都可以成为一个tag)并且跳转到它哪里,taglist会在你编辑文档的时候,自动的生成tag.
    2.你可以在编辑中自动的打开需要的taglist,设置快捷键
    为了跳转到一个tag到新的window中,按o
    -------------------------------------------------------------------------------------
    可以通过命令吧其他文件内容添加到自己的taglist中
    1.使用:TlistAddFiles和:TlistAddFileRecursive命令
    第一个例子
    :TlistAddFiles /my/project/dir/*.c
    把dir中所有c语言文件添加到Taglist中.注;如果文件过大会出现延迟,需等待一会。
    第二个
    :TlistAddFilesRecursive /my/project/dir *.c
    注:这里在*.c前有一个空格,有两个参数,第一个是目录,第二个是c语言文件,递归的添加.
    -------------------------------------------------------------------------------------------
                                                    *taglist-keys*                          taglist-keys
    Taglist window key list                                                                        taglist 窗口key列表
    The following table lists the description of the keys that can be used           下表描述了在taglist窗口中使用的key
    in the taglist window.                                                      

      Key           Description                           key                    描述

      <CR>          Jump to the location where the tag under cursor is                <CR> (carrige return)             跳转到当前光标所指定tag定义的位置
                      defined.
      o             Jump to the location where the tag under cursor is                     o        在新窗口中,跳转到当前光标所指定tag定义的位置
                    defined in a new window.
      P             Jump to the tag in the previous (Ctrl-W_p) window.       p        跳转到之前窗口的tag
      p             Display the tag definition in the file window and         P        在文件窗口中显示tag定义并且在taglist窗口保持自身的光标 
                    keep the cursor in the taglist window itself.        
      t             Jump to the tag in a new tab. If the file is already        t        跳转到新的tab中的tag,如果文件早就在tab中打开了,直接跳转到之前的tab
                    opened in a tab, move to that tab.
      Ctrl-t        Jump to the tag in a new tab.                  Ctrl-t     跳转tag到新的tab
      <Space>       Display the prototype of the tag under the cursor.      <Space>     在光标下面展示tag的原型,对于文件名,显示全部的路径名,文件类型和tags的数目。对于tag类型,写是tag类型和tags的个数
                    For file names, display the full path to the file,                         
                    file type and the number of tags. For tag types, display the
                    tag type and the number of tags.
      u             Update the tags listed in the taglist window           u      在taglist窗口中,更新tags列表
      s             Change the sort order of the tags (by name or by order)     s      改变tags的顺序(通过名字或顺序)
      d             Remove the tags for the file under the cursor          d      在文件光标下移除tags
      x             Zoom-in or Zoom-out the taglist window            x       隐藏或出现taglist窗口
      +             Open a fold                           +       打开一个fold
      -             Close a fold                            -       关闭一个fold
      *             Open all folds                          *        打开所有的folds
      =             Close all folds                          =       关闭所有的folds
      [[            Jump to the beginning of the previous file            [[      跳转到之前文件的开头
      <Backspace>   Jump to the beginning of the previous file         <Backspace>  跳转到之前文件的开头
      ]]            Jump to the beginning of the next file              ]]      跳转到下一个文件的开头
      <Tab>         Jump to the beginning of the next file            <Tab>    跳转到下一个文件的开头
      q             Close the taglist window                     q      关闭taglistwindow
      <F1>          Display help                          <F1>    显示帮助文档
      
    The above keys will work in both the normal mode and the insert mode.   以上keys在普通模式和插入模式都会工作
     
    ---------------------------------------------------
    |:TlistDebug|           Start logging of taglist debug messages.
    |:TlistMessages|        Display the logged taglist plugin debug messages.
     
    可以通过ctrl+w快捷键或者鼠标点击在Taglist窗口和编辑区之间切换焦点
    let Tlist_Use_Right_Window =1.显示在右边
     
    纸上得来终觉浅,绝知此事要躬行
  • 相关阅读:
    Django(72)Django认证系统库--djoser
    Django(71)图片处理器django-imagekit
    python进阶(21)typing模块--类型提示支持
    Jmeter 参数化-文件和参数同时上传的场景
    Java线程监控之 jvisualvm 和 jstack
    操作系统监控
    Redis安装部署
    Mac下charles安装及配置
    Prometheus 监控平台部署
    Nginx配置(九)
  • 原文地址:https://www.cnblogs.com/asheng/p/6442172.html
Copyright © 2020-2023  润新知