├── .gitignore ├── README.md ├── ctags-excerpt ├── gdscript-tagbar-ctags.png └── vimrc-excerpt /.gitignore: -------------------------------------------------------------------------------- 1 | *.swp 2 | *.orig 3 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | #vim-gdscript-ctags 2 | 3 | ## About 4 | This tiny project is dedicated to adding more GDScript support into the VIM editor via using ctags. 5 | 6 | ![Tagbar excuberant-ctags GDSCript demo](https://s17.postimg.org/ig7plkyfj/gdscript_tagbar_ctags.png) 7 | 8 | Currently supported tags: 9 | ------------------------- 10 | 11 | - constants 12 | - export variables 13 | - onready-constructions 14 | - signals 15 | - functions 16 | - preloads 17 | 18 | 19 | ## Dependencies 20 | It is highly recommended to use these settings with the following VIM plugins: 21 | 22 | Tagbar: 23 | ------- 24 | https://github.com/majutsushi/tagbar 25 | 26 | GDScript syntax support: 27 | ------------------------ 28 | https://github.com/a-watson/vim-gdscript 29 | 30 | ## Installation 31 | 32 | ( also see ctags-excerpt and vimrc-excerpt files ) 33 | 34 | Add the following to your ~/.ctags file: 35 | ---------------------------------------- 36 | 37 | --langdef=gdscript 38 | --langmap=gdscript:.gd 39 | 40 | --regex-gdscript=/^[ \t]*const[ \t]+([a-zA-Z0-9_]+)[ \t]*/\1/c,constant/i 41 | --regex-gdscript=/^[ \t]*export[ \t]*(\([ \t]*[a-zA-Z0-9_, \"\*\.]*\)|[ \t])+var[ \t]+([a-zA-Z0-9_]+)[ \t]*/\2/e,export/i 42 | --regex-gdscript=/^[ \t]*onready[ \t]+var[ \t]+([a-zA-Z0-9_]+)[ \t]*/\1/o,onready-variable/i 43 | --regex-gdscript=/^[ \t]*signal[ \t]+([a-zA-Z0-9_]+)[ \t]*/\1/s,signal/i 44 | --regex-gdscript=/^[ \t]*func[ \t]+([a-zA-Z0-9_]+)[ \t]*/\1/f,function/i 45 | --regex-gdscript=/^[ \t]*var[ \t]+([a-zA-Z0-9_]+)[ \t]=[ \t]*preload*/\1/p,preload/i 46 | 47 | Add the following to your ~/.vimrc file: 48 | ---------------------------------------- 49 | 50 | ```viml 51 | let g:tagbar_type_gdscript = { 52 | \'ctagstype' :'gdscript', 53 | \'kinds':[ 54 | \'c:constants', 55 | \'e:exports', 56 | \'o:onready', 57 | \'p:preloads', 58 | \'s:signals', 59 | \'f:functions', 60 | \] 61 | \} 62 | ``` 63 | -------------------------------------------------------------------------------- /ctags-excerpt: -------------------------------------------------------------------------------- 1 | --langdef=gdscript 2 | --langmap=gdscript:.gd 3 | 4 | --regex-gdscript=/^[ \t]*const[ \t]+([a-zA-Z0-9_]+)[ \t]*/\1/c,constant/i 5 | --regex-gdscript=/^[ \t]*export[ \t]*(\([ \t]*[a-zA-Z0-9_, \"\*\.]*\)|[ \t])+var[ \t]+([a-zA-Z0-9_]+)[ \t]*/\2/e,export/i 6 | --regex-gdscript=/^[ \t]*onready[ \t]+var[ \t]+([a-zA-Z0-9_]+)[ \t]*/\1/o,onready-variable/i 7 | --regex-gdscript=/^[ \t]*signal[ \t]+([a-zA-Z0-9_]+)[ \t]*/\1/s,signal/i 8 | --regex-gdscript=/^[ \t]*func[ \t]+([a-zA-Z0-9_]+)[ \t]*/\1/f,function/i 9 | --regex-gdscript=/^[ \t]*var[ \t]+([a-zA-Z0-9_]+)[ \t]=[ \t]*preload*/\1/p,preload/i 10 | -------------------------------------------------------------------------------- /gdscript-tagbar-ctags.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/syskrank/vim-gdscript-ctags/56c62b18a42ae7b3121e545aba515ec1158b9245/gdscript-tagbar-ctags.png -------------------------------------------------------------------------------- /vimrc-excerpt: -------------------------------------------------------------------------------- 1 | "gdscript for ctags 2 | let g:tagbar_type_gdscript = { 3 | \'ctagstype' :'gdscript', 4 | \'kinds':[ 5 | \'c:constants', 6 | \'e:exports', 7 | \'o:onready', 8 | \'p:preloads', 9 | \'s:signals', 10 | \'f:functions', 11 | \] 12 | \} 13 | --------------------------------------------------------------------------------