Exuberant Ctags with R

前端 未结 6 803
北荒
北荒 2021-02-05 07:54

Is there any documented use of ctags with R? Would this be useful? Would it be difficult to implement?

Specifically, I\'ve just started using Vim. It would be cool to be

6条回答
  •  囚心锁ツ
    2021-02-05 08:25

    rtags() is the best to way to generate tags for R codes from what I see so far, since it will take all different ways of assignments in consideration, such as:

    ok = c("<-", "=", "<<-", "assign",
           "setGeneric", "setGroupGeneric", "setMethod",
           "setClass", "setClassUnion")
    

    An example of using rtags():

    path <- "~/path/to/project"
    rtags(path=path,
          pattern = "[.]*\\.[RrSs]$",
          keep.re = ".", # the value ('/R/') in the help page will only run through the codes in R/ folder.
          verbose = TRUE,
          ofile = file.path(path, 'TAGS'),
          append = FALSE,
          recursive = TRUE)
    

提交回复
热议问题