Skip to content

Latest commit

 

History

History
135 lines (92 loc) · 3.42 KB

README.md

File metadata and controls

135 lines (92 loc) · 3.42 KB

Crystal Ctags

Tool for generation ctags for Crystal

Fork of https://github.com/SuperPaintman/crystal-ctags with enough compatibility with Exuberant Ctags to make Gutentags and CtrlP tjump work. Needs https://github.com/urde-graven/crystal for compilation because upstream Crystal has severe bugs in its OptionParser - this code is intentionally incompatible with it.

Screenshot Gutentags

Screenshot

Installation

From sources:

$ cd ~/Projects
$ git clone https://github.com/SuperPaintman/crystal-ctags
$ cd ./crystal-ctags
$ make
$ sudo make install
$ # or
$ sudo make reinstall

Usage

$ crystalctags -h

Test

$ crystal spec
# or
$ make test

Use with

VIM: Gutentags

For example:

let g:gutentags_modules = ['ctags']
let g:gutentags_file_list_command = 'absolute///ag -l -i --nocolor --hidden -g "" .'
let g:gutentags_ctags_executable_crystal = "crystal-ctags"
let g:gutentags_project_info = []
call add(g:gutentags_project_info, {'type': 'crystal', 'file': 'main.cr'})
call add(g:gutentags_project_info, {'type': 'crystal', 'file': 'shard.yml'})

VIM: TagBar

let g:tagbar_type_crystal = {
    \'ctagstype': 'crystal',
    \'ctagsbin': 'crystalctags',
    \'ctagsargs': '-f -',
    \'kinds': [
        \'c:classes',
        \'m:modules',
        \'d:defs',
        \'x:macros',
        \'l:libs',
        \'s:sruct or unions',
        \'f:fun'
    \],
    \'sro': '.',
    \'kind2scope': {
        \'c': 'namespace',
        \'m': 'namespace',
        \'l': 'namespace',
        \'s': 'namespace'
    \},
\}

Contributing

  1. Fork it (https://github.com/SuperPaintman/crystalctags/fork)
  2. Create your feature branch (git checkout -b feature/<feature_name>)
  3. Commit your changes (git commit -am 'Added some feature')
  4. Push to the branch (git push origin feature/<feature_name>)
  5. Create a new Pull Request

Contributors


API

Docs


Changelog

Changelog


License

MIT