GithubHelp home page GithubHelp logo

ctags's Introduction

Extended Rules to support Modern Perl in Exuberant Ctags

This is my Exuberant Ctags (~/.ctags) file. I use it lately with Vim with the tagbar plugin. It can be used with many Text editors like Vim, Emacs, jEdit, Sublime Text, Atom...

For now it only contains some additional regular expressions to support more Perl symbols. Feel free to contribute by adding regular expressions or improving the existing ones! Pull requests are wellcome.

Usage

For generating tags file with ctags, just put the file in your $HOME folder.

To add the content of this file to your existing ~/.ctags file:

curl https://raw.githubusercontent.com/kberov/ctags/master/.ctags >> ~/.ctags

If you are using Atom, you don't need this file, because its content is already part of the symbols-view core package.

How to add support for new symbols?

http://ctags.sourceforge.net/

http://stackoverflow.com/questions/979359/vim-and-custom-tagging

https://ericjmritz.wordpress.com/2013/03/14/writing-custom-rules-for-exuberant-ctags/

Make it work with tagbar vim plugin

Add the following to your .vimrc. The tagbar plugin has to be used ofcourse.

let g:tagbar_type_perl = {
    \ 'ctagstype' : 'perl',
    \ 'kinds'     : [
        \ 'p:package:0:0',
        \ 'w:roles:0:0',
        \ 'e:extends:0:0',
        \ 'u:uses:0:0',
        \ 'r:requires:0:0',
        \ 'o:ours:0:0',
        \ 'a:properties:0:0',
        \ 'b:aliases:0:0',
        \ 'h:helpers:0:0',
        \ 's:subroutines:0:0',
        \ 'd:POD:1:0'
    \ ]
\ }

Another option is to use a specific script with tagbar. Put perl_ctags_for_tagbar from this repo into ~/bin/ and make sure it is executable.

" Settings to support extended patterns for perl in ctags in tagbar
let g:tagbar_type_perl = {
    \ 'ctagstype' : 'perl',
    \ 'kinds'     : [
        \ 'p:package:0:0',
        \ 'w:roles:0:0',
        \ 'e:extends:0:0',
        \ 'u:uses:0:0',
        \ 'r:requires:0:0',
        \ 'o:ours:0:0',
        \ 'a:properties:0:0',
        \ 'b:aliases:0:0',
        \ 'h:helpers:0:0',
        \ 's:subroutines:0:0',
        \ 'm:private_subroutines:0:0',
        \ 't:old_private_subroutines:0:0',
        \ 'd:POD:1:0'
    \ ],
	\ 'ctagsbin'  : 'perl_ctags_for_tagbar'
\ }

Bugs and limitations

POD after the END marker is not shown, but seems this is caused by ctags and I don't have an idea how to change it.

Author

Красимир Беров (2013--2018)

ctags's People

Contributors

kberov avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.