zoukankan      html  css  js  c++  java
  • svtag supported by ctags

    1.使用tags前  在~/.vimrc添加如下line, 当按ctrl+] 可以弹出所有匹配的tag项目。

    nmap <C-]>  g<C-]>

    2.编辑 ~/.ctags, 添加以下代码:
    --exclude=.SOS
    --exclude=.git
    --exclude=nobackup
    --exclude=nobkp
    --exclude=results
    --exclude=*.log

    --langdef=SystemVerilog
    --langmap=SystemVerilog:.sv.v.svh.tv.vg.vinc

    --regex-SystemVerilog=/^s*((static|local|virtual|protected))*s*classs*(w+)/3/c,class/
    --regex-SystemVerilog=/^s*((static|local|virtual|protected))*s*tasks*((static|automatic))*s*(w+::)*s*(w+)/6/t,task/
    --regex-SystemVerilog=/^s*((static|local|virtual|protected))*s*functions*((w+))*s*(w+::)*s*(w+)/6/f,function/

    --regex-SystemVerilog=/^s*modules*(w+)/1/m,module/
    --regex-SystemVerilog=/^s*programs*(w+)/1/p,program/
    --regex-SystemVerilog=/^s*interfaces*(w+)/1/i,interface/
    --regex-SystemVerilog=/^s*typedefs+.*s+(w+)s*;/1/e,typedef/
    --regex-SystemVerilog=/^s*`defines*(w+)/`1/d,define/

    --regex-SystemVerilog=/^s*`defines*(w+)/1/d,define/

    --regex-SystemVerilog=/^s*`packages*(w+)/1/d,package/

    --regex-SystemVerilog=/}s*(w+)s*;/1/e,typedef/

    --regex-SystemVerilog=/^s*((static|local|private|rand))*s*((shortint|int|longint))s*(unsigned)?(s*[.+])*s*(w+)/7/v,variable/
    --regex-SystemVerilog=/^s*((static|local|private|rand))*s*((byte|bit|logic|reg|integer|time))(s*[.+])*s*(w+)/6/v,variable/
    --regex-SystemVerilog=/^s*((static|local|private))*s*((real|shortreal|chandle|string|event))(s*[.+])*s*(w+)/6/v,variable/
    --regex-SystemVerilog=/((input|output|inout))?s*([.+])*s*((wire|reg|logic))s*([.+])*s*(#((.+)|S+)))?s*(w+)/9/v,variable/
    --regex-SystemVerilog=/((parameter|localparam)).+(w+)s*=/3/a,parameter/

    --SystemVerilog-kinds=+ctfmpied

    --languages=SystemVerilog,C,C++,HTML,Lisp,Make,Perl,Python,Sh
    然后就可以运行 ctags 产生 TAGS 文件: ctags -Re --languages=SystemVerilog -f my.tags /path/to/your/source/code
    之后配置 VIM, 使 VIM 能读到已经产生的 TAGS 文件:
    以后在 VIM 中打开代码时,就可以通过 CTRL-] 跳转到当前光标处的变量/函数等的定义位置。
    在module和endmodule间跳转
    在 VIM 中,可以通过 % 在匹配的 ( 与 ) ,{ 与 } , [ 与 ] 间跳转。增加以下配置后,可以实现在 module 与 endmodule,task 与 endtask等之间跳转。
    runtime! macros/matchit.vim
    if exists('loaded_matchit')
    let b:match_ignorecase=0
    let b:match_words=
    '<begin>:<end>,' .
    '<if>:<else>,' .
    '<module>:<endmodule>,' .
    '<class>:<endclass>,' .
    '<program>:<endprogram>,' .
    '<clocking>:<endclocking>,' .
    '<property>:<endproperty>,' .
    '<sequence>:<endsequence>,' .
    '<package>:<endpackage>,' .
    '<covergroup>:<endgroup>,' .
    '<primitive>:<endprimitive>,' .
    '<specify>:<endspecify>,' .
    '<generate>:<endgenerate>,' .
    '<interface>:<endinterface>,' .
    '<function>:<endfunction>,' .
    '<task>:<endtask>,' .
    '<case>|<casex>|<casez>:<endcase>,' .
    '<fork>:<join>|<join_any>|<join_none>,' .
    '`ifdef>:`else>:`endif>,'
    endif

    --
  • 相关阅读:
    11111 Generalized Matrioshkas
    Uva 442 Matrix Chain Multiplication
    Uva 10815 Andy's First Dictionary
    Uva 537 Artificial Intelligence?
    Uva 340 MasterMind Hints
    SCAU 9508 诸葛给我牌(水泥题)
    Uva 10420 List of Conquests(排序水题)
    Uva 409 Excuses, Excuses!
    10/26
    11/2
  • 原文地址:https://www.cnblogs.com/freeic/p/7144248.html
Copyright © 2011-2022 走看看