├── .github ├── FUNDING.yml └── workflows │ ├── check.yml │ ├── reviewdog.yml │ └── vint.yml ├── .vintrc.yaml ├── LICENSE ├── README.md ├── autoload ├── tagbar.vim └── tagbar │ ├── debug.vim │ ├── prototypes │ ├── basetag.vim │ ├── fileinfo.vim │ ├── kindheadertag.vim │ ├── normaltag.vim │ ├── pseudotag.vim │ ├── splittag.vim │ └── typeinfo.vim │ ├── sorting.vim │ ├── state.vim │ └── types │ ├── ctags.vim │ └── uctags.vim ├── doc └── tagbar.txt ├── plugin └── tagbar.vim └── syntax └── tagbar.vim /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | github: [alerque] 2 | custom: ['https://paypal.me/alerque', 'https://paypal.me/dhegland42'] 3 | -------------------------------------------------------------------------------- /.github/workflows/check.yml: -------------------------------------------------------------------------------- 1 | name: Check 2 | on: [push, pull_request] 3 | jobs: 4 | check: 5 | strategy: 6 | fail-fast: false 7 | matrix: 8 | vimFlavor: ["vim", "nvim"] 9 | tagsProvider: ["exuberant-ctags", "universal-ctags"] 10 | runs-on: ubuntu-20.04 11 | steps: 12 | - name: Checkout 13 | uses: actions/checkout@v2 14 | - name: Enable Universe package repository 15 | run: | 16 | sudo add-apt-repository universe 17 | sudo apt-get update 18 | - name: Install ${{ matrix.tagsProvider }} 19 | run: | 20 | sudo apt-get install ${{ matrix.tagsProvider }} 21 | - name: Install ${{ matrix.vimFlavor }} 22 | run: | 23 | sudo apt-get install ${{ matrix.vimFlavor == 'nvim' && 'neovim' || 'vim' }} 24 | - name: Review versions 25 | run: | 26 | ctags --version 27 | ${{ matrix.vimFlavor }} --version 28 | - name: "Try tagbar#OpenWindow()" 29 | run: | 30 | ${{ matrix.vimFlavor == 'nvim' && 'nvim -u /dev/null --headless' || 'vim' }} -i NONE "+set rtp+=$(pwd)" "+call tagbar#OpenWindow() | q" "+cq" plugin/tagbar.vim 31 | -------------------------------------------------------------------------------- /.github/workflows/reviewdog.yml: -------------------------------------------------------------------------------- 1 | name: Reviewdog 2 | on: [pull_request] 3 | jobs: 4 | vint: 5 | name: vint 6 | runs-on: ubuntu-latest 7 | steps: 8 | - uses: actions/checkout@v2 9 | - name: vint 10 | uses: reviewdog/action-vint@v1 11 | with: 12 | github_token: ${{ secrets.github_token }} 13 | reporter: github-pr-review 14 | -------------------------------------------------------------------------------- /.github/workflows/vint.yml: -------------------------------------------------------------------------------- 1 | name: Vint 2 | on: [push] 3 | jobs: 4 | vint: 5 | name: vint 6 | runs-on: ubuntu-latest 7 | steps: 8 | - name: Checkout 9 | uses: actions/checkout@v2 10 | - name: Set up Python 11 | uses: actions/setup-python@v5 12 | with: 13 | python-version: '3.10' 14 | - name: Setup dependencies 15 | run: pip install vim-vint 16 | - name: Lint Vimscript 17 | run: vint . 18 | -------------------------------------------------------------------------------- /.vintrc.yaml: -------------------------------------------------------------------------------- 1 | cmdargs: 2 | severity: style_problem 3 | color: true 4 | env: 5 | neovim: false 6 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | TAGBAR LICENSE 2 | 3 | This is the normal Vim license (see ':h license' in Vim) with the necessary 4 | replacements for the project and maintainer information. 5 | 6 | I) There are no restrictions on distributing unmodified copies of Tagbar 7 | except that they must include this license text. You can also distribute 8 | unmodified parts of Tagbar, likewise unrestricted except that they must 9 | include this license text. You are also allowed to include executables 10 | that you made from the unmodified Tagbar sources, plus your own usage 11 | examples and scripts. 12 | 13 | II) It is allowed to distribute a modified (or extended) version of Tagbar, 14 | including executables and/or source code, when the following four 15 | conditions are met: 16 | 1) This license text must be included unmodified. 17 | 2) The modified Tagbar must be distributed in one of the following five ways: 18 | a) If you make changes to Tagbar yourself, you must clearly describe in 19 | the distribution how to contact you. When the maintainer asks you 20 | (in any way) for a copy of the modified Tagbar you distributed, you 21 | must make your changes, including source code, available to the 22 | maintainer without fee. The maintainer reserves the right to 23 | include your changes in the official version of Tagbar. What the 24 | maintainer will do with your changes and under what license they 25 | will be distributed is negotiable. If there has been no negotiation 26 | then this license, or a later version, also applies to your changes. 27 | The current maintainer is Jan Larres . If this 28 | changes it will be announced in appropriate places (most likely 29 | preservim.github.io/tagbar and/or github.com/preservim/tagbar). 30 | When it is completely impossible to contact the maintainer, the 31 | obligation to send him your changes ceases. Once the maintainer has 32 | confirmed that he has received your changes they will not have to be 33 | sent again. 34 | b) If you have received a modified Tagbar that was distributed as 35 | mentioned under a) you are allowed to further distribute it 36 | unmodified, as mentioned at I). If you make additional changes the 37 | text under a) applies to those changes. 38 | c) Provide all the changes, including source code, with every copy of 39 | the modified Tagbar you distribute. This may be done in the form of 40 | a context diff. You can choose what license to use for new code you 41 | add. The changes and their license must not restrict others from 42 | making their own changes to the official version of Tagbar. 43 | d) When you have a modified Tagbar which includes changes as mentioned 44 | under c), you can distribute it without the source code for the 45 | changes if the following three conditions are met: 46 | - The license that applies to the changes permits you to distribute 47 | the changes to the Tagbar maintainer without fee or restriction, and 48 | permits the Tagbar maintainer to include the changes in the official 49 | version of Tagbar without fee or restriction. 50 | - You keep the changes for at least three years after last 51 | distributing the corresponding modified Tagbar. When the 52 | maintainer or someone who you distributed the modified Tagbar to 53 | asks you (in any way) for the changes within this period, you must 54 | make them available to him. 55 | - You clearly describe in the distribution how to contact you. This 56 | contact information must remain valid for at least three years 57 | after last distributing the corresponding modified Tagbar, or as 58 | long as possible. 59 | e) When the GNU General Public License (GPL) applies to the changes, 60 | you can distribute the modified Tagbar under the GNU GPL version 2 61 | or any later version. 62 | 3) A message must be added, at least in the documentation, such that the 63 | user of the modified Tagbar is able to see that it was modified. When 64 | distributing as mentioned under 2)e) adding the message is only 65 | required for as far as this does not conflict with the license used for 66 | the changes. 67 | 4) The contact information as required under 2)a) and 2)d) must not be 68 | removed or changed, except that the person himself can make 69 | corrections. 70 | 71 | III) If you distribute a modified version of Tagbar, you are encouraged to use 72 | the Tagbar license for your changes and make them available to the 73 | maintainer, including the source code. The preferred way to do this is 74 | by e-mail or by uploading the files to a server and e-mailing the URL. If 75 | the number of changes is small (e.g., a modified Makefile) e-mailing a 76 | context diff will do. The e-mail address to be used is 77 | 78 | 79 | IV) It is not allowed to remove this license from the distribution of the 80 | Tagbar sources, parts of it or from a modified version. You may use this 81 | license for previous Tagbar releases instead of the license that they 82 | came with, at your option. 83 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Tagbar: a class outline viewer for Vim 2 | 3 | [![Vint](https://github.com/preservim/tagbar/workflows/Vint/badge.svg)](https://github.com/preservim/tagbar/actions?workflow=Vint) 4 | [![Check](https://github.com/preservim/tagbar/workflows/Check/badge.svg)](https://github.com/preservim/tagbar/actions?workflow=Check) 5 | 6 | ## What Tagbar is 7 | 8 | Tagbar is a Vim plugin that provides an easy way to browse the tags of the 9 | current file and get an overview of its structure. It does this by creating a 10 | sidebar that displays the ctags-generated tags of the current file, ordered by 11 | their scope. This means that for example methods in C++ are displayed under 12 | the class they are defined in. 13 | 14 | ## What Tagbar is not 15 | 16 | Tagbar is not a general-purpose tool for managing `tags` files. It only 17 | creates the tags it needs on-the-fly in-memory without creating any files. 18 | `tags` file management is provided by other plugins, like for example 19 | [gutentags](https://github.com/ludovicchabant/vim-gutentags). 20 | 21 | ## Dependencies 22 | 23 | * [Vim](http://www.vim.org/) >= 7.3.1058 24 | or any version of [NeoVim](https://neovim.io/). 25 | 26 | * A ctags implementation: We _highly recommend_ any version of [Universal 27 | Ctags](https://ctags.io). It is a maintained fork of Exuberant Ctags with 28 | many bugfixes, support for many more formats, and proper Unicode support. 29 | 30 | [Exuberant Ctags](http://ctags.sourceforge.net/) 5.5 or higher works to some 31 | degree but will be deprecated eventually. 32 | 33 | Some additional formats can also be handled by other providers such as 34 | [jsctags](https://github.com/sergioramos/jsctags) or 35 | [phpctags](https://github.com/vim-php/phpctags). 36 | 37 | ## Installation 38 | 39 | Extract the archive or clone the repository into a directory in your 40 | `'runtimepath'`, or use a plugin manager of your choice like 41 | [pathogen](https://github.com/tpope/vim-pathogen). Don't forget to run 42 | `:helptags` if your plugin manager doesn't do it for you so you can access the 43 | documentation with `:help tagbar`. 44 | 45 | If the ctags executable is not installed in one of the directories in your 46 | `$PATH` environment variable you have to set the `g:tagbar_ctags_bin` 47 | variable, see the documentation for more info. 48 | 49 | ## Quickstart 50 | 51 | Put something like the following into your ~/.vimrc: 52 | 53 | ```vim 54 | nmap :TagbarToggle 55 | ``` 56 | 57 | If you do this the F8 key will toggle the Tagbar window. You can of course use 58 | any shortcut you want. For more flexible ways to open and close the window 59 | (and the rest of the functionality) see the [documentation](https://github.com/majutsushi/tagbar/blob/master/doc/tagbar.txt) using `:help tagbar`. 60 | 61 | ## Support for additional filetypes 62 | 63 | For filetypes that are not supported by Exuberant Ctags check out [the 64 | wiki](https://github.com/preservim/tagbar/wiki) to see whether other projects 65 | offer support for them and how to use them. Please add any other 66 | projects/configurations that you find or create yourself so that others can 67 | benefit from them, too. 68 | 69 | ## Note: If the file structure display is wrong 70 | 71 | If you notice that there are some errors in the way your file's structure is 72 | displayed in Tagbar, please make sure that the bug is actually in Tagbar 73 | before you report an issue. Since Tagbar uses 74 | [exuberant-ctags](http://ctags.sourceforge.net/) and compatible programs to do 75 | the actual file parsing, it is likely that the bug is actually in the program 76 | responsible for that filetype instead. 77 | 78 | There is an example in `:h tagbar-issues` about how to run ctags manually so 79 | you can determine where the bug actually is. If the bug is actually in ctags, 80 | please report it on their website instead, as there is nothing I can do about 81 | it in Tagbar. Thank you! 82 | 83 | You can also have a look at [ctags bugs that have previously been filed 84 | against Tagbar](https://github.com/preservim/tagbar/issues?labels=ctags-bug&page=1&state=closed). 85 | 86 | ## Screenshots 87 | 88 | ![screenshot1](https://i.imgur.com/Sf9Ls2r.png) 89 | ![screenshot2](https://i.imgur.com/n4bpPv3.png) 90 | 91 | ## License 92 | 93 | Tagbar is distributed under the terms of the *Vim license*, see the included [LICENSE](LICENSE) file. 94 | 95 | ## Contributors 96 | 97 | Tagbar was originally written by [Jan Larres](https://github.com/majutsushi). 98 | It is actively maintained by [Caleb Maclennan](https://github.com/alerque) and [David Hegland](https://github.com/raven42). 99 | At least [75 others have contributed](https://github.com/preservim/tagbar/graphs/contributors) features and bug fixes over the years. 100 | Please document [issues](https://github.com/preservim/tagbar/issues) or submit [pull requests](https://github.com/preservim/tagbar/issues) on Github. 101 | -------------------------------------------------------------------------------- /autoload/tagbar/debug.vim: -------------------------------------------------------------------------------- 1 | function! tagbar#debug#start_debug(...) abort 2 | let filename = a:0 > 0 ? a:1 : '' 3 | 4 | if empty(filename) 5 | let s:debug_file = 'tagbardebug.log' 6 | else 7 | let s:debug_file = filename 8 | endif 9 | 10 | " Clear log file and start it with version info 11 | exe 'redir! > ' . s:debug_file 12 | silent version 13 | redir END 14 | 15 | " Check whether the log file could be created 16 | if !filewritable(s:debug_file) 17 | echomsg 'Tagbar: Unable to create log file ' . s:debug_file 18 | let s:debug_file = '' 19 | return 20 | endif 21 | 22 | let s:debug_enabled = 1 23 | endfunction 24 | 25 | function! tagbar#debug#stop_debug() abort 26 | let s:debug_enabled = 0 27 | let s:debug_file = '' 28 | endfunction 29 | 30 | function! tagbar#debug#log(msg) abort 31 | if s:debug_enabled 32 | execute 'redir >> ' . s:debug_file 33 | silent echon s:gettime() . ': ' . a:msg . "\n" 34 | redir END 35 | endif 36 | endfunction 37 | 38 | function! tagbar#debug#log_ctags_output(output) abort 39 | if s:debug_enabled 40 | exe 'redir! > ' . s:debug_file . '.ctags_out' 41 | silent echon a:output 42 | redir END 43 | endif 44 | endfunction 45 | 46 | function! tagbar#debug#enabled() abort 47 | return s:debug_enabled 48 | endfunction 49 | 50 | if has('reltime') 51 | function! s:gettime() abort 52 | let time = split(reltimestr(reltime()), '\.') 53 | return strftime('%Y-%m-%d %H:%M:%S.', time[0]) . time[1] 54 | endfunction 55 | else 56 | function! s:gettime() abort 57 | return strftime('%Y-%m-%d %H:%M:%S') 58 | endfunction 59 | endif 60 | 61 | let s:debug_enabled = 0 62 | let s:debug_file = '' 63 | -------------------------------------------------------------------------------- /autoload/tagbar/prototypes/basetag.vim: -------------------------------------------------------------------------------- 1 | let s:visibility_symbols = { 2 | \ 'public' : '+', 3 | \ 'protected' : '#', 4 | \ 'private' : '-' 5 | \ } 6 | if exists('g:tagbar_visibility_symbols') && !empty(g:tagbar_visibility_symbols) 7 | let s:visibility_symbols = g:tagbar_visibility_symbols 8 | endif 9 | 10 | function! tagbar#prototypes#basetag#new(name) abort 11 | let newobj = {} 12 | 13 | let newobj.name = a:name 14 | let newobj.fields = {} 15 | let newobj.fields.line = 0 16 | let newobj.fields.column = 0 17 | let newobj.fields.end = 0 18 | let newobj.prototype = '' 19 | let newobj.data_type = '' 20 | let newobj.path = '' 21 | let newobj.fullpath = a:name 22 | let newobj.depth = 0 23 | let newobj.parent = {} 24 | let newobj.tline = -1 25 | let newobj.fileinfo = {} 26 | let newobj.typeinfo = {} 27 | let newobj._childlist = [] 28 | let newobj._childdict = {} 29 | 30 | let newobj.isNormalTag = function(s:add_snr('s:isNormalTag')) 31 | let newobj.isPseudoTag = function(s:add_snr('s:isPseudoTag')) 32 | let newobj.isSplitTag = function(s:add_snr('s:isSplitTag')) 33 | let newobj.isKindheader = function(s:add_snr('s:isKindheader')) 34 | let newobj.getPrototype = function(s:add_snr('s:getPrototype')) 35 | let newobj.getDataType = function(s:add_snr('s:getDataType')) 36 | let newobj._getPrefix = function(s:add_snr('s:_getPrefix')) 37 | let newobj.initFoldState = function(s:add_snr('s:initFoldState')) 38 | let newobj.getClosedParentTline = function(s:add_snr('s:getClosedParentTline')) 39 | let newobj.isFoldable = function(s:add_snr('s:isFoldable')) 40 | let newobj.isFolded = function(s:add_snr('s:isFolded')) 41 | let newobj.openFold = function(s:add_snr('s:openFold')) 42 | let newobj.closeFold = function(s:add_snr('s:closeFold')) 43 | let newobj.setFolded = function(s:add_snr('s:setFolded')) 44 | let newobj.openParents = function(s:add_snr('s:openParents')) 45 | let newobj.addChild = function(s:add_snr('s:addChild')) 46 | let newobj.getChildren = function(s:add_snr('s:getChildren')) 47 | let newobj.getChildrenByName = function(s:add_snr('s:getChildrenByName')) 48 | let newobj.removeChild = function(s:add_snr('s:removeChild')) 49 | 50 | return newobj 51 | endfunction 52 | 53 | " s:isNormalTag() {{{1 54 | function! s:isNormalTag() abort dict 55 | return 0 56 | endfunction 57 | 58 | " s:isPseudoTag() {{{1 59 | function! s:isPseudoTag() abort dict 60 | return 0 61 | endfunction 62 | 63 | " s:isSplitTag {{{1 64 | function! s:isSplitTag() abort dict 65 | return 0 66 | endfunction 67 | 68 | " s:isKindheader() {{{1 69 | function! s:isKindheader() abort dict 70 | return 0 71 | endfunction 72 | 73 | " s:getPrototype() {{{1 74 | function! s:getPrototype(short) abort dict 75 | return self.prototype 76 | endfunction 77 | 78 | " s:getDataType() {{{1 79 | function! s:getDataType() abort dict 80 | return self.data_type 81 | endfunction 82 | 83 | " s:_getPrefix() {{{1 84 | function! s:_getPrefix() abort dict 85 | let fileinfo = self.fileinfo 86 | 87 | if !empty(self._childlist) && g:tagbar_show_prefix == 1 88 | if fileinfo.tagfolds[self.fields.kind][self.fullpath] 89 | let prefix = g:tagbar#icon_closed 90 | else 91 | let prefix = g:tagbar#icon_open 92 | endif 93 | else 94 | let prefix = ' ' 95 | endif 96 | " Visibility is called 'access' in the ctags output 97 | if g:tagbar_show_visibility 98 | if has_key(self.fields, 'access') && g:tagbar_show_prefix == 1 99 | let prefix .= get(s:visibility_symbols, self.fields.access, ' ') 100 | elseif has_key(self.fields, 'file') && g:tagbar_show_prefix == 1 101 | let prefix .= s:visibility_symbols.private 102 | else 103 | let prefix .= ' ' 104 | endif 105 | endif 106 | 107 | return prefix 108 | endfunction 109 | 110 | " s:initFoldState() {{{1 111 | function! s:initFoldState(known_files) abort dict 112 | let fileinfo = self.fileinfo 113 | 114 | if a:known_files.has(fileinfo.fpath) && 115 | \ has_key(fileinfo, '_tagfolds_old') && 116 | \ has_key(fileinfo._tagfolds_old[self.fields.kind], self.fullpath) 117 | " The file has been updated and the tag was there before, so copy its 118 | " old fold state 119 | let fileinfo.tagfolds[self.fields.kind][self.fullpath] = 120 | \ fileinfo._tagfolds_old[self.fields.kind][self.fullpath] 121 | elseif self.depth >= fileinfo.foldlevel 122 | let fileinfo.tagfolds[self.fields.kind][self.fullpath] = 1 123 | else 124 | let fileinfo.tagfolds[self.fields.kind][self.fullpath] = 125 | \ fileinfo.kindfolds[self.fields.kind] 126 | endif 127 | endfunction 128 | 129 | " s:getClosedParentTline() {{{1 130 | function! s:getClosedParentTline() abort dict 131 | let tagline = self.tline 132 | 133 | " Find the first closed parent, starting from the top of the hierarchy. 134 | let parents = [] 135 | let curparent = self.parent 136 | while !empty(curparent) 137 | call add(parents, curparent) 138 | let curparent = curparent.parent 139 | endwhile 140 | for parent in reverse(parents) 141 | if parent.isFolded() 142 | let tagline = parent.tline 143 | break 144 | endif 145 | endfor 146 | 147 | return tagline 148 | endfunction 149 | 150 | " s:isFoldable() {{{1 151 | function! s:isFoldable() abort dict 152 | return !empty(self._childlist) 153 | endfunction 154 | 155 | " s:isFolded() {{{1 156 | function! s:isFolded() abort dict 157 | return self.fileinfo.tagfolds[self.fields.kind][self.fullpath] 158 | endfunction 159 | 160 | " s:openFold() {{{1 161 | function! s:openFold() abort dict 162 | if self.isFoldable() 163 | let self.fileinfo.tagfolds[self.fields.kind][self.fullpath] = 0 164 | endif 165 | endfunction 166 | 167 | " s:closeFold() {{{1 168 | function! s:closeFold() abort dict 169 | let newline = line('.') 170 | 171 | if !empty(self.parent) && self.parent.isKindheader() 172 | " Tag is child of generic 'kind' 173 | call self.parent.closeFold() 174 | let newline = self.parent.tline 175 | elseif self.isFoldable() && !self.isFolded() 176 | " Tag is parent of a scope and is not folded 177 | let self.fileinfo.tagfolds[self.fields.kind][self.fullpath] = 1 178 | let newline = self.tline 179 | elseif !empty(self.parent) 180 | " Tag is normal child, so close parent 181 | let parent = self.parent 182 | let self.fileinfo.tagfolds[parent.fields.kind][parent.fullpath] = 1 183 | let newline = parent.tline 184 | endif 185 | 186 | return newline 187 | endfunction 188 | 189 | " s:setFolded() {{{1 190 | function! s:setFolded(folded) abort dict 191 | let self.fileinfo.tagfolds[self.fields.kind][self.fullpath] = a:folded 192 | endfunction 193 | 194 | " s:openParents() {{{1 195 | function! s:openParents() abort dict 196 | let parent = self.parent 197 | 198 | while !empty(parent) 199 | call parent.openFold() 200 | let parent = parent.parent 201 | endwhile 202 | endfunction 203 | 204 | " s:addChild() {{{1 205 | function! s:addChild(tag) abort dict 206 | call add(self._childlist, a:tag) 207 | 208 | if has_key(self._childdict, a:tag.name) 209 | call add(self._childdict[a:tag.name], a:tag) 210 | else 211 | let self._childdict[a:tag.name] = [a:tag] 212 | endif 213 | endfunction 214 | 215 | " s:getChildren() {{{1 216 | function! s:getChildren() dict abort 217 | return self._childlist 218 | endfunction 219 | 220 | " s:getChildrenByName() {{{1 221 | function! s:getChildrenByName(tagname) dict abort 222 | return get(self._childdict, a:tagname, []) 223 | endfunction 224 | 225 | " s:removeChild() {{{1 226 | function! s:removeChild(tag) dict abort 227 | let idx = index(self._childlist, a:tag) 228 | if idx >= 0 229 | call remove(self._childlist, idx) 230 | endif 231 | 232 | let namelist = get(self._childdict, a:tag.name, []) 233 | let idx = index(namelist, a:tag) 234 | if idx >= 0 235 | call remove(namelist, idx) 236 | endif 237 | endfunction 238 | 239 | " s:add_snr() {{{1 240 | function! s:add_snr(funcname) abort 241 | if !exists('s:snr') 242 | let s:snr = matchstr(expand(''), '\d\+_\zeget_snr$') 243 | endif 244 | return s:snr . a:funcname 245 | endfunction 246 | 247 | " Modeline {{{1 248 | " vim: ts=8 sw=4 sts=4 et foldenable foldmethod=marker foldcolumn=1 249 | -------------------------------------------------------------------------------- /autoload/tagbar/prototypes/fileinfo.vim: -------------------------------------------------------------------------------- 1 | function! tagbar#prototypes#fileinfo#new(fname, ftype, typeinfo) abort 2 | let newobj = {} 3 | 4 | " The complete file path 5 | let newobj.fpath = a:fname 6 | 7 | let newobj.bufnr = bufnr(a:fname) 8 | 9 | " File modification time 10 | let newobj.mtime = getftime(a:fname) 11 | 12 | " Get file size 13 | let newobj.fsize = getfsize(a:fname) 14 | 15 | " Get the number of lines in the file 16 | let newobj.lnum = line('$') 17 | 18 | " The vim file type 19 | let newobj.ftype = a:ftype 20 | 21 | " List of the tags that are present in the file, sorted according to the 22 | " value of 'g:tagbar_sort' 23 | let newobj._taglist = [] 24 | let newobj._tagdict = {} 25 | 26 | " Dictionary of the tags, indexed by line number in the file 27 | let newobj.fline = {} 28 | 29 | " Dictionary of the tags, indexed by line number in the tagbar 30 | let newobj.tline = {} 31 | 32 | " Dictionary of the folding state of 'kind's, indexed by short name 33 | let newobj.kindfolds = {} 34 | let newobj.typeinfo = a:typeinfo 35 | " copy the default fold state from the type info 36 | for kind in a:typeinfo.kinds 37 | let newobj.kindfolds[kind.short] = 38 | \ g:tagbar_foldlevel == 0 ? 1 : kind.fold 39 | endfor 40 | 41 | " Dictionary of dictionaries of the folding state of individual tags, 42 | " indexed by kind and full path 43 | let newobj.tagfolds = {} 44 | for kind in a:typeinfo.kinds 45 | let newobj.tagfolds[kind.short] = {} 46 | endfor 47 | 48 | " The current foldlevel of the file 49 | let newobj.foldlevel = g:tagbar_foldlevel 50 | 51 | let newobj.addTag = function(s:add_snr('s:addTag')) 52 | let newobj.getTags = function(s:add_snr('s:getTags')) 53 | let newobj.getTagsByName = function(s:add_snr('s:getTagsByName')) 54 | let newobj.removeTag = function(s:add_snr('s:removeTag')) 55 | let newobj.reset = function(s:add_snr('s:reset')) 56 | let newobj.clearOldFolds = function(s:add_snr('s:clearOldFolds')) 57 | let newobj.sortTags = function(s:add_snr('s:sortTags')) 58 | let newobj.openKindFold = function(s:add_snr('s:openKindFold')) 59 | let newobj.closeKindFold = function(s:add_snr('s:closeKindFold')) 60 | 61 | " This is used during file processing. If the limit is exceeded at that 62 | " point, then mark this flag for displaying to the tagbar window 63 | let newobj.fsize_exceeded = 0 64 | 65 | return newobj 66 | endfunction 67 | 68 | " s:addTag() {{{1 69 | function! s:addTag(tag) abort dict 70 | call add(self._taglist, a:tag) 71 | 72 | if has_key(self._tagdict, a:tag.name) 73 | call add(self._tagdict[a:tag.name], a:tag) 74 | else 75 | let self._tagdict[a:tag.name] = [a:tag] 76 | endif 77 | endfunction 78 | 79 | " s:getTags() {{{1 80 | function! s:getTags() dict abort 81 | return self._taglist 82 | endfunction 83 | 84 | " s:getTagsByName() {{{1 85 | function! s:getTagsByName(tagname) dict abort 86 | return get(self._tagdict, a:tagname, []) 87 | endfunction 88 | 89 | " s:removeTag() {{{1 90 | function! s:removeTag(tag) dict abort 91 | let idx = index(self._taglist, a:tag) 92 | if idx >= 0 93 | call remove(self._taglist, idx) 94 | endif 95 | 96 | let namelist = get(self._tagdict, a:tag.name, []) 97 | let idx = index(namelist, a:tag) 98 | if idx >= 0 99 | call remove(namelist, idx) 100 | endif 101 | endfunction 102 | 103 | " s:reset() {{{1 104 | " Reset stuff that gets regenerated while processing a file and save the old 105 | " tag folds 106 | function! s:reset() abort dict 107 | let self.mtime = getftime(self.fpath) 108 | let self._taglist = [] 109 | let self._tagdict = {} 110 | let self.fline = {} 111 | let self.tline = {} 112 | 113 | let self._tagfolds_old = self.tagfolds 114 | let self.tagfolds = {} 115 | 116 | for kind in self.typeinfo.kinds 117 | let self.tagfolds[kind.short] = {} 118 | endfor 119 | endfunction 120 | 121 | " s:clearOldFolds() {{{1 122 | function! s:clearOldFolds() abort dict 123 | if exists('self._tagfolds_old') 124 | unlet self._tagfolds_old 125 | endif 126 | endfunction 127 | 128 | " s:sortTags() {{{1 129 | function! s:sortTags(compare_typeinfo) abort dict 130 | if get(a:compare_typeinfo, 'sort', g:tagbar_sort) 131 | call tagbar#sorting#sort(self._taglist, 'kind', a:compare_typeinfo) 132 | else 133 | call tagbar#sorting#sort(self._taglist, 'line', a:compare_typeinfo) 134 | endif 135 | endfunction 136 | 137 | " s:openKindFold() {{{1 138 | function! s:openKindFold(kind) abort dict 139 | let self.kindfolds[a:kind.short] = 0 140 | endfunction 141 | 142 | " s:closeKindFold() {{{1 143 | function! s:closeKindFold(kind) abort dict 144 | let self.kindfolds[a:kind.short] = 1 145 | endfunction 146 | 147 | " s:add_snr() {{{1 148 | function! s:add_snr(funcname) abort 149 | if !exists('s:snr') 150 | let s:snr = matchstr(expand(''), '\d\+_\zeget_snr$') 151 | endif 152 | return s:snr . a:funcname 153 | endfunction 154 | 155 | " Modeline {{{1 156 | " vim: ts=8 sw=4 sts=4 et foldenable foldmethod=marker foldcolumn=1 157 | -------------------------------------------------------------------------------- /autoload/tagbar/prototypes/kindheadertag.vim: -------------------------------------------------------------------------------- 1 | function! tagbar#prototypes#kindheadertag#new(name) abort 2 | let newobj = tagbar#prototypes#basetag#new(a:name) 3 | 4 | let newobj.isKindheader = function(s:add_snr('s:isKindheader')) 5 | let newobj.getPrototype = function(s:add_snr('s:getPrototype')) 6 | let newobj.isFoldable = function(s:add_snr('s:isFoldable')) 7 | let newobj.isFolded = function(s:add_snr('s:isFolded')) 8 | let newobj.openFold = function(s:add_snr('s:openFold')) 9 | let newobj.closeFold = function(s:add_snr('s:closeFold')) 10 | let newobj.toggleFold = function(s:add_snr('s:toggleFold')) 11 | 12 | return newobj 13 | endfunction 14 | 15 | " s:isKindheader() {{{1 16 | function! s:isKindheader() abort dict 17 | return 1 18 | endfunction 19 | 20 | " s:getPrototype() {{{1 21 | function! s:getPrototype(short) abort dict 22 | return self.name . ': ' . 23 | \ self.numtags . ' ' . (self.numtags > 1 ? 'tags' : 'tag') 24 | endfunction 25 | 26 | " s:isFoldable() {{{1 27 | function! s:isFoldable() abort dict 28 | return 1 29 | endfunction 30 | 31 | " s:isFolded() {{{1 32 | function! s:isFolded() abort dict 33 | return self.fileinfo.kindfolds[self.short] 34 | endfunction 35 | 36 | " s:openFold() {{{1 37 | function! s:openFold() abort dict 38 | let self.fileinfo.kindfolds[self.short] = 0 39 | endfunction 40 | 41 | " s:closeFold() {{{1 42 | function! s:closeFold() abort dict 43 | let self.fileinfo.kindfolds[self.short] = 1 44 | return line('.') 45 | endfunction 46 | 47 | " s:toggleFold() {{{1 48 | function! s:toggleFold(fileinfo) abort dict 49 | let a:fileinfo.kindfolds[self.short] = !a:fileinfo.kindfolds[self.short] 50 | endfunction 51 | 52 | " s:add_snr() {{{1 53 | function! s:add_snr(funcname) abort 54 | if !exists('s:snr') 55 | let s:snr = matchstr(expand(''), '\d\+_\zeget_snr$') 56 | endif 57 | return s:snr . a:funcname 58 | endfunction 59 | 60 | " Modeline {{{1 61 | " vim: ts=8 sw=4 sts=4 et foldenable foldmethod=marker foldcolumn=1 62 | -------------------------------------------------------------------------------- /autoload/tagbar/prototypes/normaltag.vim: -------------------------------------------------------------------------------- 1 | function! s:maybe_map_scope(scopestr) abort 2 | if !empty(g:tagbar_scopestrs) 3 | if has_key(g:tagbar_scopestrs, a:scopestr) 4 | return g:tagbar_scopestrs[a:scopestr] 5 | endif 6 | endif 7 | return a:scopestr 8 | endfunction 9 | 10 | function! tagbar#prototypes#normaltag#new(name) abort 11 | let newobj = tagbar#prototypes#basetag#new(a:name) 12 | 13 | let newobj.isNormalTag = function(s:add_snr('s:isNormalTag')) 14 | let newobj.strfmt = function(s:add_snr('s:strfmt')) 15 | let newobj.str = function(s:add_snr('s:str')) 16 | let newobj.getPrototype = function(s:add_snr('s:getPrototype')) 17 | let newobj.getDataType = function(s:add_snr('s:getDataType')) 18 | 19 | return newobj 20 | endfunction 21 | 22 | " s:isNormalTag() {{{1 23 | function! s:isNormalTag() abort dict 24 | return 1 25 | endfunction 26 | 27 | " s:strfmt() {{{1 28 | function! s:strfmt() abort dict 29 | let typeinfo = self.typeinfo 30 | 31 | if g:tagbar_show_suffix == 1 32 | let suffix = get(self.fields, 'signature', '') 33 | if has_key(self.fields, 'type') 34 | let suffix .= ' : ' . self.fields.type 35 | elseif has_key(get(typeinfo, 'kind2scope', {}), self.fields.kind) 36 | let scope = s:maybe_map_scope(typeinfo.kind2scope[self.fields.kind]) 37 | if !g:tagbar_show_data_type 38 | let suffix .= ' : ' . scope 39 | endif 40 | endif 41 | 42 | if g:tagbar_show_data_type && self.getDataType() !=# '' 43 | let suffix .= ' : ' . self.getDataType() 44 | endif 45 | else 46 | let suffix = '' 47 | endif 48 | 49 | let prefix = self._getPrefix() 50 | 51 | if g:tagbar_show_tag_linenumbers == 1 52 | let suffix .= ' [' . self.fields.line . ']' 53 | elseif g:tagbar_show_tag_linenumbers == 2 54 | let prefix .= '[' . self.fields.line . '] ' 55 | endif 56 | 57 | return prefix . self.name . suffix 58 | endfunction 59 | 60 | " s:str() {{{1 61 | function! s:str(longsig, full) abort dict 62 | if a:full && self.path !=# '' 63 | let str = self.path . self.typeinfo.sro . self.name 64 | else 65 | let str = self.name 66 | endif 67 | 68 | if has_key(self.fields, 'signature') 69 | if a:longsig 70 | let str .= self.fields.signature 71 | else 72 | let str .= '()' 73 | endif 74 | endif 75 | 76 | return str 77 | endfunction 78 | 79 | " s:getPrototype() {{{1 80 | function! s:getPrototype(short) abort dict 81 | if self.prototype !=# '' 82 | let prototype = self.prototype 83 | else 84 | let bufnr = self.fileinfo.bufnr 85 | 86 | if self.fields.line == 0 || !bufloaded(bufnr) 87 | " No linenumber available or buffer not loaded (probably due to 88 | " 'nohidden'), try the pattern instead 89 | return substitute(self.pattern, '^\\M\\^\\C\s*\(.*\)\\$$', '\1', '') 90 | endif 91 | 92 | let line = getbufline(bufnr, self.fields.line)[0] 93 | " If prototype includes declaration, remove the '=' and anything after 94 | " FIXME: Need to remove this code. This breaks python prototypes that 95 | " can include a '=' in the function paramter list. 96 | " ex: function(arg1, optional_arg2=False) 97 | " let line = substitute(line, '\s*=.*', '', '') 98 | let list = split(line, '\zs') 99 | 100 | let start = index(list, '(') 101 | if start == -1 102 | return substitute(line, '^\s\+', '', '') 103 | endif 104 | 105 | let opening = count(list, '(', 0, start) 106 | let closing = count(list, ')', 0, start) 107 | if closing >= opening 108 | return substitute(line, '^\s\+', '', '') 109 | endif 110 | 111 | let balance = opening - closing 112 | 113 | let prototype = line 114 | let curlinenr = self.fields.line + 1 115 | while balance > 0 && curlinenr < line('$') 116 | let curline = getbufline(bufnr, curlinenr)[0] 117 | let curlist = split(curline, '\zs') 118 | let balance += count(curlist, '(') 119 | let balance -= count(curlist, ')') 120 | let prototype .= "\n" . curline 121 | let curlinenr += 1 122 | endwhile 123 | 124 | let self.prototype = prototype 125 | endif 126 | 127 | if a:short 128 | " join all lines and remove superfluous spaces 129 | let prototype = substitute(prototype, '^\s\+', '', '') 130 | let prototype = substitute(prototype, '\_s\+', ' ', 'g') 131 | let prototype = substitute(prototype, '(\s\+', '(', 'g') 132 | let prototype = substitute(prototype, '\s\+)', ')', 'g') 133 | " Avoid hit-enter prompts 134 | let maxlen = &columns - 12 135 | if len(prototype) > maxlen 136 | let prototype = prototype[:maxlen - 1 - 3] 137 | let prototype .= '...' 138 | endif 139 | endif 140 | 141 | return prototype 142 | endfunction 143 | 144 | " s:getDataType() {{{1 145 | function! s:getDataType() abort dict 146 | if self.data_type !=# '' 147 | let data_type = self.data_type 148 | else 149 | " This is a fallthrough attempt to derive the data_type from the line 150 | " in the event ctags doesn't return the typeref field 151 | let bufnr = self.fileinfo.bufnr 152 | 153 | if self.fields.line == 0 || !bufloaded(bufnr) 154 | " No linenumber available or buffer not loaded (probably due to 155 | " 'nohidden'), try the pattern instead 156 | return substitute(self.pattern, '^\\M\\^\\C\s*\(.*\)\\$$', '\1', '') 157 | endif 158 | 159 | let line = getbufline(bufnr, self.fields.line)[0] 160 | let data_type = substitute(line, '\s*' . escape(self.name, '~') . '.*', '', '') 161 | 162 | " Strip off the path if we have one along with any spaces prior to the 163 | " path 164 | if self.path !=# '' 165 | let data_type = substitute(data_type, '\s*' . self.path . self.typeinfo.sro, '', '') 166 | endif 167 | 168 | " Strip off leading spaces 169 | let data_type = substitute(data_type, '^\s\+', '', '') 170 | 171 | let self.data_type = data_type 172 | endif 173 | 174 | return data_type 175 | endfunction 176 | 177 | " s:add_snr() {{{1 178 | function! s:add_snr(funcname) abort 179 | if !exists('s:snr') 180 | let s:snr = matchstr(expand(''), '\d\+_\zeget_snr$') 181 | endif 182 | return s:snr . a:funcname 183 | endfunction 184 | 185 | " Modeline {{{1 186 | " vim: ts=8 sw=4 sts=4 et foldenable foldmethod=marker foldcolumn=1 187 | -------------------------------------------------------------------------------- /autoload/tagbar/prototypes/pseudotag.vim: -------------------------------------------------------------------------------- 1 | function! tagbar#prototypes#pseudotag#new(name) abort 2 | let newobj = tagbar#prototypes#basetag#new(a:name) 3 | 4 | let newobj.isPseudoTag = function(s:add_snr('s:isPseudoTag')) 5 | let newobj.strfmt = function(s:add_snr('s:strfmt')) 6 | 7 | return newobj 8 | endfunction 9 | 10 | " s:isPseudoTag() {{{1 11 | function! s:isPseudoTag() abort dict 12 | return 1 13 | endfunction 14 | 15 | " s:strfmt() {{{1 16 | function! s:strfmt() abort dict 17 | let typeinfo = self.typeinfo 18 | 19 | let suffix = get(self.fields, 'signature', '') 20 | if has_key(typeinfo.kind2scope, self.fields.kind) 21 | let suffix .= ' : ' . typeinfo.kind2scope[self.fields.kind] 22 | endif 23 | let prefix = self._getPrefix() 24 | 25 | if g:tagbar_show_tag_linenumbers == 1 26 | let suffix .= ' [' . self.fields.line . ']' 27 | elseif g:tagbar_show_tag_linenumbers == 2 28 | let prefix .= '[' . self.fields.line . '] ' 29 | endif 30 | 31 | return prefix . self.name . '*' . suffix 32 | endfunction 33 | 34 | " s:add_snr() {{{1 35 | function! s:add_snr(funcname) abort 36 | if !exists('s:snr') 37 | let s:snr = matchstr(expand(''), '\d\+_\zeget_snr$') 38 | endif 39 | return s:snr . a:funcname 40 | endfunction 41 | 42 | " Modeline {{{1 43 | " vim: ts=8 sw=4 sts=4 et foldenable foldmethod=marker foldcolumn=1 44 | -------------------------------------------------------------------------------- /autoload/tagbar/prototypes/splittag.vim: -------------------------------------------------------------------------------- 1 | " A tag that was created because of a tag name that covers multiple scopes 2 | " Inherits the fields of the "main" tag it was split from. 3 | " May be replaced during tag processing if it appears as a normal tag later, 4 | " just like a pseudo tag. 5 | 6 | function! tagbar#prototypes#splittag#new(name) abort 7 | let newobj = tagbar#prototypes#normaltag#new(a:name) 8 | 9 | let newobj.isSplitTag = function(s:add_snr('s:isSplitTag')) 10 | 11 | return newobj 12 | endfunction 13 | 14 | function! s:isSplitTag() abort dict 15 | return 1 16 | endfunction 17 | 18 | function! s:add_snr(funcname) abort 19 | if !exists('s:snr') 20 | let s:snr = matchstr(expand(''), '\d\+_\zeget_snr$') 21 | endif 22 | return s:snr . a:funcname 23 | endfunction 24 | 25 | " Modeline {{{1 26 | " vim: ts=8 sw=4 sts=4 et foldenable foldmethod=marker foldcolumn=1 27 | -------------------------------------------------------------------------------- /autoload/tagbar/prototypes/typeinfo.vim: -------------------------------------------------------------------------------- 1 | function! tagbar#prototypes#typeinfo#new(...) abort 2 | let newobj = {} 3 | 4 | let newobj.kinddict = {} 5 | 6 | if a:0 > 0 7 | call extend(newobj, a:1) 8 | endif 9 | 10 | let newobj.getKind = function(s:add_snr('s:getKind')) 11 | let newobj.createKinddict = function(s:add_snr('s:createKinddict')) 12 | 13 | return newobj 14 | endfunction 15 | 16 | " s:getKind() {{{1 17 | function! s:getKind(kind) abort dict 18 | "let idx = self.kinddict[a:kind] 19 | let idx = has_key(self.kinddict, a:kind) ? self.kinddict[a:kind] : -1 20 | return self.kinds[idx] 21 | endfunction 22 | 23 | " s:createKinddict() {{{1 24 | " Create a dictionary of the kind order for fast access in sorting functions 25 | function! s:createKinddict() abort dict 26 | let i = 0 27 | for kind in self.kinds 28 | let self.kinddict[kind.short] = i 29 | let i += 1 30 | endfor 31 | let self.kinddict['?'] = i 32 | endfunction 33 | 34 | " s:add_snr() {{{1 35 | function! s:add_snr(funcname) abort 36 | if !exists('s:snr') 37 | let s:snr = matchstr(expand(''), '\d\+_\zeget_snr$') 38 | endif 39 | return s:snr . a:funcname 40 | endfunction 41 | 42 | " Modeline {{{1 43 | " vim: ts=8 sw=4 sts=4 et foldenable foldmethod=marker foldcolumn=1 44 | -------------------------------------------------------------------------------- /autoload/tagbar/sorting.vim: -------------------------------------------------------------------------------- 1 | " Script-local variable needed since compare functions can't 2 | " take additional arguments 3 | let s:compare_typeinfo = {} 4 | 5 | function! tagbar#sorting#sort(tags, compareby, compare_typeinfo) abort 6 | let s:compare_typeinfo = a:compare_typeinfo 7 | 8 | let comparemethod = 9 | \ a:compareby ==# 'kind' ? 's:compare_by_kind' : 's:compare_by_line' 10 | 11 | call sort(a:tags, comparemethod) 12 | 13 | for tag in a:tags 14 | if !empty(tag.getChildren()) 15 | call tagbar#sorting#sort(tag.getChildren(), a:compareby, 16 | \ a:compare_typeinfo) 17 | endif 18 | endfor 19 | endfunction 20 | 21 | function! s:compare_by_kind(tag1, tag2) abort 22 | let typeinfo = s:compare_typeinfo 23 | 24 | if !has_key(typeinfo.kinddict, a:tag1.fields.kind) 25 | return -1 26 | endif 27 | if !has_key(typeinfo.kinddict, a:tag2.fields.kind) 28 | return 1 29 | endif 30 | if typeinfo.kinddict[a:tag1.fields.kind] <# 31 | \ typeinfo.kinddict[a:tag2.fields.kind] 32 | return -1 33 | elseif typeinfo.kinddict[a:tag1.fields.kind] ># 34 | \ typeinfo.kinddict[a:tag2.fields.kind] 35 | return 1 36 | else 37 | " Ignore '~' prefix for C++ destructors to sort them directly under 38 | " the constructors 39 | if a:tag1.name[0] ==# '~' 40 | let name1 = a:tag1.name[1:] 41 | else 42 | let name1 = a:tag1.name 43 | endif 44 | if a:tag2.name[0] ==# '~' 45 | let name2 = a:tag2.name[1:] 46 | else 47 | let name2 = a:tag2.name 48 | endif 49 | 50 | let ci = g:tagbar_case_insensitive 51 | if (((!ci) && (name1 <=# name2)) || (ci && (name1 <=? name2))) 52 | return -1 53 | else 54 | return 1 55 | endif 56 | endif 57 | endfunction 58 | 59 | function! s:compare_by_line(tag1, tag2) abort 60 | return a:tag1.fields.line - a:tag2.fields.line 61 | endfunction 62 | 63 | " vim: ts=8 sw=4 sts=4 et foldenable foldmethod=marker foldcolumn=1 64 | -------------------------------------------------------------------------------- /autoload/tagbar/state.vim: -------------------------------------------------------------------------------- 1 | function! tagbar#state#get_current_file(force_current) abort 2 | return s:get().getCurrent(a:force_current) 3 | endfunction 4 | 5 | function! tagbar#state#set_current_file(fileinfo) abort 6 | call s:get().setCurrentFile(a:fileinfo) 7 | endfunction 8 | 9 | function! tagbar#state#set_paused() abort 10 | call s:get().setPaused() 11 | endfunction 12 | 13 | function! s:get() abort 14 | if !exists('t:tagbar_state') 15 | let t:tagbar_state = s:State.New() 16 | endif 17 | 18 | return t:tagbar_state 19 | endfunction 20 | 21 | let s:State = { 22 | \ '_current' : {}, 23 | \ '_paused' : {}, 24 | \ } 25 | 26 | " s:state.New() {{{1 27 | function! s:State.New() abort dict 28 | return deepcopy(self) 29 | endfunction 30 | 31 | " s:state.getCurrent() {{{1 32 | function! s:State.getCurrent(force_current) abort dict 33 | if !tagbar#is_paused() || a:force_current 34 | return self._current 35 | else 36 | return self._paused 37 | endif 38 | endfunction 39 | 40 | " s:state.setCurrentFile() {{{1 41 | function! s:State.setCurrentFile(fileinfo) abort dict 42 | let self._current = a:fileinfo 43 | endfunction 44 | 45 | " s:state.setPaused() {{{1 46 | function! s:State.setPaused() abort dict 47 | let self._paused = self._current 48 | endfunction 49 | 50 | " Modeline {{{1 51 | " vim: ts=8 sw=4 sts=4 et foldenable foldmethod=marker foldcolumn=1 52 | -------------------------------------------------------------------------------- /autoload/tagbar/types/ctags.vim: -------------------------------------------------------------------------------- 1 | " Type definitions for standard Exuberant Ctags 2 | 3 | function! tagbar#types#ctags#init(supported_types) abort 4 | let types = {} 5 | 6 | " Ant {{{1 7 | let type_ant = tagbar#prototypes#typeinfo#new() 8 | let type_ant.ctagstype = 'ant' 9 | let type_ant.kinds = [ 10 | \ {'short' : 'p', 'long' : 'projects', 'fold' : 0, 'stl' : 1}, 11 | \ {'short' : 't', 'long' : 'targets', 'fold' : 0, 'stl' : 1} 12 | \ ] 13 | let types.ant = type_ant 14 | " Asm {{{1 15 | let type_asm = tagbar#prototypes#typeinfo#new() 16 | let type_asm.ctagstype = 'asm' 17 | let type_asm.kinds = [ 18 | \ {'short' : 'm', 'long' : 'macros', 'fold' : 0, 'stl' : 1}, 19 | \ {'short' : 't', 'long' : 'types', 'fold' : 0, 'stl' : 1}, 20 | \ {'short' : 'd', 'long' : 'defines', 'fold' : 0, 'stl' : 1}, 21 | \ {'short' : 'l', 'long' : 'labels', 'fold' : 0, 'stl' : 1} 22 | \ ] 23 | let types.asm = type_asm 24 | " ASP {{{1 25 | let type_aspvbs = tagbar#prototypes#typeinfo#new() 26 | let type_aspvbs.ctagstype = 'asp' 27 | let type_aspvbs.kinds = [ 28 | \ {'short' : 'd', 'long' : 'constants', 'fold' : 0, 'stl' : 1}, 29 | \ {'short' : 'c', 'long' : 'classes', 'fold' : 0, 'stl' : 1}, 30 | \ {'short' : 'f', 'long' : 'functions', 'fold' : 0, 'stl' : 1}, 31 | \ {'short' : 's', 'long' : 'subroutines', 'fold' : 0, 'stl' : 1}, 32 | \ {'short' : 'v', 'long' : 'variables', 'fold' : 0, 'stl' : 1} 33 | \ ] 34 | let types.aspvbs = type_aspvbs 35 | " Asymptote {{{1 36 | " Asymptote gets parsed well using filetype = c 37 | let type_asy = tagbar#prototypes#typeinfo#new() 38 | let type_asy.ctagstype = 'c' 39 | let type_asy.kinds = [ 40 | \ {'short' : 'd', 'long' : 'macros', 'fold' : 1, 'stl' : 0}, 41 | \ {'short' : 'p', 'long' : 'prototypes', 'fold' : 1, 'stl' : 0}, 42 | \ {'short' : 'g', 'long' : 'enums', 'fold' : 0, 'stl' : 1}, 43 | \ {'short' : 'e', 'long' : 'enumerators', 'fold' : 0, 'stl' : 0}, 44 | \ {'short' : 't', 'long' : 'typedefs', 'fold' : 0, 'stl' : 0}, 45 | \ {'short' : 's', 'long' : 'structs', 'fold' : 0, 'stl' : 1}, 46 | \ {'short' : 'u', 'long' : 'unions', 'fold' : 0, 'stl' : 1}, 47 | \ {'short' : 'm', 'long' : 'members', 'fold' : 0, 'stl' : 0}, 48 | \ {'short' : 'v', 'long' : 'variables', 'fold' : 0, 'stl' : 0}, 49 | \ {'short' : 'f', 'long' : 'functions', 'fold' : 0, 'stl' : 1} 50 | \ ] 51 | let type_asy.sro = '::' 52 | let type_asy.kind2scope = { 53 | \ 'g' : 'enum', 54 | \ 's' : 'struct', 55 | \ 'u' : 'union' 56 | \ } 57 | let type_asy.scope2kind = { 58 | \ 'enum' : 'g', 59 | \ 'struct' : 's', 60 | \ 'union' : 'u' 61 | \ } 62 | let types.asy = type_asy 63 | " Awk {{{1 64 | let type_awk = tagbar#prototypes#typeinfo#new() 65 | let type_awk.ctagstype = 'awk' 66 | let type_awk.kinds = [ 67 | \ {'short' : 'f', 'long' : 'functions', 'fold' : 0, 'stl' : 1} 68 | \ ] 69 | let types.awk = type_awk 70 | " Basic {{{1 71 | let type_basic = tagbar#prototypes#typeinfo#new() 72 | let type_basic.ctagstype = 'basic' 73 | let type_basic.kinds = [ 74 | \ {'short' : 'c', 'long' : 'constants', 'fold' : 0, 'stl' : 1}, 75 | \ {'short' : 'g', 'long' : 'enumerations', 'fold' : 0, 'stl' : 1}, 76 | \ {'short' : 'f', 'long' : 'functions', 'fold' : 0, 'stl' : 1}, 77 | \ {'short' : 'l', 'long' : 'labels', 'fold' : 0, 'stl' : 1}, 78 | \ {'short' : 't', 'long' : 'types', 'fold' : 0, 'stl' : 1}, 79 | \ {'short' : 'v', 'long' : 'variables', 'fold' : 0, 'stl' : 1} 80 | \ ] 81 | let types.basic = type_basic 82 | " BETA {{{1 83 | let type_beta = tagbar#prototypes#typeinfo#new() 84 | let type_beta.ctagstype = 'beta' 85 | let type_beta.kinds = [ 86 | \ {'short' : 'f', 'long' : 'fragments', 'fold' : 0, 'stl' : 1}, 87 | \ {'short' : 's', 'long' : 'slots', 'fold' : 0, 'stl' : 1}, 88 | \ {'short' : 'v', 'long' : 'patterns', 'fold' : 0, 'stl' : 1} 89 | \ ] 90 | let types.beta = type_beta 91 | " C {{{1 92 | let type_c = tagbar#prototypes#typeinfo#new() 93 | let type_c.ctagstype = 'c' 94 | let type_c.kinds = [ 95 | \ {'short' : 'd', 'long' : 'macros', 'fold' : 1, 'stl' : 0}, 96 | \ {'short' : 'p', 'long' : 'prototypes', 'fold' : 1, 'stl' : 0}, 97 | \ {'short' : 'g', 'long' : 'enums', 'fold' : 0, 'stl' : 1}, 98 | \ {'short' : 'e', 'long' : 'enumerators', 'fold' : 0, 'stl' : 0}, 99 | \ {'short' : 't', 'long' : 'typedefs', 'fold' : 0, 'stl' : 0}, 100 | \ {'short' : 's', 'long' : 'structs', 'fold' : 0, 'stl' : 1}, 101 | \ {'short' : 'u', 'long' : 'unions', 'fold' : 0, 'stl' : 1}, 102 | \ {'short' : 'm', 'long' : 'members', 'fold' : 0, 'stl' : 0}, 103 | \ {'short' : 'v', 'long' : 'variables', 'fold' : 0, 'stl' : 0}, 104 | \ {'short' : 'f', 'long' : 'functions', 'fold' : 0, 'stl' : 1} 105 | \ ] 106 | let type_c.sro = '::' 107 | let type_c.kind2scope = { 108 | \ 'g' : 'enum', 109 | \ 's' : 'struct', 110 | \ 'u' : 'union' 111 | \ } 112 | let type_c.scope2kind = { 113 | \ 'enum' : 'g', 114 | \ 'struct' : 's', 115 | \ 'union' : 'u' 116 | \ } 117 | let types.c = type_c 118 | let types.lpc = type_c 119 | " C++ {{{1 120 | let type_cpp = tagbar#prototypes#typeinfo#new() 121 | let type_cpp.ctagstype = 'c++' 122 | let type_cpp.kinds = [ 123 | \ {'short' : 'd', 'long' : 'macros', 'fold' : 1, 'stl' : 0}, 124 | \ {'short' : 'p', 'long' : 'prototypes', 'fold' : 1, 'stl' : 0}, 125 | \ {'short' : 'g', 'long' : 'enums', 'fold' : 0, 'stl' : 1}, 126 | \ {'short' : 'e', 'long' : 'enumerators', 'fold' : 0, 'stl' : 0}, 127 | \ {'short' : 't', 'long' : 'typedefs', 'fold' : 0, 'stl' : 0}, 128 | \ {'short' : 'n', 'long' : 'namespaces', 'fold' : 0, 'stl' : 1}, 129 | \ {'short' : 'c', 'long' : 'classes', 'fold' : 0, 'stl' : 1}, 130 | \ {'short' : 's', 'long' : 'structs', 'fold' : 0, 'stl' : 1}, 131 | \ {'short' : 'u', 'long' : 'unions', 'fold' : 0, 'stl' : 1}, 132 | \ {'short' : 'f', 'long' : 'functions', 'fold' : 0, 'stl' : 1}, 133 | \ {'short' : 'm', 'long' : 'members', 'fold' : 0, 'stl' : 0}, 134 | \ {'short' : 'v', 'long' : 'variables', 'fold' : 0, 'stl' : 0} 135 | \ ] 136 | let type_cpp.sro = '::' 137 | let type_cpp.kind2scope = { 138 | \ 'g' : 'enum', 139 | \ 'n' : 'namespace', 140 | \ 'c' : 'class', 141 | \ 's' : 'struct', 142 | \ 'u' : 'union' 143 | \ } 144 | let type_cpp.scope2kind = { 145 | \ 'enum' : 'g', 146 | \ 'namespace' : 'n', 147 | \ 'class' : 'c', 148 | \ 'struct' : 's', 149 | \ 'union' : 'u' 150 | \ } 151 | let types.cpp = type_cpp 152 | let types.cuda = type_cpp 153 | " C# {{{1 154 | let type_cs = tagbar#prototypes#typeinfo#new() 155 | let type_cs.ctagstype = 'c#' 156 | let type_cs.kinds = [ 157 | \ {'short' : 'd', 'long' : 'macros', 'fold' : 1, 'stl' : 0}, 158 | \ {'short' : 'f', 'long' : 'fields', 'fold' : 0, 'stl' : 1}, 159 | \ {'short' : 'g', 'long' : 'enums', 'fold' : 0, 'stl' : 1}, 160 | \ {'short' : 'e', 'long' : 'enumerators', 'fold' : 0, 'stl' : 0}, 161 | \ {'short' : 't', 'long' : 'typedefs', 'fold' : 0, 'stl' : 1}, 162 | \ {'short' : 'n', 'long' : 'namespaces', 'fold' : 0, 'stl' : 1}, 163 | \ {'short' : 'i', 'long' : 'interfaces', 'fold' : 0, 'stl' : 1}, 164 | \ {'short' : 'c', 'long' : 'classes', 'fold' : 0, 'stl' : 1}, 165 | \ {'short' : 's', 'long' : 'structs', 'fold' : 0, 'stl' : 1}, 166 | \ {'short' : 'E', 'long' : 'events', 'fold' : 0, 'stl' : 1}, 167 | \ {'short' : 'm', 'long' : 'methods', 'fold' : 0, 'stl' : 1}, 168 | \ {'short' : 'p', 'long' : 'properties', 'fold' : 0, 'stl' : 1} 169 | \ ] 170 | let type_cs.sro = '.' 171 | let type_cs.kind2scope = { 172 | \ 'n' : 'namespace', 173 | \ 'i' : 'interface', 174 | \ 'c' : 'class', 175 | \ 's' : 'struct', 176 | \ 'g' : 'enum' 177 | \ } 178 | let type_cs.scope2kind = { 179 | \ 'namespace' : 'n', 180 | \ 'interface' : 'i', 181 | \ 'class' : 'c', 182 | \ 'struct' : 's', 183 | \ 'enum' : 'g' 184 | \ } 185 | let types.cs = type_cs 186 | " COBOL {{{1 187 | let type_cobol = tagbar#prototypes#typeinfo#new() 188 | let type_cobol.ctagstype = 'cobol' 189 | let type_cobol.kinds = [ 190 | \ {'short' : 'd', 'long' : 'data items', 'fold' : 0, 'stl' : 1}, 191 | \ {'short' : 'f', 'long' : 'file descriptions', 'fold' : 0, 'stl' : 1}, 192 | \ {'short' : 'g', 'long' : 'group items', 'fold' : 0, 'stl' : 1}, 193 | \ {'short' : 'p', 'long' : 'paragraphs', 'fold' : 0, 'stl' : 1}, 194 | \ {'short' : 'P', 'long' : 'program ids', 'fold' : 0, 'stl' : 1}, 195 | \ {'short' : 's', 'long' : 'sections', 'fold' : 0, 'stl' : 1} 196 | \ ] 197 | let types.cobol = type_cobol 198 | " Crystal {{{1 199 | let type_crystal = tagbar#prototypes#typeinfo#new() 200 | let type_crystal.ctagstype = 'crystal' 201 | let type_crystal.kinds = [ 202 | \ {'short' : 'm', 'long' : 'modules', 'fold' : 0, 'stl' : 1}, 203 | \ {'short' : 'c', 'long' : 'classes', 'fold' : 0, 'stl' : 1}, 204 | \ {'short' : 'd', 'long' : 'defs', 'fold' : 0, 'stl' : 1}, 205 | \ {'short' : 'f', 'long' : 'functions', 'fold' : 0, 'stl' : 1}, 206 | \ {'short' : 'M', 'long' : 'macros', 'fold' : 0, 'stl' : 1}, 207 | \ {'short' : 'l', 'long' : 'libs', 'fold' : 0, 'stl' : 1}, 208 | \ {'short' : 's', 'long' : 'structs', 'fold' : 0, 'stl' : 1}, 209 | \ {'short' : 'a', 'long' : 'aliases', 'fold' : 0, 'stl' : 1} 210 | \ ] 211 | let type_crystal.sro = '::' 212 | let types.crystal = type_crystal 213 | " DOS Batch {{{1 214 | let type_dosbatch = tagbar#prototypes#typeinfo#new() 215 | let type_dosbatch.ctagstype = 'dosbatch' 216 | let type_dosbatch.kinds = [ 217 | \ {'short' : 'l', 'long' : 'labels', 'fold' : 0, 'stl' : 1}, 218 | \ {'short' : 'v', 'long' : 'variables', 'fold' : 0, 'stl' : 1} 219 | \ ] 220 | let types.dosbatch = type_dosbatch 221 | " Eiffel {{{1 222 | let type_eiffel = tagbar#prototypes#typeinfo#new() 223 | let type_eiffel.ctagstype = 'eiffel' 224 | let type_eiffel.kinds = [ 225 | \ {'short' : 'c', 'long' : 'classes', 'fold' : 0, 'stl' : 1}, 226 | \ {'short' : 'f', 'long' : 'features', 'fold' : 0, 'stl' : 1} 227 | \ ] 228 | let type_eiffel.sro = '.' " Not sure, is nesting even possible? 229 | let type_eiffel.kind2scope = { 230 | \ 'c' : 'class', 231 | \ 'f' : 'feature' 232 | \ } 233 | let type_eiffel.scope2kind = { 234 | \ 'class' : 'c', 235 | \ 'feature' : 'f' 236 | \ } 237 | let types.eiffel = type_eiffel 238 | " Erlang {{{1 239 | let type_erlang = tagbar#prototypes#typeinfo#new() 240 | let type_erlang.ctagstype = 'erlang' 241 | let type_erlang.kinds = [ 242 | \ {'short' : 'm', 'long' : 'modules', 'fold' : 0, 'stl' : 1}, 243 | \ {'short' : 'd', 'long' : 'macro definitions', 'fold' : 0, 'stl' : 1}, 244 | \ {'short' : 'f', 'long' : 'functions', 'fold' : 0, 'stl' : 1}, 245 | \ {'short' : 'r', 'long' : 'record definitions', 'fold' : 0, 'stl' : 1} 246 | \ ] 247 | let type_erlang.sro = '.' " Not sure, is nesting even possible? 248 | let type_erlang.kind2scope = { 249 | \ 'm' : 'module' 250 | \ } 251 | let type_erlang.scope2kind = { 252 | \ 'module' : 'm' 253 | \ } 254 | let types.erlang = type_erlang 255 | " Flex {{{1 256 | " Vim doesn't support Flex out of the box, this is based on rough 257 | " guesses and probably requires 258 | " http://www.vim.org/scripts/script.php?script_id=2909 259 | " Improvements welcome! 260 | let type_as = tagbar#prototypes#typeinfo#new() 261 | let type_as.ctagstype = 'flex' 262 | let type_as.kinds = [ 263 | \ {'short' : 'v', 'long' : 'global variables', 'fold' : 0, 'stl' : 0}, 264 | \ {'short' : 'c', 'long' : 'classes', 'fold' : 0, 'stl' : 1}, 265 | \ {'short' : 'm', 'long' : 'methods', 'fold' : 0, 'stl' : 1}, 266 | \ {'short' : 'p', 'long' : 'properties', 'fold' : 0, 'stl' : 1}, 267 | \ {'short' : 'f', 'long' : 'functions', 'fold' : 0, 'stl' : 1}, 268 | \ {'short' : 'x', 'long' : 'mxtags', 'fold' : 0, 'stl' : 0} 269 | \ ] 270 | let type_as.sro = '.' 271 | let type_as.kind2scope = { 272 | \ 'c' : 'class' 273 | \ } 274 | let type_as.scope2kind = { 275 | \ 'class' : 'c' 276 | \ } 277 | let types.mxml = type_as 278 | let types.actionscript = type_as 279 | " Fortran {{{1 280 | let type_fortran = tagbar#prototypes#typeinfo#new() 281 | let type_fortran.ctagstype = 'fortran' 282 | let type_fortran.kinds = [ 283 | \ {'short' : 'm', 'long' : 'modules', 'fold' : 0, 'stl' : 1}, 284 | \ {'short' : 'p', 'long' : 'programs', 'fold' : 0, 'stl' : 1}, 285 | \ {'short' : 'k', 'long' : 'components', 'fold' : 0, 'stl' : 1}, 286 | \ {'short' : 't', 'long' : 'derived types and structures', 'fold' : 0, 287 | \ 'stl' : 1}, 288 | \ {'short' : 'c', 'long' : 'common blocks', 'fold' : 0, 'stl' : 1}, 289 | \ {'short' : 'b', 'long' : 'block data', 'fold' : 0, 'stl' : 0}, 290 | \ {'short' : 'e', 'long' : 'entry points', 'fold' : 0, 'stl' : 1}, 291 | \ {'short' : 'f', 'long' : 'functions', 'fold' : 0, 'stl' : 1}, 292 | \ {'short' : 's', 'long' : 'subroutines', 'fold' : 0, 'stl' : 1}, 293 | \ {'short' : 'l', 'long' : 'labels', 'fold' : 0, 'stl' : 1}, 294 | \ {'short' : 'n', 'long' : 'namelists', 'fold' : 0, 'stl' : 1}, 295 | \ {'short' : 'v', 'long' : 'variables', 'fold' : 0, 'stl' : 0} 296 | \ ] 297 | let type_fortran.sro = '.' " Not sure, is nesting even possible? 298 | let type_fortran.kind2scope = { 299 | \ 'm' : 'module', 300 | \ 'p' : 'program', 301 | \ 'f' : 'function', 302 | \ 's' : 'subroutine' 303 | \ } 304 | let type_fortran.scope2kind = { 305 | \ 'module' : 'm', 306 | \ 'program' : 'p', 307 | \ 'function' : 'f', 308 | \ 'subroutine' : 's' 309 | \ } 310 | let types.fortran = type_fortran 311 | " Go {{{1 312 | let type_go = tagbar#prototypes#typeinfo#new() 313 | let type_go.ctagstype = 'go' 314 | let type_go.kinds = [ 315 | \ {'short' : 'p', 'long' : 'packages', 'fold' : 0, 'stl' : 0}, 316 | \ {'short' : 'i', 'long' : 'interfaces', 'fold' : 0, 'stl' : 0}, 317 | \ {'short' : 'c', 'long' : 'constants', 'fold' : 0, 'stl' : 0}, 318 | \ {'short' : 's', 'long' : 'structs', 'fold' : 0, 'stl' : 1}, 319 | \ {'short' : 'm', 'long' : 'struct members', 'fold' : 0, 'stl' : 0}, 320 | \ {'short' : 't', 'long' : 'types', 'fold' : 0, 'stl' : 1}, 321 | \ {'short' : 'f', 'long' : 'functions', 'fold' : 0, 'stl' : 1}, 322 | \ {'short' : 'v', 'long' : 'variables', 'fold' : 0, 'stl' : 0} 323 | \ ] 324 | let type_go.sro = '.' 325 | let type_go.kind2scope = { 326 | \ 's' : 'struct' 327 | \ } 328 | let type_go.scope2kind = { 329 | \ 'struct' : 's' 330 | \ } 331 | let types.go = type_go 332 | " HTML {{{1 333 | let type_html = tagbar#prototypes#typeinfo#new() 334 | let type_html.ctagstype = 'html' 335 | let type_html.kinds = [ 336 | \ {'short' : 'f', 'long' : 'JavaScript functions', 'fold' : 0, 'stl' : 1}, 337 | \ {'short' : 'a', 'long' : 'named anchors', 'fold' : 0, 'stl' : 1} 338 | \ ] 339 | let types.html = type_html 340 | " Java {{{1 341 | let type_java = tagbar#prototypes#typeinfo#new() 342 | let type_java.ctagstype = 'java' 343 | let type_java.kinds = [ 344 | \ {'short' : 'p', 'long' : 'packages', 'fold' : 1, 'stl' : 0}, 345 | \ {'short' : 'f', 'long' : 'fields', 'fold' : 0, 'stl' : 0}, 346 | \ {'short' : 'g', 'long' : 'enum types', 'fold' : 0, 'stl' : 1}, 347 | \ {'short' : 'e', 'long' : 'enum constants', 'fold' : 0, 'stl' : 0}, 348 | \ {'short' : 'i', 'long' : 'interfaces', 'fold' : 0, 'stl' : 1}, 349 | \ {'short' : 'c', 'long' : 'classes', 'fold' : 0, 'stl' : 1}, 350 | \ {'short' : 'm', 'long' : 'methods', 'fold' : 0, 'stl' : 1} 351 | \ ] 352 | let type_java.sro = '.' 353 | let type_java.kind2scope = { 354 | \ 'g' : 'enum', 355 | \ 'i' : 'interface', 356 | \ 'c' : 'class' 357 | \ } 358 | let type_java.scope2kind = { 359 | \ 'enum' : 'g', 360 | \ 'interface' : 'i', 361 | \ 'class' : 'c' 362 | \ } 363 | let types.java = type_java 364 | " JavaScript {{{1 365 | let type_javascript = tagbar#prototypes#typeinfo#new() 366 | let type_javascript.ctagstype = 'javascript' 367 | let type_javascript.kinds = [ 368 | \ {'short': 'v', 'long': 'global variables', 'fold': 0, 'stl': 0}, 369 | \ {'short': 'c', 'long': 'classes', 'fold': 0, 'stl': 1}, 370 | \ {'short': 'p', 'long': 'properties', 'fold': 0, 'stl': 0}, 371 | \ {'short': 'm', 'long': 'methods', 'fold': 0, 'stl': 1}, 372 | \ {'short': 'f', 'long': 'functions', 'fold': 0, 'stl': 1}, 373 | \ ] 374 | let type_javascript.sro = '.' 375 | let type_javascript.kind2scope = { 376 | \ 'c' : 'class', 377 | \ 'f' : 'function', 378 | \ 'm' : 'method', 379 | \ 'p' : 'property', 380 | \ } 381 | let type_javascript.scope2kind = { 382 | \ 'class' : 'c', 383 | \ 'function' : 'f', 384 | \ } 385 | let types.javascript = type_javascript 386 | " Lisp {{{1 387 | let type_lisp = tagbar#prototypes#typeinfo#new() 388 | let type_lisp.ctagstype = 'lisp' 389 | let type_lisp.kinds = [ 390 | \ {'short' : 'f', 'long' : 'functions', 'fold' : 0, 'stl' : 1} 391 | \ ] 392 | let types.lisp = type_lisp 393 | let types.clojure = type_lisp 394 | " Lua {{{1 395 | let type_lua = tagbar#prototypes#typeinfo#new() 396 | let type_lua.ctagstype = 'lua' 397 | let type_lua.kinds = [ 398 | \ {'short' : 'f', 'long' : 'functions', 'fold' : 0, 'stl' : 1} 399 | \ ] 400 | let types.lua = type_lua 401 | " Make {{{1 402 | let type_make = tagbar#prototypes#typeinfo#new() 403 | let type_make.ctagstype = 'make' 404 | let type_make.kinds = [ 405 | \ {'short' : 'm', 'long' : 'macros', 'fold' : 0, 'stl' : 1} 406 | \ ] 407 | let types.make = type_make 408 | " Matlab {{{1 409 | let type_matlab = tagbar#prototypes#typeinfo#new() 410 | let type_matlab.ctagstype = 'matlab' 411 | let type_matlab.kinds = [ 412 | \ {'short' : 'f', 'long' : 'functions', 'fold' : 0, 'stl' : 1} 413 | \ ] 414 | let types.matlab = type_matlab 415 | " ObjectiveC {{{1 416 | let type_objc = tagbar#prototypes#typeinfo#new() 417 | let type_objc.ctagstype = 'objectivec' 418 | let type_objc.kinds = [ 419 | \ {'short' : 'M', 'long' : 'preprocessor macros', 'fold' : 1, 'stl' : 0}, 420 | \ {'short' : 'v', 'long' : 'global variables', 'fold' : 0, 'stl' : 0}, 421 | \ {'short' : 'i', 'long' : 'class interfaces', 'fold' : 0, 'stl' : 1}, 422 | \ {'short' : 'I', 'long' : 'class implementations', 'fold' : 0, 'stl' : 1}, 423 | \ {'short' : 'c', 'long' : 'class methods', 'fold' : 0, 'stl' : 1}, 424 | \ {'short' : 'F', 'long' : 'object fields', 'fold' : 0, 'stl' : 0}, 425 | \ {'short' : 'm', 'long' : 'object methods', 'fold' : 0, 'stl' : 1}, 426 | \ {'short' : 's', 'long' : 'type structures', 'fold' : 0, 'stl' : 1}, 427 | \ {'short' : 't', 'long' : 'type aliases', 'fold' : 0, 'stl' : 1}, 428 | \ {'short' : 'e', 'long' : 'enumerations', 'fold' : 0, 'stl' : 1}, 429 | \ {'short' : 'f', 'long' : 'functions', 'fold' : 0, 'stl' : 1}, 430 | \ {'short' : 'p', 'long' : 'properties', 'fold' : 0, 'stl' : 0}, 431 | \ ] 432 | let type_objc.sro = ':' 433 | let type_objc.kind2scope = { 434 | \ 'i' : 'interface', 435 | \ 'I' : 'implementation', 436 | \ 's' : 'struct', 437 | \ } 438 | let type_objc.scope2kind = { 439 | \ 'interface' : 'i', 440 | \ 'implementation' : 'I', 441 | \ 'struct' : 's', 442 | \ } 443 | let types.objc = type_objc 444 | let types.objcpp = type_objc 445 | " Ocaml {{{1 446 | let type_ocaml = tagbar#prototypes#typeinfo#new() 447 | let type_ocaml.ctagstype = 'ocaml' 448 | let type_ocaml.kinds = [ 449 | \ {'short' : 'M', 'long' : 'modules or functors', 'fold' : 0, 'stl' : 1}, 450 | \ {'short' : 'v', 'long' : 'global variables', 'fold' : 0, 'stl' : 0}, 451 | \ {'short' : 'c', 'long' : 'classes', 'fold' : 0, 'stl' : 1}, 452 | \ {'short' : 'C', 'long' : 'constructors', 'fold' : 0, 'stl' : 1}, 453 | \ {'short' : 'm', 'long' : 'methods', 'fold' : 0, 'stl' : 1}, 454 | \ {'short' : 'e', 'long' : 'exceptions', 'fold' : 0, 'stl' : 1}, 455 | \ {'short' : 't', 'long' : 'type names', 'fold' : 0, 'stl' : 1}, 456 | \ {'short' : 'f', 'long' : 'functions', 'fold' : 0, 'stl' : 1}, 457 | \ {'short' : 'r', 'long' : 'structure fields', 'fold' : 0, 'stl' : 0} 458 | \ ] 459 | let type_ocaml.sro = '.' " Not sure, is nesting even possible? 460 | let type_ocaml.kind2scope = { 461 | \ 'M' : 'Module', 462 | \ 'c' : 'class', 463 | \ 't' : 'type' 464 | \ } 465 | let type_ocaml.scope2kind = { 466 | \ 'Module' : 'M', 467 | \ 'class' : 'c', 468 | \ 'type' : 't' 469 | \ } 470 | let types.ocaml = type_ocaml 471 | " Pascal {{{1 472 | let type_pascal = tagbar#prototypes#typeinfo#new() 473 | let type_pascal.ctagstype = 'pascal' 474 | let type_pascal.kinds = [ 475 | \ {'short' : 'f', 'long' : 'functions', 'fold' : 0, 'stl' : 1}, 476 | \ {'short' : 'p', 'long' : 'procedures', 'fold' : 0, 'stl' : 1} 477 | \ ] 478 | let types.pascal = type_pascal 479 | " Perl {{{1 480 | let type_perl = tagbar#prototypes#typeinfo#new() 481 | let type_perl.ctagstype = 'perl' 482 | let type_perl.kinds = [ 483 | \ {'short' : 'p', 'long' : 'packages', 'fold' : 1, 'stl' : 0}, 484 | \ {'short' : 'c', 'long' : 'constants', 'fold' : 0, 'stl' : 0}, 485 | \ {'short' : 'f', 'long' : 'formats', 'fold' : 0, 'stl' : 0}, 486 | \ {'short' : 'l', 'long' : 'labels', 'fold' : 0, 'stl' : 1}, 487 | \ {'short' : 's', 'long' : 'subroutines', 'fold' : 0, 'stl' : 1} 488 | \ ] 489 | let types.perl = type_perl 490 | " PHP {{{1 491 | let type_php = tagbar#prototypes#typeinfo#new() 492 | let type_php.ctagstype = 'php' 493 | let type_php.kinds = [ 494 | \ {'short' : 'i', 'long' : 'interfaces', 'fold' : 0, 'stl' : 1}, 495 | \ {'short' : 'c', 'long' : 'classes', 'fold' : 0, 'stl' : 1}, 496 | \ {'short' : 'd', 'long' : 'constant definitions', 'fold' : 0, 'stl' : 0}, 497 | \ {'short' : 'f', 'long' : 'functions', 'fold' : 0, 'stl' : 1}, 498 | \ {'short' : 'v', 'long' : 'variables', 'fold' : 0, 'stl' : 0}, 499 | \ {'short' : 'j', 'long' : 'javascript functions', 'fold' : 0, 'stl' : 1} 500 | \ ] 501 | let types.php = type_php 502 | " Python {{{1 503 | let type_python = tagbar#prototypes#typeinfo#new() 504 | let type_python.ctagstype = 'python' 505 | let type_python.kinds = [ 506 | \ {'short' : 'i', 'long' : 'imports', 'fold' : 1, 'stl' : 0}, 507 | \ {'short' : 'c', 'long' : 'classes', 'fold' : 0, 'stl' : 1}, 508 | \ {'short' : 'f', 'long' : 'functions', 'fold' : 0, 'stl' : 1}, 509 | \ {'short' : 'm', 'long' : 'members', 'fold' : 0, 'stl' : 1}, 510 | \ {'short' : 'v', 'long' : 'variables', 'fold' : 0, 'stl' : 0} 511 | \ ] 512 | let type_python.sro = '.' 513 | let type_python.kind2scope = { 514 | \ 'c' : 'class', 515 | \ 'f' : 'function', 516 | \ 'm' : 'function' 517 | \ } 518 | let type_python.scope2kind = { 519 | \ 'class' : 'c', 520 | \ 'function' : 'f' 521 | \ } 522 | let types.python = type_python 523 | let types.pyrex = type_python 524 | let types.cython = type_python 525 | " REXX {{{1 526 | let type_rexx = tagbar#prototypes#typeinfo#new() 527 | let type_rexx.ctagstype = 'rexx' 528 | let type_rexx.kinds = [ 529 | \ {'short' : 's', 'long' : 'subroutines', 'fold' : 0, 'stl' : 1} 530 | \ ] 531 | let types.rexx = type_rexx 532 | " Ruby {{{1 533 | let type_ruby = tagbar#prototypes#typeinfo#new() 534 | let type_ruby.ctagstype = 'ruby' 535 | let type_ruby.kinds = [ 536 | \ {'short' : 'm', 'long' : 'modules', 'fold' : 0, 'stl' : 1}, 537 | \ {'short' : 'c', 'long' : 'classes', 'fold' : 0, 'stl' : 1}, 538 | \ {'short' : 'f', 'long' : 'methods', 'fold' : 0, 'stl' : 1}, 539 | \ {'short' : 'F', 'long' : 'singleton methods', 'fold' : 0, 'stl' : 1} 540 | \ ] 541 | let type_ruby.sro = '.' 542 | let type_ruby.kind2scope = { 543 | \ 'c' : 'class', 544 | \ 'm' : 'class', 545 | \ 'f' : 'class' 546 | \ } 547 | let type_ruby.scope2kind = { 548 | \ 'class' : 'c' 549 | \ } 550 | let types.ruby = type_ruby 551 | " Scheme {{{1 552 | let type_scheme = tagbar#prototypes#typeinfo#new() 553 | let type_scheme.ctagstype = 'scheme' 554 | let type_scheme.kinds = [ 555 | \ {'short' : 'f', 'long' : 'functions', 'fold' : 0, 'stl' : 1}, 556 | \ {'short' : 's', 'long' : 'sets', 'fold' : 0, 'stl' : 1} 557 | \ ] 558 | let types.scheme = type_scheme 559 | let types.racket = type_scheme 560 | " Shell script {{{1 561 | let type_sh = tagbar#prototypes#typeinfo#new() 562 | let type_sh.ctagstype = 'sh' 563 | let type_sh.kinds = [ 564 | \ {'short' : 'f', 'long' : 'functions', 'fold' : 0, 'stl' : 1} 565 | \ ] 566 | let types.sh = type_sh 567 | let types.csh = type_sh 568 | let types.zsh = type_sh 569 | " SLang {{{1 570 | let type_slang = tagbar#prototypes#typeinfo#new() 571 | let type_slang.ctagstype = 'slang' 572 | let type_slang.kinds = [ 573 | \ {'short' : 'n', 'long' : 'namespaces', 'fold' : 0, 'stl' : 1}, 574 | \ {'short' : 'f', 'long' : 'functions', 'fold' : 0, 'stl' : 1} 575 | \ ] 576 | let types.slang = type_slang 577 | " SML {{{1 578 | let type_sml = tagbar#prototypes#typeinfo#new() 579 | let type_sml.ctagstype = 'sml' 580 | let type_sml.kinds = [ 581 | \ {'short' : 'e', 'long' : 'exception declarations', 'fold' : 0, 'stl' : 0}, 582 | \ {'short' : 'f', 'long' : 'function definitions', 'fold' : 0, 'stl' : 1}, 583 | \ {'short' : 'c', 'long' : 'functor definitions', 'fold' : 0, 'stl' : 1}, 584 | \ {'short' : 's', 'long' : 'signature declarations', 'fold' : 0, 'stl' : 0}, 585 | \ {'short' : 'r', 'long' : 'structure declarations', 'fold' : 0, 'stl' : 0}, 586 | \ {'short' : 't', 'long' : 'type definitions', 'fold' : 0, 'stl' : 1}, 587 | \ {'short' : 'v', 'long' : 'value bindings', 'fold' : 0, 'stl' : 0} 588 | \ ] 589 | let types.sml = type_sml 590 | " SQL {{{1 591 | " The SQL ctags parser seems to be buggy for me, so this just uses the 592 | " normal kinds even though scopes should be available. Improvements 593 | " welcome! 594 | let type_sql = tagbar#prototypes#typeinfo#new() 595 | let type_sql.ctagstype = 'sql' 596 | let type_sql.kinds = [ 597 | \ {'short' : 'P', 'long' : 'packages', 'fold' : 1, 'stl' : 1}, 598 | \ {'short' : 'd', 'long' : 'prototypes', 'fold' : 0, 'stl' : 1}, 599 | \ {'short' : 'c', 'long' : 'cursors', 'fold' : 0, 'stl' : 1}, 600 | \ {'short' : 'f', 'long' : 'functions', 'fold' : 0, 'stl' : 1}, 601 | \ {'short' : 'F', 'long' : 'record fields', 'fold' : 0, 'stl' : 1}, 602 | \ {'short' : 'L', 'long' : 'block label', 'fold' : 0, 'stl' : 1}, 603 | \ {'short' : 'p', 'long' : 'procedures', 'fold' : 0, 'stl' : 1}, 604 | \ {'short' : 's', 'long' : 'subtypes', 'fold' : 0, 'stl' : 1}, 605 | \ {'short' : 't', 'long' : 'tables', 'fold' : 0, 'stl' : 1}, 606 | \ {'short' : 'T', 'long' : 'triggers', 'fold' : 0, 'stl' : 1}, 607 | \ {'short' : 'v', 'long' : 'variables', 'fold' : 0, 'stl' : 1}, 608 | \ {'short' : 'i', 'long' : 'indexes', 'fold' : 0, 'stl' : 1}, 609 | \ {'short' : 'e', 'long' : 'events', 'fold' : 0, 'stl' : 1}, 610 | \ {'short' : 'U', 'long' : 'publications', 'fold' : 0, 'stl' : 1}, 611 | \ {'short' : 'R', 'long' : 'services', 'fold' : 0, 'stl' : 1}, 612 | \ {'short' : 'D', 'long' : 'domains', 'fold' : 0, 'stl' : 1}, 613 | \ {'short' : 'V', 'long' : 'views', 'fold' : 0, 'stl' : 1}, 614 | \ {'short' : 'n', 'long' : 'synonyms', 'fold' : 0, 'stl' : 1}, 615 | \ {'short' : 'x', 'long' : 'MobiLink Table Scripts', 'fold' : 0, 'stl' : 1}, 616 | \ {'short' : 'y', 'long' : 'MobiLink Conn Scripts', 'fold' : 0, 'stl' : 1}, 617 | \ {'short' : 'z', 'long' : 'MobiLink Properties', 'fold' : 0, 'stl' : 1} 618 | \ ] 619 | let types.sql = type_sql 620 | " Tcl {{{1 621 | let type_tcl = tagbar#prototypes#typeinfo#new() 622 | let type_tcl.ctagstype = 'tcl' 623 | let type_tcl.kinds = [ 624 | \ {'short' : 'c', 'long' : 'classes', 'fold' : 0, 'stl' : 1}, 625 | \ {'short' : 'm', 'long' : 'methods', 'fold' : 0, 'stl' : 1}, 626 | \ {'short' : 'p', 'long' : 'procedures', 'fold' : 0, 'stl' : 1} 627 | \ ] 628 | let types.tcl = type_tcl 629 | " LaTeX {{{1 630 | let type_tex = tagbar#prototypes#typeinfo#new() 631 | let type_tex.ctagstype = 'tex' 632 | let type_tex.kinds = [ 633 | \ {'short' : 'i', 'long' : 'includes', 'fold' : 1, 'stl' : 0}, 634 | \ {'short' : 'p', 'long' : 'parts', 'fold' : 0, 'stl' : 1}, 635 | \ {'short' : 'c', 'long' : 'chapters', 'fold' : 0, 'stl' : 1}, 636 | \ {'short' : 's', 'long' : 'sections', 'fold' : 0, 'stl' : 1}, 637 | \ {'short' : 'u', 'long' : 'subsections', 'fold' : 0, 'stl' : 1}, 638 | \ {'short' : 'b', 'long' : 'subsubsections', 'fold' : 0, 'stl' : 1}, 639 | \ {'short' : 'P', 'long' : 'paragraphs', 'fold' : 0, 'stl' : 0}, 640 | \ {'short' : 'G', 'long' : 'subparagraphs', 'fold' : 0, 'stl' : 0}, 641 | \ {'short' : 'l', 'long' : 'labels', 'fold' : 0, 'stl' : 0} 642 | \ ] 643 | let type_tex.sro = '""' 644 | let type_tex.kind2scope = { 645 | \ 'p' : 'part', 646 | \ 'c' : 'chapter', 647 | \ 's' : 'section', 648 | \ 'u' : 'subsection', 649 | \ 'b' : 'subsubsection' 650 | \ } 651 | let type_tex.scope2kind = { 652 | \ 'part' : 'p', 653 | \ 'chapter' : 'c', 654 | \ 'section' : 's', 655 | \ 'subsection' : 'u', 656 | \ 'subsubsection' : 'b' 657 | \ } 658 | let type_tex.sort = 0 659 | let types.tex = type_tex 660 | " Vala {{{1 661 | " Vala is supported by the ctags fork provided by Anjuta, so only add the 662 | " type if the fork is used to prevent error messages otherwise 663 | if has_key(a:supported_types, 'vala') || executable('anjuta-tags') 664 | let type_vala = tagbar#prototypes#typeinfo#new() 665 | let type_vala.ctagstype = 'vala' 666 | let type_vala.kinds = [ 667 | \ {'short' : 'e', 'long' : 'Enumerations', 'fold' : 0, 'stl' : 1}, 668 | \ {'short' : 'v', 'long' : 'Enumeration values', 'fold' : 0, 'stl' : 0}, 669 | \ {'short' : 's', 'long' : 'Structures', 'fold' : 0, 'stl' : 1}, 670 | \ {'short' : 'i', 'long' : 'Interfaces', 'fold' : 0, 'stl' : 1}, 671 | \ {'short' : 'd', 'long' : 'Delegates', 'fold' : 0, 'stl' : 1}, 672 | \ {'short' : 'c', 'long' : 'Classes', 'fold' : 0, 'stl' : 1}, 673 | \ {'short' : 'p', 'long' : 'Properties', 'fold' : 0, 'stl' : 0}, 674 | \ {'short' : 'f', 'long' : 'Fields', 'fold' : 0, 'stl' : 0}, 675 | \ {'short' : 'm', 'long' : 'Methods', 'fold' : 0, 'stl' : 1}, 676 | \ {'short' : 'E', 'long' : 'Error domains', 'fold' : 0, 'stl' : 1}, 677 | \ {'short' : 'r', 'long' : 'Error codes', 'fold' : 0, 'stl' : 1}, 678 | \ {'short' : 'S', 'long' : 'Signals', 'fold' : 0, 'stl' : 1} 679 | \ ] 680 | let type_vala.sro = '.' 681 | " 'enum' doesn't seem to be used as a scope, but it can't hurt to have 682 | " it here 683 | let type_vala.kind2scope = { 684 | \ 's' : 'struct', 685 | \ 'i' : 'interface', 686 | \ 'c' : 'class', 687 | \ 'e' : 'enum' 688 | \ } 689 | let type_vala.scope2kind = { 690 | \ 'struct' : 's', 691 | \ 'interface' : 'i', 692 | \ 'class' : 'c', 693 | \ 'enum' : 'e' 694 | \ } 695 | let types.vala = type_vala 696 | endif 697 | if !has_key(a:supported_types, 'vala') && executable('anjuta-tags') 698 | let types.vala.ctagsbin = 'anjuta-tags' 699 | endif 700 | " Vera {{{1 701 | " Why are variables 'virtual'? 702 | let type_vera = tagbar#prototypes#typeinfo#new() 703 | let type_vera.ctagstype = 'vera' 704 | let type_vera.kinds = [ 705 | \ {'short' : 'd', 'long' : 'macros', 'fold' : 1, 'stl' : 0}, 706 | \ {'short' : 'g', 'long' : 'enums', 'fold' : 0, 'stl' : 1}, 707 | \ {'short' : 'T', 'long' : 'typedefs', 'fold' : 0, 'stl' : 0}, 708 | \ {'short' : 'c', 'long' : 'classes', 'fold' : 0, 'stl' : 1}, 709 | \ {'short' : 'e', 'long' : 'enumerators', 'fold' : 0, 'stl' : 0}, 710 | \ {'short' : 'm', 'long' : 'members', 'fold' : 0, 'stl' : 1}, 711 | \ {'short' : 'f', 'long' : 'functions', 'fold' : 0, 'stl' : 1}, 712 | \ {'short' : 't', 'long' : 'tasks', 'fold' : 0, 'stl' : 1}, 713 | \ {'short' : 'v', 'long' : 'variables', 'fold' : 0, 'stl' : 0}, 714 | \ {'short' : 'p', 'long' : 'programs', 'fold' : 0, 'stl' : 1} 715 | \ ] 716 | let type_vera.sro = '.' " Nesting doesn't seem to be possible 717 | let type_vera.kind2scope = { 718 | \ 'g' : 'enum', 719 | \ 'c' : 'class', 720 | \ 'v' : 'virtual' 721 | \ } 722 | let type_vera.scope2kind = { 723 | \ 'enum' : 'g', 724 | \ 'class' : 'c', 725 | \ 'virtual' : 'v' 726 | \ } 727 | let types.vera = type_vera 728 | " Verilog {{{1 729 | let type_verilog = tagbar#prototypes#typeinfo#new() 730 | let type_verilog.ctagstype = 'verilog' 731 | let type_verilog.kinds = [ 732 | \ {'short' : 'c', 'long' : 'constants', 'fold' : 0, 'stl' : 0}, 733 | \ {'short' : 'e', 'long' : 'events', 'fold' : 0, 'stl' : 1}, 734 | \ {'short' : 'f', 'long' : 'functions', 'fold' : 0, 'stl' : 1}, 735 | \ {'short' : 'm', 'long' : 'modules', 'fold' : 0, 'stl' : 1}, 736 | \ {'short' : 'n', 'long' : 'net data types', 'fold' : 0, 'stl' : 1}, 737 | \ {'short' : 'p', 'long' : 'ports', 'fold' : 0, 'stl' : 1}, 738 | \ {'short' : 'r', 'long' : 'register data types', 'fold' : 0, 'stl' : 1}, 739 | \ {'short' : 't', 'long' : 'tasks', 'fold' : 0, 'stl' : 1} 740 | \ ] 741 | let types.verilog = type_verilog 742 | " VHDL {{{1 743 | " The VHDL ctags parser unfortunately doesn't generate proper scopes 744 | let type_vhdl = tagbar#prototypes#typeinfo#new() 745 | let type_vhdl.ctagstype = 'vhdl' 746 | let type_vhdl.kinds = [ 747 | \ {'short' : 'P', 'long' : 'packages', 'fold' : 1, 'stl' : 0}, 748 | \ {'short' : 'c', 'long' : 'constants', 'fold' : 0, 'stl' : 0}, 749 | \ {'short' : 't', 'long' : 'types', 'fold' : 0, 'stl' : 1}, 750 | \ {'short' : 'T', 'long' : 'subtypes', 'fold' : 0, 'stl' : 1}, 751 | \ {'short' : 'r', 'long' : 'records', 'fold' : 0, 'stl' : 1}, 752 | \ {'short' : 'e', 'long' : 'entities', 'fold' : 0, 'stl' : 1}, 753 | \ {'short' : 'f', 'long' : 'functions', 'fold' : 0, 'stl' : 1}, 754 | \ {'short' : 'p', 'long' : 'procedures', 'fold' : 0, 'stl' : 1} 755 | \ ] 756 | let types.vhdl = type_vhdl 757 | " Vim {{{1 758 | let type_vim = tagbar#prototypes#typeinfo#new() 759 | let type_vim.ctagstype = 'vim' 760 | let type_vim.kinds = [ 761 | \ {'short' : 'n', 'long' : 'vimball filenames', 'fold' : 0, 'stl' : 1}, 762 | \ {'short' : 'v', 'long' : 'variables', 'fold' : 1, 'stl' : 0}, 763 | \ {'short' : 'f', 'long' : 'functions', 'fold' : 0, 'stl' : 1}, 764 | \ {'short' : 'a', 'long' : 'autocommand groups', 'fold' : 1, 'stl' : 1}, 765 | \ {'short' : 'c', 'long' : 'commands', 'fold' : 0, 'stl' : 0}, 766 | \ {'short' : 'm', 'long' : 'maps', 'fold' : 1, 'stl' : 0} 767 | \ ] 768 | let types.vim = type_vim 769 | " YACC {{{1 770 | let type_yacc = tagbar#prototypes#typeinfo#new() 771 | let type_yacc.ctagstype = 'yacc' 772 | let type_yacc.kinds = [ 773 | \ {'short' : 'l', 'long' : 'labels', 'fold' : 0, 'stl' : 1} 774 | \ ] 775 | let types.yacc = type_yacc 776 | " }}}1 777 | 778 | for [type, typeinfo] in items(types) 779 | let typeinfo.ftype = type 780 | endfor 781 | 782 | for typeinfo in values(types) 783 | call typeinfo.createKinddict() 784 | endfor 785 | 786 | return types 787 | endfunction 788 | 789 | " vim: ts=8 sw=4 sts=4 et foldenable foldmethod=marker foldcolumn=1 790 | -------------------------------------------------------------------------------- /autoload/tagbar/types/uctags.vim: -------------------------------------------------------------------------------- 1 | " Type definitions for Universal Ctags 2 | 3 | function! tagbar#types#uctags#init(supported_types) abort 4 | let types = {} 5 | 6 | " Ada {{{1 7 | let type_ada = tagbar#prototypes#typeinfo#new() 8 | let type_ada.ctagstype = 'ada' 9 | let type_ada.kinds = [ 10 | \ {'short' : 'P', 'long' : 'package specifications', 'fold' : 0, 'stl' : 1}, 11 | \ {'short' : 'p', 'long' : 'packages', 'fold' : 0, 'stl' : 0}, 12 | \ {'short' : 't', 'long' : 'types', 'fold' : 0, 'stl' : 1}, 13 | \ {'short' : 'u', 'long' : 'subtypes', 'fold' : 0, 'stl' : 1}, 14 | \ {'short' : 'c', 'long' : 'record type components', 'fold' : 0, 'stl' : 1}, 15 | \ {'short' : 'l', 'long' : 'enum type literals', 'fold' : 0, 'stl' : 0}, 16 | \ {'short' : 'v', 'long' : 'variables', 'fold' : 0, 'stl' : 0}, 17 | \ {'short' : 'f', 'long' : 'generic formal parameters', 'fold' : 0, 'stl' : 0}, 18 | \ {'short' : 'n', 'long' : 'constants', 'fold' : 0, 'stl' : 0}, 19 | \ {'short' : 'x', 'long' : 'user defined exceptions', 'fold' : 0, 'stl' : 1}, 20 | \ {'short' : 'R', 'long' : 'subprogram specifications', 'fold' : 0, 'stl' : 1}, 21 | \ {'short' : 'r', 'long' : 'subprograms', 'fold' : 0, 'stl' : 1}, 22 | \ {'short' : 'K', 'long' : 'task specifications', 'fold' : 0, 'stl' : 1}, 23 | \ {'short' : 'k', 'long' : 'tasks', 'fold' : 0, 'stl' : 1}, 24 | \ {'short' : 'O', 'long' : 'protected data specifications', 'fold' : 0, 'stl' : 1}, 25 | \ {'short' : 'o', 'long' : 'protected data', 'fold' : 0, 'stl' : 1}, 26 | \ {'short' : 'e', 'long' : 'task/protected data entries', 'fold' : 0, 'stl' : 1}, 27 | \ {'short' : 'b', 'long' : 'labels', 'fold' : 0, 'stl' : 1}, 28 | \ {'short' : 'i', 'long' : 'loop/declare identifiers', 'fold' : 0, 'stl' : 1}, 29 | \ ] 30 | let type_ada.sro = '.' " Not sure if possible 31 | let type_ada.kind2scope = { 32 | \ 'P' : 'packspec', 33 | \ 't' : 'type', 34 | \ } 35 | let type_ada.scope2kind = { 36 | \ 'packspec' : 'P', 37 | \ 'type' : 't', 38 | \ } 39 | let types.ada = type_ada 40 | " Ant {{{1 41 | let type_ant = tagbar#prototypes#typeinfo#new() 42 | let type_ant.ctagstype = 'ant' 43 | let type_ant.kinds = [ 44 | \ {'short' : 'p', 'long' : 'projects', 'fold' : 0, 'stl' : 1}, 45 | \ {'short' : 'i', 'long' : 'antfiles', 'fold' : 0, 'stl' : 0}, 46 | \ {'short' : 'P', 'long' : 'properties', 'fold' : 0, 'stl' : 0}, 47 | \ {'short' : 't', 'long' : 'targets', 'fold' : 0, 'stl' : 1} 48 | \ ] 49 | let types.ant = type_ant 50 | " Asciidoc {{{1 51 | let type_asciidoc = tagbar#prototypes#typeinfo#new() 52 | let type_asciidoc.ctagstype = 'asciidoc' 53 | let type_asciidoc.kinds = [ 54 | \ {'short' : 'c', 'long' : 'chapter', 'fold' : 0, 'stl' : 1}, 55 | \ {'short' : 's', 'long' : 'section', 'fold' : 0, 'stl' : 1}, 56 | \ {'short' : 'S', 'long' : 'subsection', 'fold' : 0, 'stl' : 1}, 57 | \ {'short' : 't', 'long' : 'subsubsection', 'fold' : 0, 'stl' : 1}, 58 | \ {'short' : 'T', 'long' : 'paragraph', 'fold' : 0, 'stl' : 1}, 59 | \ {'short' : 'u', 'long' : 'subparagraph', 'fold' : 0, 'stl' : 1}, 60 | \ {'short' : 'a', 'long' : 'anchor', 'fold' : 0, 'stl' : 0} 61 | \ ] 62 | let type_asciidoc.sro = '""' 63 | let type_asciidoc.kind2scope = { 64 | \ 'c' : 'chapter', 65 | \ 's' : 'section', 66 | \ 'S' : 'subsection', 67 | \ 't' : 'subsubsection', 68 | \ 'T' : 'l4subsection', 69 | \ 'u' : 'l5subsection' 70 | \ } 71 | let type_asciidoc.scope2kind = { 72 | \ 'chapter' : 'c', 73 | \ 'section' : 's', 74 | \ 'subsection' : 'S', 75 | \ 'subsubsection' : 't', 76 | \ 'l4subsection' : 'T', 77 | \ 'l5subsection' : 'u' 78 | \ } 79 | let type_asciidoc.sort = 0 80 | let types.asciidoc = type_asciidoc 81 | " Asm {{{1 82 | let type_asm = tagbar#prototypes#typeinfo#new() 83 | let type_asm.ctagstype = 'asm' 84 | let type_asm.kinds = [ 85 | \ {'short' : 'm', 'long' : 'macros', 'fold' : 0, 'stl' : 1}, 86 | \ {'short' : 't', 'long' : 'types', 'fold' : 0, 'stl' : 1}, 87 | \ {'short' : 's', 'long' : 'sections', 'fold' : 0, 'stl' : 1}, 88 | \ {'short' : 'd', 'long' : 'defines', 'fold' : 0, 'stl' : 1}, 89 | \ {'short' : 'l', 'long' : 'labels', 'fold' : 0, 'stl' : 1} 90 | \ ] 91 | let types.asm = type_asm 92 | " ASP {{{1 93 | let type_aspvbs = tagbar#prototypes#typeinfo#new() 94 | let type_aspvbs.ctagstype = 'asp' 95 | let type_aspvbs.kinds = [ 96 | \ {'short' : 'd', 'long' : 'constants', 'fold' : 0, 'stl' : 1}, 97 | \ {'short' : 'c', 'long' : 'classes', 'fold' : 0, 'stl' : 1}, 98 | \ {'short' : 'f', 'long' : 'functions', 'fold' : 0, 'stl' : 1}, 99 | \ {'short' : 's', 'long' : 'subroutines', 'fold' : 0, 'stl' : 1}, 100 | \ {'short' : 'v', 'long' : 'variables', 'fold' : 0, 'stl' : 1} 101 | \ ] 102 | let types.aspvbs = type_aspvbs 103 | " Asymptote {{{1 104 | " Asymptote gets parsed well using filetype = c 105 | let type_asy = tagbar#prototypes#typeinfo#new() 106 | let type_asy.ctagstype = 'c' 107 | let type_asy.kinds = [ 108 | \ {'short' : 'd', 'long' : 'macros', 'fold' : 1, 'stl' : 0}, 109 | \ {'short' : 'p', 'long' : 'prototypes', 'fold' : 1, 'stl' : 0}, 110 | \ {'short' : 'g', 'long' : 'enums', 'fold' : 0, 'stl' : 1}, 111 | \ {'short' : 'e', 'long' : 'enumerators', 'fold' : 0, 'stl' : 0}, 112 | \ {'short' : 't', 'long' : 'typedefs', 'fold' : 0, 'stl' : 0}, 113 | \ {'short' : 's', 'long' : 'structs', 'fold' : 0, 'stl' : 1}, 114 | \ {'short' : 'u', 'long' : 'unions', 'fold' : 0, 'stl' : 1}, 115 | \ {'short' : 'm', 'long' : 'members', 'fold' : 0, 'stl' : 0}, 116 | \ {'short' : 'v', 'long' : 'variables', 'fold' : 0, 'stl' : 0}, 117 | \ {'short' : 'f', 'long' : 'functions', 'fold' : 0, 'stl' : 1} 118 | \ ] 119 | let type_asy.sro = '::' 120 | let type_asy.kind2scope = { 121 | \ 'g' : 'enum', 122 | \ 's' : 'struct', 123 | \ 'u' : 'union' 124 | \ } 125 | let type_asy.scope2kind = { 126 | \ 'enum' : 'g', 127 | \ 'struct' : 's', 128 | \ 'union' : 'u' 129 | \ } 130 | let types.asy = type_asy 131 | " Autoconf {{{1 132 | let type_autoconf = tagbar#prototypes#typeinfo#new() 133 | let type_autoconf.ctagstype = 'autoconf' 134 | let type_autoconf.kinds = [ 135 | \ {'short': 'p', 'long': 'packages', 'fold': 0, 'stl': 1}, 136 | \ {'short': 't', 'long': 'templates', 'fold': 0, 'stl': 1}, 137 | \ {'short': 'm', 'long': 'autoconf macros', 'fold': 0, 'stl': 1}, 138 | \ {'short': 'w', 'long': '"with" options', 'fold': 0, 'stl': 1}, 139 | \ {'short': 'e', 'long': '"enable" options', 'fold': 0, 'stl': 1}, 140 | \ {'short': 's', 'long': 'substitution keys', 'fold': 0, 'stl': 1}, 141 | \ {'short': 'c', 'long': 'automake conditions', 'fold': 0, 'stl': 1}, 142 | \ {'short': 'd', 'long': 'definitions', 'fold': 0, 'stl': 1}, 143 | \ ] 144 | let types.config = type_autoconf 145 | " Automake {{{1 146 | let type_automake = tagbar#prototypes#typeinfo#new() 147 | let type_automake.ctagstype = 'automake' 148 | let type_automake.kinds = [ 149 | \ {'short' : 'I', 'long' : 'makefiles', 'fold' : 0, 'stl' : 1}, 150 | \ {'short' : 'd', 'long' : 'directories', 'fold' : 0, 'stl' : 1}, 151 | \ {'short' : 'P', 'long' : 'programs', 'fold' : 0, 'stl' : 1}, 152 | \ {'short' : 'M', 'long' : 'manuals', 'fold' : 0, 'stl' : 1}, 153 | \ {'short' : 'm', 'long' : 'macros', 'fold' : 0, 'stl' : 1}, 154 | \ {'short' : 't', 'long' : 'targets', 'fold' : 0, 'stl' : 1}, 155 | \ {'short' : 'T', 'long' : 'ltlibraries', 'fold' : 0, 'stl' : 1}, 156 | \ {'short' : 'L', 'long' : 'libraries', 'fold' : 0, 'stl' : 1}, 157 | \ {'short' : 'S', 'long' : 'scripts', 'fold' : 0, 'stl' : 1}, 158 | \ {'short' : 'D', 'long' : 'datum', 'fold' : 0, 'stl' : 1}, 159 | \ {'short' : 'c', 'long' : 'conditions', 'fold' : 0, 'stl' : 1}, 160 | \ ] 161 | let types.automake = type_automake 162 | " Awk {{{1 163 | let type_awk = tagbar#prototypes#typeinfo#new() 164 | let type_awk.ctagstype = 'awk' 165 | let type_awk.kinds = [ 166 | \ {'short' : 'f', 'long' : 'functions', 'fold' : 0, 'stl' : 1} 167 | \ ] 168 | let types.awk = type_awk 169 | " Basic {{{1 170 | let type_basic = tagbar#prototypes#typeinfo#new() 171 | let type_basic.ctagstype = 'basic' 172 | let type_basic.kinds = [ 173 | \ {'short' : 'c', 'long' : 'constants', 'fold' : 0, 'stl' : 1}, 174 | \ {'short' : 'g', 'long' : 'enumerations', 'fold' : 0, 'stl' : 1}, 175 | \ {'short' : 'f', 'long' : 'functions', 'fold' : 0, 'stl' : 1}, 176 | \ {'short' : 'l', 'long' : 'labels', 'fold' : 0, 'stl' : 1}, 177 | \ {'short' : 't', 'long' : 'types', 'fold' : 0, 'stl' : 1}, 178 | \ {'short' : 'v', 'long' : 'variables', 'fold' : 0, 'stl' : 1} 179 | \ ] 180 | let types.basic = type_basic 181 | " BETA {{{1 182 | let type_beta = tagbar#prototypes#typeinfo#new() 183 | let type_beta.ctagstype = 'beta' 184 | let type_beta.kinds = [ 185 | \ {'short' : 'f', 'long' : 'fragments', 'fold' : 0, 'stl' : 1}, 186 | \ {'short' : 's', 'long' : 'slots', 'fold' : 0, 'stl' : 1}, 187 | \ {'short' : 'v', 'long' : 'patterns', 'fold' : 0, 'stl' : 1} 188 | \ ] 189 | let types.beta = type_beta 190 | " BibTeX {{{1 191 | let type_bibtex = tagbar#prototypes#typeinfo#new() 192 | let type_bibtex.ctagstype = 'bibtex' 193 | let type_bibtex.kinds = [ 194 | \ {'short' : 'a', 'long' : 'article', 'fold' : 0, 'stl' : 0}, 195 | \ {'short' : 'b', 'long' : 'book', 'fold' : 0, 'stl' : 0}, 196 | \ {'short' : 'B', 'long' : 'booklet', 'fold' : 0, 'stl' : 0}, 197 | \ {'short' : 'c', 'long' : 'conference', 'fold' : 0, 'stl' : 0}, 198 | \ {'short' : 'i', 'long' : 'inbook', 'fold' : 0, 'stl' : 0}, 199 | \ {'short' : 'I', 'long' : 'incollection', 'fold' : 0, 'stl' : 0}, 200 | \ {'short' : 'j', 'long' : 'inproceedings', 'fold' : 0, 'stl' : 0}, 201 | \ {'short' : 'm', 'long' : 'manual', 'fold' : 0, 'stl' : 0}, 202 | \ {'short' : 'M', 'long' : 'mastersthesis', 'fold' : 0, 'stl' : 0}, 203 | \ {'short' : 'n', 'long' : 'misc', 'fold' : 0, 'stl' : 0}, 204 | \ {'short' : 'p', 'long' : 'phdthesis', 'fold' : 0, 'stl' : 0}, 205 | \ {'short' : 'P', 'long' : 'proceedings', 'fold' : 0, 'stl' : 0}, 206 | \ {'short' : 's', 'long' : 'string', 'fold' : 0, 'stl' : 0}, 207 | \ {'short' : 't', 'long' : 'techreport', 'fold' : 0, 'stl' : 0}, 208 | \ {'short' : 'u', 'long' : 'unpublished', 'fold' : 0, 'stl' : 0}, 209 | \ {'short' : 'A', 'long' : 'artworks', 'fold' : 0, 'stl' : 0}, 210 | \ {'short' : 'C', 'long' : 'bibnotes', 'fold' : 0, 'stl' : 0}, 211 | \ {'short' : 'D', 'long' : 'bookinbooks', 'fold' : 0, 'stl' : 0}, 212 | \ {'short' : 'E', 'long' : 'Booklets', 'fold' : 0, 'stl' : 0}, 213 | \ {'short' : 'G', 'long' : 'collections', 'fold' : 0, 'stl' : 0}, 214 | \ {'short' : 'H', 'long' : 'commentarys', 'fold' : 0, 'stl' : 0}, 215 | \ {'short' : 'J', 'long' : 'images', 'fold' : 0, 'stl' : 0}, 216 | \ {'short' : 'K', 'long' : 'interferences', 'fold' : 0, 'stl' : 0}, 217 | \ {'short' : 'L', 'long' : 'jurisdictions', 'fold' : 0, 'stl' : 0}, 218 | \ {'short' : 'N', 'long' : 'legals', 'fold' : 0, 'stl' : 0}, 219 | \ {'short' : 'O', 'long' : 'letters', 'fold' : 0, 'stl' : 0}, 220 | \ {'short' : 'Q', 'long' : 'musics', 'fold' : 0, 'stl' : 0}, 221 | \ {'short' : 'R', 'long' : 'mvbooks', 'fold' : 0, 'stl' : 0}, 222 | \ {'short' : 'S', 'long' : 'mvcollections', 'fold' : 0, 'stl' : 0}, 223 | \ {'short' : 'T', 'long' : 'mvproceedings', 'fold' : 0, 'stl' : 0}, 224 | \ {'short' : 'U', 'long' : 'mvreferences', 'fold' : 0, 'stl' : 0}, 225 | \ {'short' : 'V', 'long' : 'onlines', 'fold' : 0, 'stl' : 0}, 226 | \ {'short' : 'W', 'long' : 'patents', 'fold' : 0, 'stl' : 0}, 227 | \ {'short' : 'g', 'long' : 'performances', 'fold' : 0, 'stl' : 0}, 228 | \ {'short' : 'h', 'long' : 'periodicals', 'fold' : 0, 'stl' : 0}, 229 | \ {'short' : 'k', 'long' : 'reviews', 'fold' : 0, 'stl' : 0}, 230 | \ {'short' : 'l', 'long' : 'sets', 'fold' : 0, 'stl' : 0}, 231 | \ {'short' : 'o', 'long' : 'suppbooks', 'fold' : 0, 'stl' : 0}, 232 | \ {'short' : 'q', 'long' : 'suppperiodicals', 'fold' : 0, 'stl' : 0}, 233 | \ {'short' : 'r', 'long' : 'thesis', 'fold' : 0, 'stl' : 0}, 234 | \ ] 235 | let types.bibtex = type_bibtex 236 | let types.bib = type_bibtex 237 | " BibLaTex {{{1 238 | let type_biblatex = tagbar#prototypes#typeinfo#new() 239 | let type_biblatex.ctagstype = 'biblatex' 240 | let type_biblatex.kinds = [ 241 | \ {'short' : 'A', 'long' : 'artworks', 'fold' : 0, 'stl' : 0}, 242 | \ {'short' : 'B', 'long' : 'audios', 'fold' : 0, 'stl' : 0}, 243 | \ {'short' : 'C', 'long' : 'bibnotes', 'fold' : 0, 'stl' : 0}, 244 | \ {'short' : 'D', 'long' : 'bookinbooks', 'fold' : 0, 'stl' : 0}, 245 | \ {'short' : 'E', 'long' : 'Booklets', 'fold' : 0, 'stl' : 0}, 246 | \ {'short' : 'G', 'long' : 'collections', 'fold' : 0, 'stl' : 0}, 247 | \ {'short' : 'H', 'long' : 'commentarys', 'fold' : 0, 'stl' : 0}, 248 | \ {'short' : 'I', 'long' : 'datasets', 'fold' : 0, 'stl' : 0}, 249 | \ {'short' : 'J', 'long' : 'images', 'fold' : 0, 'stl' : 0}, 250 | \ {'short' : 'K', 'long' : 'interferences', 'fold' : 0, 'stl' : 0}, 251 | \ {'short' : 'L', 'long' : 'jurisdictions', 'fold' : 0, 'stl' : 0}, 252 | \ {'short' : 'M', 'long' : 'legislations', 'fold' : 0, 'stl' : 0}, 253 | \ {'short' : 'N', 'long' : 'legals', 'fold' : 0, 'stl' : 0}, 254 | \ {'short' : 'O', 'long' : 'letters', 'fold' : 0, 'stl' : 0}, 255 | \ {'short' : 'P', 'long' : 'movies', 'fold' : 0, 'stl' : 0}, 256 | \ {'short' : 'Q', 'long' : 'musics', 'fold' : 0, 'stl' : 0}, 257 | \ {'short' : 'R', 'long' : 'mvbooks', 'fold' : 0, 'stl' : 0}, 258 | \ {'short' : 'S', 'long' : 'mvcollections', 'fold' : 0, 'stl' : 0}, 259 | \ {'short' : 'T', 'long' : 'mvproceedings', 'fold' : 0, 'stl' : 0}, 260 | \ {'short' : 'U', 'long' : 'mvreferences', 'fold' : 0, 'stl' : 0}, 261 | \ {'short' : 'V', 'long' : 'onlines', 'fold' : 0, 'stl' : 0}, 262 | \ {'short' : 'W', 'long' : 'patents', 'fold' : 0, 'stl' : 0}, 263 | \ {'short' : 'g', 'long' : 'performances', 'fold' : 0, 'stl' : 0}, 264 | \ {'short' : 'h', 'long' : 'periodicals', 'fold' : 0, 'stl' : 0}, 265 | \ {'short' : 'i', 'long' : 'references', 'fold' : 0, 'stl' : 0}, 266 | \ {'short' : 'j', 'long' : 'reports', 'fold' : 0, 'stl' : 0}, 267 | \ {'short' : 'k', 'long' : 'reviews', 'fold' : 0, 'stl' : 0}, 268 | \ {'short' : 'l', 'long' : 'sets', 'fold' : 0, 'stl' : 0}, 269 | \ {'short' : 'm', 'long' : 'software', 'fold' : 0, 'stl' : 0}, 270 | \ {'short' : 'n', 'long' : 'standards', 'fold' : 0, 'stl' : 0}, 271 | \ {'short' : 'o', 'long' : 'suppbooks', 'fold' : 0, 'stl' : 0}, 272 | \ {'short' : 'p', 'long' : 'suppcollections', 'fold' : 0, 'stl' : 0}, 273 | \ {'short' : 'q', 'long' : 'suppperiodicals', 'fold' : 0, 'stl' : 0}, 274 | \ {'short' : 'r', 'long' : 'thesis', 'fold' : 0, 'stl' : 0}, 275 | \ {'short' : 's', 'long' : 'videos', 'fold' : 0, 'stl' : 0}, 276 | \ {'short' : 't', 'long' : 'xdatas', 'fold' : 0, 'stl' : 0}, 277 | \ ] 278 | let types.biblatex = type_biblatex 279 | " C {{{1 280 | let type_c = tagbar#prototypes#typeinfo#new() 281 | let type_c.ctagstype = 'c' 282 | let type_c.kinds = [ 283 | \ {'short' : 'h', 'long' : 'header files', 'fold' : 1, 'stl' : 0}, 284 | \ {'short' : 'd', 'long' : 'macros', 'fold' : 1, 'stl' : 0}, 285 | \ {'short' : 'p', 'long' : 'prototypes', 'fold' : 1, 'stl' : 0}, 286 | \ {'short' : 'g', 'long' : 'enums', 'fold' : 0, 'stl' : 1}, 287 | \ {'short' : 'e', 'long' : 'enumerators', 'fold' : 0, 'stl' : 0}, 288 | \ {'short' : 't', 'long' : 'typedefs', 'fold' : 0, 'stl' : 0}, 289 | \ {'short' : 's', 'long' : 'structs', 'fold' : 0, 'stl' : 1}, 290 | \ {'short' : 'u', 'long' : 'unions', 'fold' : 0, 'stl' : 1}, 291 | \ {'short' : 'm', 'long' : 'members', 'fold' : 0, 'stl' : 0}, 292 | \ {'short' : 'v', 'long' : 'variables', 'fold' : 0, 'stl' : 0}, 293 | \ {'short' : 'f', 'long' : 'functions', 'fold' : 0, 'stl' : 1} 294 | \ ] 295 | let type_c.sro = '::' 296 | let type_c.kind2scope = { 297 | \ 'g' : 'enum', 298 | \ 's' : 'struct', 299 | \ 'u' : 'union' 300 | \ } 301 | let type_c.scope2kind = { 302 | \ 'enum' : 'g', 303 | \ 'struct' : 's', 304 | \ 'union' : 'u' 305 | \ } 306 | let types.c = type_c 307 | let types.lpc = type_c 308 | " C++ {{{1 309 | let type_cpp = tagbar#prototypes#typeinfo#new() 310 | let type_cpp.ctagstype = 'c++' 311 | let type_cpp.kinds = [ 312 | \ {'short' : 'h', 'long' : 'header files', 'fold' : 1, 'stl' : 0}, 313 | \ {'short' : 'd', 'long' : 'macros', 'fold' : 1, 'stl' : 0}, 314 | \ {'short' : 'p', 'long' : 'prototypes', 'fold' : 1, 'stl' : 0}, 315 | \ {'short' : 'g', 'long' : 'enums', 'fold' : 0, 'stl' : 1}, 316 | \ {'short' : 'e', 'long' : 'enumerators', 'fold' : 0, 'stl' : 0}, 317 | \ {'short' : 't', 'long' : 'typedefs', 'fold' : 0, 'stl' : 0}, 318 | \ {'short' : 'n', 'long' : 'namespaces', 'fold' : 0, 'stl' : 1}, 319 | \ {'short' : 'c', 'long' : 'classes', 'fold' : 0, 'stl' : 1}, 320 | \ {'short' : 's', 'long' : 'structs', 'fold' : 0, 'stl' : 1}, 321 | \ {'short' : 'u', 'long' : 'unions', 'fold' : 0, 'stl' : 1}, 322 | \ {'short' : 'f', 'long' : 'functions', 'fold' : 0, 'stl' : 1}, 323 | \ {'short' : 'm', 'long' : 'members', 'fold' : 0, 'stl' : 0}, 324 | \ {'short' : 'v', 'long' : 'variables', 'fold' : 0, 'stl' : 0} 325 | \ ] 326 | let type_cpp.sro = '::' 327 | let type_cpp.kind2scope = { 328 | \ 'g' : 'enum', 329 | \ 'n' : 'namespace', 330 | \ 'c' : 'class', 331 | \ 's' : 'struct', 332 | \ 'u' : 'union' 333 | \ } 334 | let type_cpp.scope2kind = { 335 | \ 'enum' : 'g', 336 | \ 'namespace' : 'n', 337 | \ 'class' : 'c', 338 | \ 'struct' : 's', 339 | \ 'union' : 'u' 340 | \ } 341 | let types.cpp = type_cpp 342 | let types.cuda = type_cpp 343 | let types.arduino = type_cpp 344 | " C# {{{1 345 | let type_cs = tagbar#prototypes#typeinfo#new() 346 | let type_cs.ctagstype = 'c#' 347 | let type_cs.kinds = [ 348 | \ {'short' : 'd', 'long' : 'macros', 'fold' : 1, 'stl' : 0}, 349 | \ {'short' : 'f', 'long' : 'fields', 'fold' : 0, 'stl' : 1}, 350 | \ {'short' : 'g', 'long' : 'enums', 'fold' : 0, 'stl' : 1}, 351 | \ {'short' : 'e', 'long' : 'enumerators', 'fold' : 0, 'stl' : 0}, 352 | \ {'short' : 't', 'long' : 'typedefs', 'fold' : 0, 'stl' : 1}, 353 | \ {'short' : 'n', 'long' : 'namespaces', 'fold' : 0, 'stl' : 1}, 354 | \ {'short' : 'i', 'long' : 'interfaces', 'fold' : 0, 'stl' : 1}, 355 | \ {'short' : 'c', 'long' : 'classes', 'fold' : 0, 'stl' : 1}, 356 | \ {'short' : 's', 'long' : 'structs', 'fold' : 0, 'stl' : 1}, 357 | \ {'short' : 'E', 'long' : 'events', 'fold' : 0, 'stl' : 1}, 358 | \ {'short' : 'm', 'long' : 'methods', 'fold' : 0, 'stl' : 1}, 359 | \ {'short' : 'p', 'long' : 'properties', 'fold' : 0, 'stl' : 1} 360 | \ ] 361 | let type_cs.sro = '.' 362 | let type_cs.kind2scope = { 363 | \ 'n' : 'namespace', 364 | \ 'i' : 'interface', 365 | \ 'c' : 'class', 366 | \ 's' : 'struct', 367 | \ 'g' : 'enum' 368 | \ } 369 | let type_cs.scope2kind = { 370 | \ 'namespace' : 'n', 371 | \ 'interface' : 'i', 372 | \ 'class' : 'c', 373 | \ 'struct' : 's', 374 | \ 'enum' : 'g' 375 | \ } 376 | let types.cs = type_cs 377 | " Clojure {{{1 378 | let type_clojure = tagbar#prototypes#typeinfo#new() 379 | let type_clojure.ctagstype = 'clojure' 380 | let type_clojure.kinds = [ 381 | \ {'short': 'n', 'long': 'namespace', 'fold': 0, 'stl': 1}, 382 | \ {'short': 'f', 'long': 'function', 'fold': 0, 'stl': 1}, 383 | \ ] 384 | let type_clojure.sro = '.' 385 | let type_clojure.kind2scope = { 386 | \ 'n' : 'namespace', 387 | \ } 388 | let type_clojure.scope2kind = { 389 | \ 'namespace' : 'n' 390 | \ } 391 | let types.clojure = type_clojure 392 | " CMake {{{1 393 | let type_cmake = tagbar#prototypes#typeinfo#new() 394 | let type_cmake.ctagstype = 'cmake' 395 | let type_cmake.kinds = [ 396 | \ {'short': 'p', 'long': 'projects' , 'fold': 0, 'stl': 1}, 397 | \ {'short': 'm', 'long': 'macros' , 'fold': 0, 'stl': 1}, 398 | \ {'short': 'f', 'long': 'functions', 'fold': 0, 'stl': 1}, 399 | \ {'short': 'D', 'long': 'options' , 'fold': 0, 'stl': 1}, 400 | \ {'short': 'v', 'long': 'variables', 'fold': 0, 'stl': 1}, 401 | \ {'short': 't', 'long': 'targets' , 'fold': 0, 'stl': 1}, 402 | \ ] 403 | let type_cmake.sro = '.' 404 | let type_cmake.kind2scope = { 405 | \ 'f' : 'function', 406 | \ } 407 | let type_cmake.scope2kind = { 408 | \ 'function' : 'f', 409 | \ } 410 | let types.cmake = type_cmake 411 | " Crystal {{{1 412 | let type_crystal = tagbar#prototypes#typeinfo#new() 413 | let type_crystal.ctagstype = 'crystal' 414 | let type_crystal.kinds = [ 415 | \ {'short' : 'm', 'long' : 'modules', 'fold' : 0, 'stl' : 1}, 416 | \ {'short' : 'c', 'long' : 'classes', 'fold' : 0, 'stl' : 1}, 417 | \ {'short' : 'd', 'long' : 'defs', 'fold' : 0, 'stl' : 1}, 418 | \ {'short' : 'f', 'long' : 'functions', 'fold' : 0, 'stl' : 1}, 419 | \ {'short' : 'M', 'long' : 'macros', 'fold' : 0, 'stl' : 1}, 420 | \ {'short' : 'l', 'long' : 'libs', 'fold' : 0, 'stl' : 1}, 421 | \ {'short' : 's', 'long' : 'structs', 'fold' : 0, 'stl' : 1}, 422 | \ {'short' : 'a', 'long' : 'aliases', 'fold' : 0, 'stl' : 1} 423 | \ ] 424 | let type_crystal.sro = '::' 425 | let types.crystal = type_crystal 426 | " Ctags config {{{1 427 | let type_ctags = tagbar#prototypes#typeinfo#new() 428 | let type_ctags.ctagstype = 'ctags' 429 | let type_ctags.kinds = [ 430 | \ {'short' : 'l', 'long' : 'language definitions', 'fold' : 0, 'stl' : 1}, 431 | \ {'short' : 'k', 'long' : 'kind definitions', 'fold' : 0, 'stl' : 1}, 432 | \ ] 433 | let type_ctags.sro = '.' " Not actually possible 434 | let type_ctags.kind2scope = { 435 | \ 'l' : 'langdef', 436 | \ } 437 | let type_ctags.scope2kind = { 438 | \ 'langdef' : 'l', 439 | \ } 440 | let types.ctags = type_ctags 441 | " COBOL {{{1 442 | let type_cobol = tagbar#prototypes#typeinfo#new() 443 | let type_cobol.ctagstype = 'cobol' 444 | let type_cobol.kinds = [ 445 | \ {'short' : 'd', 'long' : 'data items', 'fold' : 0, 'stl' : 1}, 446 | \ {'short' : 'D', 'long' : 'divisions', 'fold' : 0, 'stl' : 1}, 447 | \ {'short' : 'f', 'long' : 'file descriptions', 'fold' : 0, 'stl' : 1}, 448 | \ {'short' : 'g', 'long' : 'group items', 'fold' : 0, 'stl' : 1}, 449 | \ {'short' : 'p', 'long' : 'paragraphs', 'fold' : 0, 'stl' : 1}, 450 | \ {'short' : 'P', 'long' : 'program ids', 'fold' : 0, 'stl' : 1}, 451 | \ {'short' : 'S', 'long' : 'source code file', 'fold' : 0, 'stl' : 1}, 452 | \ {'short' : 's', 'long' : 'sections', 'fold' : 0, 'stl' : 1} 453 | \ ] 454 | let types.cobol = type_cobol 455 | " CSS {{{1 456 | let type_css = tagbar#prototypes#typeinfo#new() 457 | let type_css.ctagstype = 'css' 458 | let type_css.kinds = [ 459 | \ {'short' : 's', 'long' : 'selector', 'fold' : 0, 'stl' : 0}, 460 | \ {'short' : 'i', 'long' : 'identities', 'fold' : 1, 'stl' : 0}, 461 | \ {'short' : 'c', 'long' : 'classes', 'fold' : 1, 'stl' : 0} 462 | \ ] 463 | let types.css = type_css 464 | " D {{{1 465 | let type_d = tagbar#prototypes#typeinfo#new() 466 | let type_d.ctagstype = 'D' 467 | let type_d.kinds = [ 468 | \ {'short' : 'M', 'long' : 'modules', 'fold' : 0, 'stl' : 1}, 469 | \ {'short' : 'V', 'long' : 'version statements', 'fold' : 1, 'stl' : 0}, 470 | \ {'short' : 'n', 'long' : 'namespaces', 'fold' : 0, 'stl' : 1}, 471 | \ {'short' : 'T', 'long' : 'templates', 'fold' : 0, 'stl' : 0}, 472 | \ {'short' : 'c', 'long' : 'classes', 'fold' : 0, 'stl' : 1}, 473 | \ {'short' : 'i', 'long' : 'interfaces', 'fold' : 0, 'stl' : 1}, 474 | \ {'short' : 's', 'long' : 'structure names', 'fold' : 0, 'stl' : 1}, 475 | \ {'short' : 'g', 'long' : 'enumeration names', 'fold' : 0, 'stl' : 1}, 476 | \ {'short' : 'e', 'long' : 'enumerators', 'fold' : 0, 'stl' : 0}, 477 | \ {'short' : 'u', 'long' : 'union names', 'fold' : 0, 'stl' : 1}, 478 | \ {'short' : 'p', 'long' : 'function prototypes', 'fold' : 0, 'stl' : 1}, 479 | \ {'short' : 'f', 'long' : 'function definitions', 'fold' : 0, 'stl' : 1}, 480 | \ {'short' : 'm', 'long' : 'members', 'fold' : 0, 'stl' : 1}, 481 | \ {'short' : 'a', 'long' : 'aliases', 'fold' : 1, 'stl' : 0}, 482 | \ {'short' : 'X', 'long' : 'mixins', 'fold' : 0, 'stl' : 1}, 483 | \ {'short' : 'v', 'long' : 'variable definitions', 'fold' : 0, 'stl' : 0}, 484 | \ ] 485 | let type_d.sro = '.' 486 | let type_d.kind2scope = { 487 | \ 'g' : 'enum', 488 | \ 'n' : 'namespace', 489 | \ 'i' : 'interface', 490 | \ 'c' : 'class', 491 | \ 's' : 'struct', 492 | \ 'u' : 'union' 493 | \ } 494 | let type_d.scope2kind = { 495 | \ 'enum' : 'g', 496 | \ 'namespace' : 'n', 497 | \ 'interface' : 'i', 498 | \ 'class' : 'c', 499 | \ 'struct' : 's', 500 | \ 'union' : 'u' 501 | \ } 502 | let types.d = type_d 503 | " DOS Batch {{{1 504 | let type_dosbatch = tagbar#prototypes#typeinfo#new() 505 | let type_dosbatch.ctagstype = 'dosbatch' 506 | let type_dosbatch.kinds = [ 507 | \ {'short' : 'l', 'long' : 'labels', 'fold' : 0, 'stl' : 1}, 508 | \ {'short' : 'v', 'long' : 'variables', 'fold' : 0, 'stl' : 1} 509 | \ ] 510 | let types.dosbatch = type_dosbatch 511 | " DTS {{{1 512 | let type_dts = tagbar#prototypes#typeinfo#new() 513 | let type_dts.ctagstype = 'dts' 514 | let type_dts.kinds = [ 515 | \ {'short' : 'l', 'long' : 'labels', 'fold' : 0, 'stl' : 1}, 516 | \ {'short' : 'p', 'long' : 'phandlers', 'fold' : 0, 'stl' : 1} 517 | \ ] 518 | let types.dts = type_dts 519 | " Eiffel {{{1 520 | let type_eiffel = tagbar#prototypes#typeinfo#new() 521 | let type_eiffel.ctagstype = 'eiffel' 522 | let type_eiffel.kinds = [ 523 | \ {'short' : 'c', 'long' : 'classes', 'fold' : 0, 'stl' : 1}, 524 | \ {'short' : 'f', 'long' : 'features', 'fold' : 0, 'stl' : 1} 525 | \ ] 526 | let type_eiffel.sro = '.' " Not sure, is nesting even possible? 527 | let type_eiffel.kind2scope = { 528 | \ 'c' : 'class', 529 | \ 'f' : 'feature' 530 | \ } 531 | let type_eiffel.scope2kind = { 532 | \ 'class' : 'c', 533 | \ 'feature' : 'f' 534 | \ } 535 | let types.eiffel = type_eiffel 536 | " Elm {{{1 537 | " based on https://github.com/bitterjug/vim-tagbar-ctags-elm/blob/master/ftplugin/elm/tagbar-elm.vim 538 | let type_elm = tagbar#prototypes#typeinfo#new() 539 | let type_elm.ctagstype = 'elm' 540 | let type_elm.kinds = [ 541 | \ {'short' : 'm', 'long' : 'modules', 'fold' : 0, 'stl' : 0}, 542 | \ {'short' : 'i', 'long' : 'imports', 'fold' : 1, 'stl' : 0}, 543 | \ {'short' : 't', 'long' : 'types', 'fold' : 1, 'stl' : 0}, 544 | \ {'short' : 'a', 'long' : 'type aliases', 'fold' : 0, 'stl' : 0}, 545 | \ {'short' : 'c', 'long' : 'type constructors', 'fold' : 0, 'stl' : 0}, 546 | \ {'short' : 'p', 'long' : 'ports', 'fold' : 0, 'stl' : 0}, 547 | \ {'short' : 'f', 'long' : 'functions', 'fold' : 1, 'stl' : 0}, 548 | \ ] 549 | let type_elm.sro = ':' 550 | let type_elm.kind2scope = { 551 | \ 'f' : 'function', 552 | \ 'm' : 'module', 553 | \ 't' : 'type' 554 | \ } 555 | let type_elm.scope2kind = { 556 | \ 'function' : 'f', 557 | \ 'module' : 'm', 558 | \ 'type' : 't' 559 | \ } 560 | let types.elm = type_elm 561 | " Erlang {{{1 562 | let type_erlang = tagbar#prototypes#typeinfo#new() 563 | let type_erlang.ctagstype = 'erlang' 564 | let type_erlang.kinds = [ 565 | \ {'short' : 'm', 'long' : 'modules', 'fold' : 0, 'stl' : 1}, 566 | \ {'short' : 'd', 'long' : 'macro definitions', 'fold' : 0, 'stl' : 1}, 567 | \ {'short' : 'f', 'long' : 'functions', 'fold' : 0, 'stl' : 1}, 568 | \ {'short' : 'r', 'long' : 'record definitions', 'fold' : 0, 'stl' : 1}, 569 | \ {'short' : 't', 'long' : 'type definitions', 'fold' : 0, 'stl' : 1} 570 | \ ] 571 | let type_erlang.sro = '.' " Not sure, is nesting even possible? 572 | let type_erlang.kind2scope = { 573 | \ 'm' : 'module' 574 | \ } 575 | let type_erlang.scope2kind = { 576 | \ 'module' : 'm' 577 | \ } 578 | let types.erlang = type_erlang 579 | " Flex {{{1 580 | " Vim doesn't support Flex out of the box, this is based on rough 581 | " guesses and probably requires 582 | " http://www.vim.org/scripts/script.php?script_id=2909 583 | " Improvements welcome! 584 | let type_as = tagbar#prototypes#typeinfo#new() 585 | let type_as.ctagstype = 'flex' 586 | let type_as.kinds = [ 587 | \ {'short' : 'v', 'long' : 'global variables', 'fold' : 0, 'stl' : 0}, 588 | \ {'short' : 'c', 'long' : 'classes', 'fold' : 0, 'stl' : 1}, 589 | \ {'short' : 'm', 'long' : 'methods', 'fold' : 0, 'stl' : 1}, 590 | \ {'short' : 'p', 'long' : 'properties', 'fold' : 0, 'stl' : 1}, 591 | \ {'short' : 'f', 'long' : 'functions', 'fold' : 0, 'stl' : 1}, 592 | \ {'short' : 'x', 'long' : 'mxtags', 'fold' : 0, 'stl' : 0} 593 | \ ] 594 | let type_as.sro = '.' 595 | let type_as.kind2scope = { 596 | \ 'c' : 'class' 597 | \ } 598 | let type_as.scope2kind = { 599 | \ 'class' : 'c' 600 | \ } 601 | let types.mxml = type_as 602 | let types.actionscript = type_as 603 | " Fortran {{{1 604 | let type_fortran = tagbar#prototypes#typeinfo#new() 605 | let type_fortran.ctagstype = 'fortran' 606 | let type_fortran.kinds = [ 607 | \ {'short' : 'm', 'long' : 'modules', 'fold' : 0, 'stl' : 1}, 608 | \ {'short' : 'p', 'long' : 'programs', 'fold' : 0, 'stl' : 1}, 609 | \ {'short' : 'k', 'long' : 'components', 'fold' : 0, 'stl' : 1}, 610 | \ {'short' : 't', 'long' : 'derived types and structures', 'fold' : 0, 611 | \ 'stl' : 1}, 612 | \ {'short' : 'c', 'long' : 'common blocks', 'fold' : 0, 'stl' : 1}, 613 | \ {'short' : 'b', 'long' : 'block data', 'fold' : 0, 'stl' : 0}, 614 | \ {'short' : 'E', 'long' : 'enumerations', 'fold' : 0, 'stl' : 1}, 615 | \ {'short' : 'N', 'long' : 'enumeration values', 'fold' : 0, 'stl' : 0}, 616 | \ {'short' : 'e', 'long' : 'entry points', 'fold' : 0, 'stl' : 1}, 617 | \ {'short' : 'f', 'long' : 'functions', 'fold' : 0, 'stl' : 1}, 618 | \ {'short' : 's', 'long' : 'subroutines', 'fold' : 0, 'stl' : 1}, 619 | \ {'short' : 'M', 'long' : 'type bound procedures', 'fold' : 0, 620 | \ 'stl' : 1}, 621 | \ {'short' : 'l', 'long' : 'labels', 'fold' : 0, 'stl' : 1}, 622 | \ {'short' : 'n', 'long' : 'namelists', 'fold' : 0, 'stl' : 1}, 623 | \ {'short' : 'v', 'long' : 'variables', 'fold' : 0, 'stl' : 0} 624 | \ ] 625 | let type_fortran.sro = '.' " Not sure, is nesting even possible? 626 | let type_fortran.kind2scope = { 627 | \ 'm' : 'module', 628 | \ 'p' : 'program', 629 | \ 'f' : 'function', 630 | \ 's' : 'subroutine' 631 | \ } 632 | let type_fortran.scope2kind = { 633 | \ 'module' : 'm', 634 | \ 'program' : 'p', 635 | \ 'function' : 'f', 636 | \ 'subroutine' : 's' 637 | \ } 638 | let types.fortran = type_fortran 639 | " Go {{{1 640 | let type_go = tagbar#prototypes#typeinfo#new() 641 | let type_go.ctagstype = 'go' 642 | let type_go.kinds = [ 643 | \ {'short' : 'p', 'long' : 'packages', 'fold' : 0, 'stl' : 0}, 644 | \ {'short' : 'i', 'long' : 'interfaces', 'fold' : 0, 'stl' : 0}, 645 | \ {'short' : 'c', 'long' : 'constants', 'fold' : 0, 'stl' : 0}, 646 | \ {'short' : 's', 'long' : 'structs', 'fold' : 0, 'stl' : 1}, 647 | \ {'short' : 'm', 'long' : 'struct members', 'fold' : 0, 'stl' : 0}, 648 | \ {'short' : 't', 'long' : 'types', 'fold' : 0, 'stl' : 1}, 649 | \ {'short' : 'f', 'long' : 'functions', 'fold' : 0, 'stl' : 1}, 650 | \ {'short' : 'v', 'long' : 'variables', 'fold' : 0, 'stl' : 0} 651 | \ ] 652 | let type_go.sro = '.' 653 | let type_go.kind2scope = { 654 | \ 's' : 'struct' 655 | \ } 656 | let type_go.scope2kind = { 657 | \ 'struct' : 's' 658 | \ } 659 | let types.go = type_go 660 | " Haskell {{{1 661 | let type_haskell = tagbar#prototypes#typeinfo#new() 662 | let type_haskell.ctagstype = 'haskell' 663 | let type_haskell.kinds = [ 664 | \ {'short' : 'm', 'long' : 'module', 'fold' : 0, 'stl' : 0}, 665 | \ {'short' : 't', 'long' : 'types', 'fold' : 0, 'stl' : 0}, 666 | \ {'short' : 'c', 'long' : 'constructors', 'fold' : 0, 'stl' : 0}, 667 | \ {'short' : 'f', 'long' : 'functions', 'fold' : 0, 'stl' : 1} 668 | \ ] 669 | let types.haskell = type_haskell 670 | " HTML {{{1 671 | let type_html = tagbar#prototypes#typeinfo#new() 672 | let type_html.ctagstype = 'html' 673 | let type_html.ctagsargs = [ 674 | \ '--fields=+{roles}', 675 | \ '--extras=+{reference}', 676 | \ '--extras=+F', 677 | \ '-f', 678 | \ '-', 679 | \ '--format=2', 680 | \ '--excmd=pattern', 681 | \ '--fields=nksSafet', 682 | \ '--sort=no', 683 | \ '--append=no', 684 | \ ] 685 | let type_html.kinds = [ 686 | \ {'short' : 'a', 'long' : 'named anchors', 'fold' : 0, 'stl' : 1}, 687 | \ {'short' : 'c', 'long' : 'classes', 'fold' : 0, 'stl' : 1}, 688 | \ {'short' : 'C', 'long' : 'stylesheets', 'fold' : 0, 'stl' : 1}, 689 | \ {'short' : 'I', 'long' : 'identifiers', 'fold' : 0, 'stl' : 1}, 690 | \ {'short' : 'J', 'long' : 'scripts', 'fold' : 0, 'stl' : 1}, 691 | \ {'short' : 'h', 'long' : 'H1 headings', 'fold' : 1, 'stl' : 1}, 692 | \ {'short' : 'i', 'long' : 'H2 headings', 'fold' : 1, 'stl' : 1}, 693 | \ {'short' : 'j', 'long' : 'H3 headings', 'fold' : 1, 'stl' : 1}, 694 | \ ] 695 | let types.html = type_html 696 | " Java {{{1 697 | let type_java = tagbar#prototypes#typeinfo#new() 698 | let type_java.ctagstype = 'java' 699 | let type_java.kinds = [ 700 | \ {'short' : 'p', 'long' : 'packages', 'fold' : 1, 'stl' : 0}, 701 | \ {'short' : 'f', 'long' : 'fields', 'fold' : 0, 'stl' : 0}, 702 | \ {'short' : 'g', 'long' : 'enum types', 'fold' : 0, 'stl' : 1}, 703 | \ {'short' : 'e', 'long' : 'enum constants', 'fold' : 0, 'stl' : 0}, 704 | \ {'short' : 'a', 'long' : 'annotations', 'fold' : 0, 'stl' : 0}, 705 | \ {'short' : 'i', 'long' : 'interfaces', 'fold' : 0, 'stl' : 1}, 706 | \ {'short' : 'c', 'long' : 'classes', 'fold' : 0, 'stl' : 1}, 707 | \ {'short' : 'm', 'long' : 'methods', 'fold' : 0, 'stl' : 1} 708 | \ ] 709 | let type_java.sro = '.' 710 | let type_java.kind2scope = { 711 | \ 'g' : 'enum', 712 | \ 'i' : 'interface', 713 | \ 'c' : 'class' 714 | \ } 715 | let type_java.scope2kind = { 716 | \ 'enum' : 'g', 717 | \ 'interface' : 'i', 718 | \ 'class' : 'c' 719 | \ } 720 | let types.java = type_java 721 | " JavaScript {{{1 722 | let type_javascript = tagbar#prototypes#typeinfo#new() 723 | let type_javascript.ctagstype = 'javascript' 724 | let type_javascript.kinds = [ 725 | \ {'short': 'v', 'long': 'global variables', 'fold': 0, 'stl': 0}, 726 | \ {'short': 'C', 'long': 'constants', 'fold': 0, 'stl': 0}, 727 | \ {'short': 'c', 'long': 'classes', 'fold': 0, 'stl': 1}, 728 | \ {'short': 'g', 'long': 'generators', 'fold': 0, 'stl': 0}, 729 | \ {'short': 'p', 'long': 'properties', 'fold': 0, 'stl': 0}, 730 | \ {'short': 'm', 'long': 'methods', 'fold': 0, 'stl': 1}, 731 | \ {'short': 'f', 'long': 'functions', 'fold': 0, 'stl': 1}, 732 | \ ] 733 | let type_javascript.sro = '.' 734 | let type_javascript.kind2scope = { 735 | \ 'c' : 'class', 736 | \ 'f' : 'function', 737 | \ 'm' : 'method', 738 | \ 'p' : 'property', 739 | \ } 740 | let type_javascript.scope2kind = { 741 | \ 'class' : 'c', 742 | \ 'function' : 'f', 743 | \ } 744 | let types.javascript = type_javascript 745 | 746 | " Kotlin {{{1 747 | let type_kotlin = tagbar#prototypes#typeinfo#new() 748 | let type_kotlin.ctagstype = 'kotlin' 749 | let type_kotlin.kinds = [ 750 | \ {'short': 'p', 'long': 'packages', 'fold':0, 'stl':0}, 751 | \ {'short': 'c', 'long': 'classes', 'fold':0, 'stl':1}, 752 | \ {'short': 'o', 'long': 'objects', 'fold':0, 'stl':0}, 753 | \ {'short': 'i', 'long': 'interfaces', 'fold':0, 'stl':0}, 754 | \ {'short': 'T', 'long': 'typealiases', 'fold':0, 'stl':0}, 755 | \ {'short': 'm', 'long': 'methods', 'fold':0, 'stl':1}, 756 | \ {'short': 'C', 'long': 'constants', 'fold':0, 'stl':0}, 757 | \ {'short': 'v', 'long': 'variables', 'fold':0, 'stl':0}, 758 | \ ] 759 | let type_kotlin.sro = '.' 760 | " Note: the current universal ctags version does not have proper 761 | " definition for the scope of the tags. So for now we can't add the 762 | " kind2scope / scope2kind for anything until ctags supports the correct 763 | " scope info 764 | let type_kotlin.kind2scope = { 765 | \ } 766 | let type_kotlin.scope2kind = { 767 | \ } 768 | let types.kotlin = type_kotlin 769 | 770 | " Lisp {{{1 771 | let type_lisp = tagbar#prototypes#typeinfo#new() 772 | let type_lisp.ctagstype = 'lisp' 773 | let type_lisp.kinds = [ 774 | \ {'short' : 'f', 'long' : 'functions', 'fold' : 0, 'stl' : 1} 775 | \ ] 776 | let types.lisp = type_lisp 777 | " Lua {{{1 778 | let type_lua = tagbar#prototypes#typeinfo#new() 779 | let type_lua.ctagstype = 'lua' 780 | let type_lua.kinds = [ 781 | \ {'short' : 'f', 'long' : 'functions', 'fold' : 0, 'stl' : 1} 782 | \ ] 783 | let types.lua = type_lua 784 | " Make {{{1 785 | let type_make = tagbar#prototypes#typeinfo#new() 786 | let type_make.ctagstype = 'make' 787 | let type_make.kinds = [ 788 | \ {'short' : 'I', 'long' : 'makefiles', 'fold' : 0, 'stl' : 0}, 789 | \ {'short' : 'm', 'long' : 'macros', 'fold' : 0, 'stl' : 1}, 790 | \ {'short' : 't', 'long' : 'targets', 'fold' : 0, 'stl' : 1} 791 | \ ] 792 | let types.make = type_make 793 | " Markdown {{{1 794 | let type_markdown = tagbar#prototypes#typeinfo#new() 795 | let type_markdown.ctagstype = 'markdown' 796 | let type_markdown.kinds = [ 797 | \ {'short' : 'c', 'long' : 'chapter', 'fold' : 0, 'stl' : 1}, 798 | \ {'short' : 's', 'long' : 'section', 'fold' : 0, 'stl' : 1}, 799 | \ {'short' : 'S', 'long' : 'subsection', 'fold' : 0, 'stl' : 1}, 800 | \ {'short' : 't', 'long' : 'subsubsection', 'fold' : 0, 'stl' : 1}, 801 | \ {'short' : 'T', 'long' : 'l3subsection', 'fold' : 0, 'stl' : 1}, 802 | \ {'short' : 'u', 'long' : 'l4subsection', 'fold' : 0, 'stl' : 1}, 803 | \ ] 804 | let type_markdown.kind2scope = { 805 | \ 'c' : 'chapter', 806 | \ 's' : 'section', 807 | \ 'S' : 'subsection', 808 | \ 't' : 'subsubsection', 809 | \ 'T' : 'l3subsection', 810 | \ 'u' : 'l4subsection', 811 | \ } 812 | let type_markdown.scope2kind = { 813 | \ 'chapter' : 'c', 814 | \ 'section' : 's', 815 | \ 'subsection' : 'S', 816 | \ 'subsubsection' : 't', 817 | \ 'l3subsection' : 'T', 818 | \ 'l4subsection' : 'u', 819 | \ } 820 | let type_markdown.sro = '""' 821 | let type_markdown.sort = 0 822 | let types.markdown = type_markdown 823 | let types.pandoc = type_markdown 824 | " Matlab {{{1 825 | let type_matlab = tagbar#prototypes#typeinfo#new() 826 | let type_matlab.ctagstype = 'matlab' 827 | let type_matlab.kinds = [ 828 | \ {'short' : 'f', 'long' : 'functions', 'fold' : 0, 'stl' : 1}, 829 | \ {'short' : 'v', 'long' : 'variables', 'fold' : 0, 'stl' : 0} 830 | \ ] 831 | let types.matlab = type_matlab 832 | " NRoff {{{1 833 | let type_nroff = tagbar#prototypes#typeinfo#new() 834 | let type_nroff.ctagstype = 'nroff' 835 | let type_nroff.kinds = [ 836 | \ {'short' : 't', 'long' : 'titles', 'fold' : 0, 'stl' : 1}, 837 | \ {'short' : 's', 'long' : 'sections', 'fold' : 0, 'stl' : 1} 838 | \ ] 839 | let type_nroff.sro = '.' 840 | let type_nroff.kind2scope = { 841 | \ 't' : 'title', 842 | \ 's' : 'section' 843 | \ } 844 | let type_nroff.scope2kind = { 845 | \ 'section' : 't', 846 | \ 'title' : 's' 847 | \ } 848 | let types.nroff = type_nroff 849 | " ObjectiveC {{{1 850 | let type_objc = tagbar#prototypes#typeinfo#new() 851 | let type_objc.ctagstype = 'objectivec' 852 | let type_objc.kinds = [ 853 | \ {'short' : 'M', 'long' : 'preprocessor macros', 'fold' : 1, 'stl' : 0}, 854 | \ {'short' : 't', 'long' : 'type aliases', 'fold' : 0, 'stl' : 1}, 855 | \ {'short' : 'v', 'long' : 'global variables', 'fold' : 0, 'stl' : 0}, 856 | \ {'short' : 'i', 'long' : 'class interfaces', 'fold' : 0, 'stl' : 1}, 857 | \ {'short' : 'I', 'long' : 'class implementations', 'fold' : 0, 'stl' : 1}, 858 | \ {'short' : 'c', 'long' : 'class methods', 'fold' : 0, 'stl' : 1}, 859 | \ {'short' : 'E', 'long' : 'object fields', 'fold' : 0, 'stl' : 0}, 860 | \ {'short' : 'm', 'long' : 'object methods', 'fold' : 0, 'stl' : 1}, 861 | \ {'short' : 's', 'long' : 'type structures', 'fold' : 0, 'stl' : 1}, 862 | \ {'short' : 'e', 'long' : 'enumerations', 'fold' : 0, 'stl' : 1}, 863 | \ {'short' : 'f', 'long' : 'functions', 'fold' : 0, 'stl' : 1}, 864 | \ {'short' : 'p', 'long' : 'properties', 'fold' : 0, 'stl' : 0}, 865 | \ {'short' : 'P', 'long' : 'protocols', 'fold' : 0, 'stl' : 0}, 866 | \ ] 867 | let type_objc.sro = ':' 868 | let type_objc.kind2scope = { 869 | \ 'i' : 'interface', 870 | \ 'I' : 'implementation', 871 | \ 's' : 'struct', 872 | \ 'p' : 'protocol', 873 | \ } 874 | let type_objc.scope2kind = { 875 | \ 'interface' : 'i', 876 | \ 'implementation' : 'I', 877 | \ 'struct' : 's', 878 | \ 'protocol' : 'p', 879 | \ } 880 | let types.objc = type_objc 881 | let types.objcpp = type_objc 882 | " Ocaml {{{1 883 | let type_ocaml = tagbar#prototypes#typeinfo#new() 884 | let type_ocaml.ctagstype = 'ocaml' 885 | let type_ocaml.kinds = [ 886 | \ {'short' : 'M', 'long' : 'modules or functors', 'fold' : 0, 'stl' : 1}, 887 | \ {'short' : 'v', 'long' : 'global variables', 'fold' : 0, 'stl' : 0}, 888 | \ {'short' : 'c', 'long' : 'classes', 'fold' : 0, 'stl' : 1}, 889 | \ {'short' : 'C', 'long' : 'constructors', 'fold' : 0, 'stl' : 1}, 890 | \ {'short' : 'm', 'long' : 'methods', 'fold' : 0, 'stl' : 1}, 891 | \ {'short' : 'e', 'long' : 'exceptions', 'fold' : 0, 'stl' : 1}, 892 | \ {'short' : 't', 'long' : 'type names', 'fold' : 0, 'stl' : 1}, 893 | \ {'short' : 'f', 'long' : 'functions', 'fold' : 0, 'stl' : 1}, 894 | \ {'short' : 'r', 'long' : 'structure fields', 'fold' : 0, 'stl' : 0}, 895 | \ {'short' : 'p', 'long' : 'signature items', 'fold' : 0, 'stl' : 0} 896 | \ ] 897 | let type_ocaml.sro = '.' " Not sure, is nesting even possible? 898 | let type_ocaml.kind2scope = { 899 | \ 'M' : 'Module', 900 | \ 'c' : 'class', 901 | \ 't' : 'type' 902 | \ } 903 | let type_ocaml.scope2kind = { 904 | \ 'Module' : 'M', 905 | \ 'class' : 'c', 906 | \ 'type' : 't' 907 | \ } 908 | let types.ocaml = type_ocaml 909 | " Pascal {{{1 910 | let type_pascal = tagbar#prototypes#typeinfo#new() 911 | let type_pascal.ctagstype = 'pascal' 912 | let type_pascal.kinds = [ 913 | \ {'short' : 'f', 'long' : 'functions', 'fold' : 0, 'stl' : 1}, 914 | \ {'short' : 'p', 'long' : 'procedures', 'fold' : 0, 'stl' : 1} 915 | \ ] 916 | let types.pascal = type_pascal 917 | " Perl {{{1 918 | let type_perl = tagbar#prototypes#typeinfo#new() 919 | let type_perl.ctagstype = 'perl' 920 | let type_perl.kinds = [ 921 | \ {'short' : 'p', 'long' : 'packages', 'fold' : 1, 'stl' : 0}, 922 | \ {'short' : 'c', 'long' : 'constants', 'fold' : 0, 'stl' : 0}, 923 | \ {'short' : 'M', 'long' : 'modules', 'fold' : 0, 'stl' : 0}, 924 | \ {'short' : 'f', 'long' : 'formats', 'fold' : 0, 'stl' : 0}, 925 | \ {'short' : 'l', 'long' : 'labels', 'fold' : 0, 'stl' : 1}, 926 | \ {'short' : 's', 'long' : 'subroutines', 'fold' : 0, 'stl' : 1}, 927 | \ {'short' : 'd', 'long' : 'subroutineDeclarations', 'fold' : 0, 'stl' : 0} 928 | \ ] 929 | let types.perl = type_perl 930 | " Perl 6 {{{1 931 | let type_perl6 = tagbar#prototypes#typeinfo#new() 932 | let type_perl6.ctagstype = 'perl6' 933 | let type_perl6.kinds = [ 934 | \ {'short' : 'o', 'long' : 'modules', 'fold' : 0, 'stl' : 1}, 935 | \ {'short' : 'p', 'long' : 'packages', 'fold' : 1, 'stl' : 0}, 936 | \ {'short' : 'c', 'long' : 'classes', 'fold' : 0, 'stl' : 1}, 937 | \ {'short' : 'g', 'long' : 'grammars', 'fold' : 0, 'stl' : 0}, 938 | \ {'short' : 'm', 'long' : 'methods', 'fold' : 0, 'stl' : 1}, 939 | \ {'short' : 'r', 'long' : 'roles', 'fold' : 0, 'stl' : 1}, 940 | \ {'short' : 'u', 'long' : 'rules', 'fold' : 0, 'stl' : 0}, 941 | \ {'short' : 'b', 'long' : 'submethods', 'fold' : 0, 'stl' : 1}, 942 | \ {'short' : 's', 'long' : 'subroutines', 'fold' : 0, 'stl' : 1}, 943 | \ {'short' : 't', 'long' : 'tokens', 'fold' : 0, 'stl' : 0}, 944 | \ ] 945 | let types.perl6 = type_perl6 946 | " PHP {{{1 947 | let type_php = tagbar#prototypes#typeinfo#new() 948 | let type_php.ctagstype = 'php' 949 | let type_php.kinds = [ 950 | \ {'short' : 'n', 'long' : 'namespaces', 'fold' : 0, 'stl' : 0}, 951 | \ {'short' : 'a', 'long' : 'use aliases', 'fold' : 1, 'stl' : 0}, 952 | \ {'short' : 'd', 'long' : 'constant definitions', 'fold' : 0, 'stl' : 0}, 953 | \ {'short' : 'i', 'long' : 'interfaces', 'fold' : 0, 'stl' : 1}, 954 | \ {'short' : 't', 'long' : 'traits', 'fold' : 0, 'stl' : 1}, 955 | \ {'short' : 'c', 'long' : 'classes', 'fold' : 0, 'stl' : 1}, 956 | \ {'short' : 'v', 'long' : 'variables', 'fold' : 1, 'stl' : 0}, 957 | \ {'short' : 'f', 'long' : 'functions', 'fold' : 0, 'stl' : 1} 958 | \ ] 959 | let type_php.sro = '\\' 960 | let type_php.kind2scope = { 961 | \ 'c' : 'class', 962 | \ 'n' : 'namespace', 963 | \ 'i' : 'interface', 964 | \ 't' : 'trait', 965 | \ } 966 | let type_php.scope2kind = { 967 | \ 'class' : 'c', 968 | \ 'namespace' : 'n', 969 | \ 'interface' : 'i', 970 | \ 'trait' : 't', 971 | \ } 972 | let types.php = type_php 973 | " Protobuf {{{1 974 | let type_protobuf = tagbar#prototypes#typeinfo#new() 975 | let type_protobuf.ctagstype = 'Protobuf' 976 | let type_protobuf.kinds = [ 977 | \ {'short' : 'p', 'long' : 'packages', 'fold' : 0, 'stl' : 0}, 978 | \ {'short' : 'm', 'long' : 'messages', 'fold' : 0, 'stl' : 0}, 979 | \ {'short' : 'f', 'long' : 'fields', 'fold' : 0, 'stl' : 0}, 980 | \ {'short' : 'e', 'long' : 'enum constants', 'fold' : 0, 'stl' : 0}, 981 | \ {'short' : 'g', 'long' : 'enum types', 'fold' : 0, 'stl' : 0}, 982 | \ {'short' : 's', 'long' : 'services', 'fold' : 0, 'stl' : 0}, 983 | \ ] 984 | let types.proto = type_protobuf 985 | " Python {{{1 986 | let type_python = tagbar#prototypes#typeinfo#new() 987 | let type_python.ctagstype = 'python' 988 | let type_python.kinds = [ 989 | \ {'short' : 'i', 'long' : 'modules', 'fold' : 1, 'stl' : 0}, 990 | \ {'short' : 'c', 'long' : 'classes', 'fold' : 0, 'stl' : 1}, 991 | \ {'short' : 'f', 'long' : 'functions', 'fold' : 0, 'stl' : 1}, 992 | \ {'short' : 'm', 'long' : 'members', 'fold' : 0, 'stl' : 1}, 993 | \ {'short' : 'v', 'long' : 'variables', 'fold' : 0, 'stl' : 0} 994 | \ ] 995 | let type_python.sro = '.' 996 | let type_python.kind2scope = { 997 | \ 'c' : 'class', 998 | \ 'f' : 'function', 999 | \ 'm' : 'function' 1000 | \ } 1001 | let type_python.scope2kind = { 1002 | \ 'class' : 'c', 1003 | \ 'function' : 'f' 1004 | \ } 1005 | let type_python.kind2scope.m = 'member' 1006 | let type_python.scope2kind.member = 'm' 1007 | let types.python = type_python 1008 | let types.pyrex = type_python 1009 | let types.cython = type_python 1010 | " R {{{1 1011 | let type_r = tagbar#prototypes#typeinfo#new() 1012 | let type_r.ctagstype = 'R' 1013 | let type_r.kinds = [ 1014 | \ {'short' : 'l', 'long' : 'libraries', 'fold' : 1, 'stl' : 0}, 1015 | \ {'short' : 'f', 'long' : 'functions', 'fold' : 0, 'stl' : 1}, 1016 | \ {'short' : 's', 'long' : 'sources', 'fold' : 0, 'stl' : 0}, 1017 | \ {'short' : 'g', 'long' : 'global variables', 'fold' : 0, 'stl' : 1}, 1018 | \ {'short' : 'v', 'long' : 'function variables', 'fold' : 0, 'stl' : 0}, 1019 | \ ] 1020 | let types.r = type_r 1021 | " ReStructuredText {{{1 1022 | let type_restructuredtext = tagbar#prototypes#typeinfo#new() 1023 | let type_restructuredtext.ctagstype = 'restructuredtext' 1024 | let type_restructuredtext.kinds = [ 1025 | \ {'short' : 'c', 'long' : 'chapter', 'fold' : 0, 'stl' : 1}, 1026 | \ {'short' : 's', 'long' : 'section', 'fold' : 0, 'stl' : 1}, 1027 | \ {'short' : 'S', 'long' : 'subsection', 'fold' : 0, 'stl' : 1}, 1028 | \ {'short' : 't', 'long' : 'subsubsection', 'fold' : 0, 'stl' : 1}, 1029 | \ {'short' : 'T', 'long' : 'l3subsection', 'fold' : 0, 'stl' : 1}, 1030 | \ {'short' : 'u', 'long' : 'l4subsection', 'fold' : 0, 'stl' : 1}, 1031 | \ ] 1032 | let type_restructuredtext.kind2scope = { 1033 | \ 'c' : 'chapter', 1034 | \ 's' : 'section', 1035 | \ 'S' : 'subsection', 1036 | \ 't' : 'subsubsection', 1037 | \ 'T' : 'l3subsection', 1038 | \ 'u' : 'l4subsection', 1039 | \ } 1040 | let type_restructuredtext.scope2kind = { 1041 | \ 'chapter' : 'c', 1042 | \ 'section' : 's', 1043 | \ 'subsection' : 'S', 1044 | \ 'subsubsection' : 't', 1045 | \ 'l3subsection' : 'T', 1046 | \ 'l4subsection' : 'u', 1047 | \ } 1048 | let type_restructuredtext.sro = '""' 1049 | let type_restructuredtext.sort = 0 1050 | let types.rst = type_restructuredtext 1051 | " REXX {{{1 1052 | let type_rexx = tagbar#prototypes#typeinfo#new() 1053 | let type_rexx.ctagstype = 'rexx' 1054 | let type_rexx.kinds = [ 1055 | \ {'short' : 's', 'long' : 'subroutines', 'fold' : 0, 'stl' : 1} 1056 | \ ] 1057 | let types.rexx = type_rexx 1058 | " Ruby {{{1 1059 | let type_ruby = tagbar#prototypes#typeinfo#new() 1060 | let type_ruby.ctagstype = 'ruby' 1061 | let type_ruby.kinds = [ 1062 | \ {'short' : 'm', 'long' : 'modules', 'fold' : 0, 'stl' : 1}, 1063 | \ {'short' : 'c', 'long' : 'classes', 'fold' : 0, 'stl' : 1}, 1064 | \ {'short' : 'f', 'long' : 'methods', 'fold' : 0, 'stl' : 1}, 1065 | \ {'short' : 'S', 'long' : 'singleton methods', 'fold' : 0, 'stl' : 1} 1066 | \ ] 1067 | let type_ruby.sro = '.' 1068 | let type_ruby.kind2scope = { 1069 | \ 'c' : 'class', 1070 | \ 'f' : 'method', 1071 | \ 'm' : 'module' 1072 | \ } 1073 | let type_ruby.scope2kind = { 1074 | \ 'class' : 'c', 1075 | \ 'method' : 'f', 1076 | \ 'module' : 'm' 1077 | \ } 1078 | let types.ruby = type_ruby 1079 | " Rust {{{1 1080 | let type_rust = tagbar#prototypes#typeinfo#new() 1081 | let type_rust.ctagstype = 'rust' 1082 | let type_rust.kinds = [ 1083 | \ {'short' : 'n', 'long' : 'module', 'fold' : 1, 'stl' : 0}, 1084 | \ {'short' : 's', 'long' : 'struct', 'fold' : 0, 'stl' : 1}, 1085 | \ {'short' : 'i', 'long' : 'trait', 'fold' : 0, 'stl' : 1}, 1086 | \ {'short' : 'c', 'long' : 'implementation', 'fold' : 0, 'stl' : 0}, 1087 | \ {'short' : 'f', 'long' : 'function', 'fold' : 0, 'stl' : 1}, 1088 | \ {'short' : 'g', 'long' : 'enum', 'fold' : 0, 'stl' : 1}, 1089 | \ {'short' : 't', 'long' : 'type alias', 'fold' : 0, 'stl' : 1}, 1090 | \ {'short' : 'v', 'long' : 'global variable', 'fold' : 0, 'stl' : 1}, 1091 | \ {'short' : 'M', 'long' : 'macro', 'fold' : 0, 'stl' : 1}, 1092 | \ {'short' : 'm', 'long' : 'struct field', 'fold' : 0, 'stl' : 1}, 1093 | \ {'short' : 'e', 'long' : 'enum variant', 'fold' : 0, 'stl' : 1}, 1094 | \ {'short' : 'P', 'long' : 'method', 'fold' : 0, 'stl' : 1}, 1095 | \ {'short' : 'C', 'long' : 'constant', 'fold' : 0, 'stl' : 0}, 1096 | \ ] 1097 | let type_rust.sro = '::' 1098 | let type_rust.kind2scope = { 1099 | \ 'n' : 'module', 1100 | \ 's' : 'struct', 1101 | \ 'i' : 'interface', 1102 | \ 'c' : 'implementation', 1103 | \ 'f' : 'function', 1104 | \ 'g' : 'enum', 1105 | \ 'P' : 'method', 1106 | \ } 1107 | let type_rust.scope2kind = { 1108 | \ 'module' : 'n', 1109 | \ 'struct' : 's', 1110 | \ 'interface' : 'i', 1111 | \ 'implementation': 'c', 1112 | \ 'function' : 'f', 1113 | \ 'enum' : 'g', 1114 | \ 'method' : 'P', 1115 | \ } 1116 | let types.rust = type_rust 1117 | " Scheme {{{1 1118 | let type_scheme = tagbar#prototypes#typeinfo#new() 1119 | let type_scheme.ctagstype = 'scheme' 1120 | let type_scheme.kinds = [ 1121 | \ {'short' : 'f', 'long' : 'functions', 'fold' : 0, 'stl' : 1}, 1122 | \ {'short' : 's', 'long' : 'sets', 'fold' : 0, 'stl' : 1} 1123 | \ ] 1124 | let types.scheme = type_scheme 1125 | let types.racket = type_scheme 1126 | " Shell script {{{1 1127 | let type_sh = tagbar#prototypes#typeinfo#new() 1128 | let type_sh.ctagstype = 'sh' 1129 | let type_sh.kinds = [ 1130 | \ {'short' : 'f', 'long' : 'functions', 'fold' : 0, 'stl' : 1}, 1131 | \ {'short' : 'a', 'long' : 'aliases', 'fold' : 0, 'stl' : 0}, 1132 | \ {'short' : 's', 'long' : 'script files', 'fold' : 0, 'stl' : 0} 1133 | \ ] 1134 | let types.sh = type_sh 1135 | let types.csh = type_sh 1136 | let types.zsh = type_sh 1137 | " SLang {{{1 1138 | let type_slang = tagbar#prototypes#typeinfo#new() 1139 | let type_slang.ctagstype = 'slang' 1140 | let type_slang.kinds = [ 1141 | \ {'short' : 'n', 'long' : 'namespaces', 'fold' : 0, 'stl' : 1}, 1142 | \ {'short' : 'f', 'long' : 'functions', 'fold' : 0, 'stl' : 1} 1143 | \ ] 1144 | let types.slang = type_slang 1145 | " SML {{{1 1146 | let type_sml = tagbar#prototypes#typeinfo#new() 1147 | let type_sml.ctagstype = 'sml' 1148 | let type_sml.kinds = [ 1149 | \ {'short' : 'e', 'long' : 'exception declarations', 'fold' : 0, 'stl' : 0}, 1150 | \ {'short' : 'f', 'long' : 'function definitions', 'fold' : 0, 'stl' : 1}, 1151 | \ {'short' : 'c', 'long' : 'functor definitions', 'fold' : 0, 'stl' : 1}, 1152 | \ {'short' : 's', 'long' : 'signature declarations', 'fold' : 0, 'stl' : 0}, 1153 | \ {'short' : 'r', 'long' : 'structure declarations', 'fold' : 0, 'stl' : 0}, 1154 | \ {'short' : 't', 'long' : 'type definitions', 'fold' : 0, 'stl' : 1}, 1155 | \ {'short' : 'v', 'long' : 'value bindings', 'fold' : 0, 'stl' : 0} 1156 | \ ] 1157 | let types.sml = type_sml 1158 | " SQL {{{1 1159 | " The SQL ctags parser seems to be buggy for me, so this just uses the 1160 | " normal kinds even though scopes should be available. Improvements 1161 | " welcome! 1162 | let type_sql = tagbar#prototypes#typeinfo#new() 1163 | let type_sql.ctagstype = 'sql' 1164 | let type_sql.kinds = [ 1165 | \ {'short' : 'P', 'long' : 'packages', 'fold' : 1, 'stl' : 1}, 1166 | \ {'short' : 'd', 'long' : 'prototypes', 'fold' : 0, 'stl' : 1}, 1167 | \ {'short' : 'c', 'long' : 'cursors', 'fold' : 0, 'stl' : 1}, 1168 | \ {'short' : 'f', 'long' : 'functions', 'fold' : 0, 'stl' : 1}, 1169 | \ {'short' : 'E', 'long' : 'record fields', 'fold' : 0, 'stl' : 1}, 1170 | \ {'short' : 'L', 'long' : 'block label', 'fold' : 0, 'stl' : 1}, 1171 | \ {'short' : 'p', 'long' : 'procedures', 'fold' : 0, 'stl' : 1}, 1172 | \ {'short' : 's', 'long' : 'subtypes', 'fold' : 0, 'stl' : 1}, 1173 | \ {'short' : 't', 'long' : 'tables', 'fold' : 0, 'stl' : 1}, 1174 | \ {'short' : 'T', 'long' : 'triggers', 'fold' : 0, 'stl' : 1}, 1175 | \ {'short' : 'v', 'long' : 'variables', 'fold' : 0, 'stl' : 1}, 1176 | \ {'short' : 'i', 'long' : 'indexes', 'fold' : 0, 'stl' : 1}, 1177 | \ {'short' : 'e', 'long' : 'events', 'fold' : 0, 'stl' : 1}, 1178 | \ {'short' : 'U', 'long' : 'publications', 'fold' : 0, 'stl' : 1}, 1179 | \ {'short' : 'R', 'long' : 'services', 'fold' : 0, 'stl' : 1}, 1180 | \ {'short' : 'D', 'long' : 'domains', 'fold' : 0, 'stl' : 1}, 1181 | \ {'short' : 'V', 'long' : 'views', 'fold' : 0, 'stl' : 1}, 1182 | \ {'short' : 'n', 'long' : 'synonyms', 'fold' : 0, 'stl' : 1}, 1183 | \ {'short' : 'x', 'long' : 'MobiLink Table Scripts', 'fold' : 0, 'stl' : 1}, 1184 | \ {'short' : 'y', 'long' : 'MobiLink Conn Scripts', 'fold' : 0, 'stl' : 1}, 1185 | \ {'short' : 'z', 'long' : 'MobiLink Properties', 'fold' : 0, 'stl' : 1} 1186 | \ ] 1187 | let types.sql = type_sql 1188 | " Tcl {{{1 1189 | let type_tcl = tagbar#prototypes#typeinfo#new() 1190 | let type_tcl.ctagstype = 'tcl' 1191 | let type_tcl.kinds = [ 1192 | \ {'short' : 'n', 'long' : 'namespaces', 'fold' : 0, 'stl' : 1}, 1193 | \ {'short' : 'p', 'long' : 'procedures', 'fold' : 0, 'stl' : 1} 1194 | \ ] 1195 | let types.tcl = type_tcl 1196 | " TypeScript {{{1 1197 | let type_ts = tagbar#prototypes#typeinfo#new() 1198 | let type_ts.ctagstype = 'typescript' 1199 | let type_ts.kinds = [ 1200 | \ {'short' : 'n', 'long' : 'namespaces', 'fold' : 0, 'stl' : 1}, 1201 | \ {'short' : 'i', 'long' : 'interfaces', 'fold' : 0, 'stl' : 1}, 1202 | \ {'short' : 'g', 'long' : 'enums', 'fold' : 0, 'stl' : 1}, 1203 | \ {'short' : 'e', 'long' : 'enumerations', 'fold' : 0, 'stl' : 1}, 1204 | \ {'short' : 'c', 'long' : 'classes', 'fold' : 0, 'stl' : 1}, 1205 | \ {'short' : 'C', 'long' : 'constants', 'fold' : 0, 'stl' : 1}, 1206 | \ {'short' : 'f', 'long' : 'functions', 'fold' : 0, 'stl' : 1}, 1207 | \ {'short' : 'p', 'long' : 'properties', 'fold' : 0, 'stl' : 1}, 1208 | \ {'short' : 'v', 'long' : 'variables', 'fold' : 0, 'stl' : 1}, 1209 | \ {'short' : 'm', 'long' : 'methods', 'fold' : 0, 'stl' : 1}, 1210 | \ ] 1211 | let type_ts.sro = '.' 1212 | let type_ts.kind2scope = { 1213 | \ 'c' : 'class', 1214 | \ 'i' : 'interface', 1215 | \ 'g' : 'enum', 1216 | \ 'n' : 'namespace', 1217 | \ } 1218 | let type_ts.scope2kind = { 1219 | \ 'class' : 'c', 1220 | \ 'interface' : 'i', 1221 | \ 'enum' : 'g', 1222 | \ 'namespace' : 'n' 1223 | \ } 1224 | let types.typescript = type_ts 1225 | " LaTeX {{{1 1226 | let type_tex = tagbar#prototypes#typeinfo#new() 1227 | let type_tex.ctagstype = 'tex' 1228 | let type_tex.kinds = [ 1229 | \ {'short' : 'i', 'long' : 'includes', 'fold' : 1, 'stl' : 0}, 1230 | \ {'short' : 'p', 'long' : 'parts', 'fold' : 0, 'stl' : 1}, 1231 | \ {'short' : 'c', 'long' : 'chapters', 'fold' : 0, 'stl' : 1}, 1232 | \ {'short' : 's', 'long' : 'sections', 'fold' : 0, 'stl' : 1}, 1233 | \ {'short' : 'u', 'long' : 'subsections', 'fold' : 0, 'stl' : 1}, 1234 | \ {'short' : 'b', 'long' : 'subsubsections', 'fold' : 0, 'stl' : 1}, 1235 | \ {'short' : 'P', 'long' : 'paragraphs', 'fold' : 0, 'stl' : 0}, 1236 | \ {'short' : 'G', 'long' : 'subparagraphs', 'fold' : 0, 'stl' : 0}, 1237 | \ {'short' : 'l', 'long' : 'labels', 'fold' : 0, 'stl' : 0}, 1238 | \ {'short' : 'f', 'long' : 'frames', 'fold' : 0, 'stl' : 1} 1239 | \ ] 1240 | let type_tex.sro = '""' 1241 | let type_tex.kind2scope = { 1242 | \ 'p' : 'part', 1243 | \ 'c' : 'chapter', 1244 | \ 's' : 'section', 1245 | \ 'u' : 'subsection', 1246 | \ 'b' : 'subsubsection' 1247 | \ } 1248 | let type_tex.scope2kind = { 1249 | \ 'part' : 'p', 1250 | \ 'chapter' : 'c', 1251 | \ 'section' : 's', 1252 | \ 'subsection' : 'u', 1253 | \ 'subsubsection' : 'b' 1254 | \ } 1255 | let type_tex.sort = 0 1256 | let types.tex = type_tex 1257 | " Vala {{{1 1258 | " Vala is supported by the ctags fork provided by Anjuta, so only add the 1259 | " type if the fork is used to prevent error messages otherwise 1260 | if has_key(a:supported_types, 'vala') || executable('anjuta-tags') 1261 | let type_vala = tagbar#prototypes#typeinfo#new() 1262 | let type_vala.ctagstype = 'vala' 1263 | let type_vala.kinds = [ 1264 | \ {'short' : 'e', 'long' : 'Enumerations', 'fold' : 0, 'stl' : 1}, 1265 | \ {'short' : 'v', 'long' : 'Enumeration values', 'fold' : 0, 'stl' : 0}, 1266 | \ {'short' : 's', 'long' : 'Structures', 'fold' : 0, 'stl' : 1}, 1267 | \ {'short' : 'i', 'long' : 'Interfaces', 'fold' : 0, 'stl' : 1}, 1268 | \ {'short' : 'd', 'long' : 'Delegates', 'fold' : 0, 'stl' : 1}, 1269 | \ {'short' : 'c', 'long' : 'Classes', 'fold' : 0, 'stl' : 1}, 1270 | \ {'short' : 'p', 'long' : 'Properties', 'fold' : 0, 'stl' : 0}, 1271 | \ {'short' : 'f', 'long' : 'Fields', 'fold' : 0, 'stl' : 0}, 1272 | \ {'short' : 'm', 'long' : 'Methods', 'fold' : 0, 'stl' : 1}, 1273 | \ {'short' : 'E', 'long' : 'Error domains', 'fold' : 0, 'stl' : 1}, 1274 | \ {'short' : 'r', 'long' : 'Error codes', 'fold' : 0, 'stl' : 1}, 1275 | \ {'short' : 'S', 'long' : 'Signals', 'fold' : 0, 'stl' : 1} 1276 | \ ] 1277 | let type_vala.sro = '.' 1278 | " 'enum' doesn't seem to be used as a scope, but it can't hurt to have 1279 | " it here 1280 | let type_vala.kind2scope = { 1281 | \ 's' : 'struct', 1282 | \ 'i' : 'interface', 1283 | \ 'c' : 'class', 1284 | \ 'e' : 'enum' 1285 | \ } 1286 | let type_vala.scope2kind = { 1287 | \ 'struct' : 's', 1288 | \ 'interface' : 'i', 1289 | \ 'class' : 'c', 1290 | \ 'enum' : 'e' 1291 | \ } 1292 | let types.vala = type_vala 1293 | endif 1294 | if !has_key(a:supported_types, 'vala') && executable('anjuta-tags') 1295 | let types.vala.ctagsbin = 'anjuta-tags' 1296 | endif 1297 | " Vera {{{1 1298 | " Why are variables 'virtual'? 1299 | let type_vera = tagbar#prototypes#typeinfo#new() 1300 | let type_vera.ctagstype = 'vera' 1301 | let type_vera.kinds = [ 1302 | \ {'short' : 'h', 'long' : 'header files', 'fold' : 1, 'stl' : 0}, 1303 | \ {'short' : 'd', 'long' : 'macros', 'fold' : 1, 'stl' : 0}, 1304 | \ {'short' : 'g', 'long' : 'enums', 'fold' : 0, 'stl' : 1}, 1305 | \ {'short' : 'T', 'long' : 'typedefs', 'fold' : 0, 'stl' : 0}, 1306 | \ {'short' : 'i', 'long' : 'interfaces', 'fold' : 0, 'stl' : 1}, 1307 | \ {'short' : 'c', 'long' : 'classes', 'fold' : 0, 'stl' : 1}, 1308 | \ {'short' : 'e', 'long' : 'enumerators', 'fold' : 0, 'stl' : 0}, 1309 | \ {'short' : 'm', 'long' : 'members', 'fold' : 0, 'stl' : 1}, 1310 | \ {'short' : 'f', 'long' : 'functions', 'fold' : 0, 'stl' : 1}, 1311 | \ {'short' : 's', 'long' : 'signals', 'fold' : 0, 'stl' : 0}, 1312 | \ {'short' : 't', 'long' : 'tasks', 'fold' : 0, 'stl' : 1}, 1313 | \ {'short' : 'v', 'long' : 'variables', 'fold' : 0, 'stl' : 0}, 1314 | \ {'short' : 'p', 'long' : 'programs', 'fold' : 0, 'stl' : 1} 1315 | \ ] 1316 | let type_vera.sro = '.' " Nesting doesn't seem to be possible 1317 | let type_vera.kind2scope = { 1318 | \ 'g' : 'enum', 1319 | \ 'c' : 'class', 1320 | \ 'v' : 'virtual' 1321 | \ } 1322 | let type_vera.scope2kind = { 1323 | \ 'enum' : 'g', 1324 | \ 'class' : 'c', 1325 | \ 'virtual' : 'v' 1326 | \ } 1327 | let types.vera = type_vera 1328 | " Verilog {{{1 1329 | let type_verilog = tagbar#prototypes#typeinfo#new() 1330 | let type_verilog.ctagstype = 'verilog' 1331 | let type_verilog.kinds = [ 1332 | \ {'short' : 'c', 'long' : 'constants', 'fold' : 0, 'stl' : 0}, 1333 | \ {'short' : 'e', 'long' : 'events', 'fold' : 0, 'stl' : 1}, 1334 | \ {'short' : 'f', 'long' : 'functions', 'fold' : 0, 'stl' : 1}, 1335 | \ {'short' : 'm', 'long' : 'modules', 'fold' : 0, 'stl' : 1}, 1336 | \ {'short' : 'b', 'long' : 'blocks', 'fold' : 0, 'stl' : 1}, 1337 | \ {'short' : 'n', 'long' : 'net data types', 'fold' : 0, 'stl' : 1}, 1338 | \ {'short' : 'p', 'long' : 'ports', 'fold' : 0, 'stl' : 1}, 1339 | \ {'short' : 'r', 'long' : 'register data types', 'fold' : 0, 'stl' : 1}, 1340 | \ {'short' : 't', 'long' : 'tasks', 'fold' : 0, 'stl' : 1} 1341 | \ ] 1342 | let types.verilog = type_verilog 1343 | " SystemVerilog {{{1 1344 | let type_systemverilog = tagbar#prototypes#typeinfo#new() 1345 | let type_systemverilog.ctagstype = 'systemverilog' 1346 | let type_systemverilog.kinds = [ 1347 | \ {'short' : 'A', 'long' : 'assertions', 'fold' : 0, 'stl' : 1}, 1348 | \ {'short' : 'C', 'long' : 'class', 'fold' : 0, 'stl' : 1}, 1349 | \ {'short' : 'E', 'long' : 'enum', 'fold' : 0, 'stl' : 1}, 1350 | \ {'short' : 'H', 'long' : 'checkers', 'fold' : 0, 'stl' : 1}, 1351 | \ {'short' : 'I', 'long' : 'interfaces', 'fold' : 0, 'stl' : 1}, 1352 | \ {'short' : 'K', 'long' : 'packages', 'fold' : 1, 'stl' : 0}, 1353 | \ {'short' : 'L', 'long' : 'clokcing', 'fold' : 0, 'stl' : 1}, 1354 | \ {'short' : 'M', 'long' : 'modports', 'fold' : 0, 'stl' : 1}, 1355 | \ {'short' : 'N', 'long' : 'nettype', 'fold' : 0, 'stl' : 0}, 1356 | \ {'short' : 'O', 'long' : 'constraints', 'fold' : 0, 'stl' : 1}, 1357 | \ {'short' : 'P', 'long' : 'programs', 'fold' : 0, 'stl' : 1}, 1358 | \ {'short' : 'Q', 'long' : 'prototypes', 'fold' : 0, 'stl' : 1}, 1359 | \ {'short' : 'R', 'long' : 'properties', 'fold' : 0, 'stl' : 1}, 1360 | \ {'short' : 'S', 'long' : 'structs and unions', 'fold' : 0, 'stl' : 1}, 1361 | \ {'short' : 'T', 'long' : 'type declarations', 'fold' : 0, 'stl' : 1}, 1362 | \ {'short' : 'V', 'long' : 'covergroups', 'fold' : 0, 'stl' : 1}, 1363 | \ {'short' : 'b', 'long' : 'blocks', 'fold' : 0, 'stl' : 1}, 1364 | \ {'short' : 'c', 'long' : 'constants', 'fold' : 0, 'stl' : 0}, 1365 | \ {'short' : 'd', 'long' : 'text macros', 'fold' : 0, 'stl' : 1}, 1366 | \ {'short' : 'e', 'long' : 'events', 'fold' : 0, 'stl' : 1}, 1367 | \ {'short' : 'f', 'long' : 'functions', 'fold' : 0, 'stl' : 1}, 1368 | \ {'short' : 'i', 'long' : 'module or interface', 'fold' : 0, 'stl' : 1}, 1369 | \ {'short' : 'l', 'long' : 'interface class', 'fold' : 0, 'stl' : 1}, 1370 | \ {'short' : 'm', 'long' : 'module', 'fold' : 0, 'stl' : 1}, 1371 | \ {'short' : 'n', 'long' : 'net data types', 'fold' : 0, 'stl' : 0}, 1372 | \ {'short' : 'p', 'long' : 'ports', 'fold' : 1, 'stl' : 1}, 1373 | \ {'short' : 'q', 'long' : 'sequences', 'fold' : 0, 'stl' : 1}, 1374 | \ {'short' : 'r', 'long' : 'variable data types', 'fold' : 1, 'stl' : 1}, 1375 | \ {'short' : 't', 'long' : 'tasks', 'fold' : 0, 'stl' : 1}, 1376 | \ {'short' : 'w', 'long' : 'members', 'fold' : 0, 'stl' : 1} 1377 | \ ] 1378 | let type_systemverilog.sro = '.' " Nesting doesn't seem to be possible 1379 | let type_systemverilog.kind2scope = { 1380 | \ 'E' : 'enum', 1381 | \ 'C' : 'class', 1382 | \ 'm' : 'module', 1383 | \ 'P' : 'program', 1384 | \ 'K' : 'package', 1385 | \ 'I' : 'interface', 1386 | \ } 1387 | let type_systemverilog.scope2kind = { 1388 | \ 'enum' : 'E', 1389 | \ 'class' : 'C', 1390 | \ 'module' : 'm', 1391 | \ 'program' : 'P', 1392 | \ 'package' : 'K', 1393 | \ 'interface': 'I', 1394 | \ } 1395 | let types.systemverilog = type_systemverilog 1396 | " VHDL {{{1 1397 | " The VHDL ctags parser unfortunately doesn't generate proper scopes 1398 | let type_vhdl = tagbar#prototypes#typeinfo#new() 1399 | let type_vhdl.ctagstype = 'vhdl' 1400 | let type_vhdl.kinds = [ 1401 | \ {'short' : 'P', 'long' : 'packages', 'fold' : 1, 'stl' : 0}, 1402 | \ {'short' : 'c', 'long' : 'constants', 'fold' : 0, 'stl' : 0}, 1403 | \ {'short' : 't', 'long' : 'types', 'fold' : 0, 'stl' : 1}, 1404 | \ {'short' : 'T', 'long' : 'subtypes', 'fold' : 0, 'stl' : 1}, 1405 | \ {'short' : 'r', 'long' : 'records', 'fold' : 0, 'stl' : 1}, 1406 | \ {'short' : 'e', 'long' : 'entities', 'fold' : 0, 'stl' : 1}, 1407 | \ {'short' : 'f', 'long' : 'functions', 'fold' : 0, 'stl' : 1}, 1408 | \ {'short' : 'p', 'long' : 'procedures', 'fold' : 0, 'stl' : 1} 1409 | \ ] 1410 | let types.vhdl = type_vhdl 1411 | " Vim {{{1 1412 | let type_vim = tagbar#prototypes#typeinfo#new() 1413 | let type_vim.ctagstype = 'vim' 1414 | let type_vim.kinds = [ 1415 | \ {'short' : 'n', 'long' : 'vimball filenames', 'fold' : 0, 'stl' : 1}, 1416 | \ {'short' : 'v', 'long' : 'variables', 'fold' : 1, 'stl' : 0}, 1417 | \ {'short' : 'f', 'long' : 'functions', 'fold' : 0, 'stl' : 1}, 1418 | \ {'short' : 'a', 'long' : 'autocommand groups', 'fold' : 1, 'stl' : 1}, 1419 | \ {'short' : 'c', 'long' : 'commands', 'fold' : 0, 'stl' : 0}, 1420 | \ {'short' : 'm', 'long' : 'maps', 'fold' : 1, 'stl' : 0} 1421 | \ ] 1422 | let types.vim = type_vim 1423 | " YACC {{{1 1424 | let type_yacc = tagbar#prototypes#typeinfo#new() 1425 | let type_yacc.ctagstype = 'yacc' 1426 | let type_yacc.kinds = [ 1427 | \ {'short' : 'l', 'long' : 'labels', 'fold' : 0, 'stl' : 1} 1428 | \ ] 1429 | let types.yacc = type_yacc 1430 | " }}}1 1431 | 1432 | for [type, typeinfo] in items(types) 1433 | let typeinfo.ftype = type 1434 | endfor 1435 | 1436 | for typeinfo in values(types) 1437 | call typeinfo.createKinddict() 1438 | endfor 1439 | 1440 | return types 1441 | endfunction 1442 | 1443 | " vim: ts=8 sw=4 sts=4 et foldenable foldmethod=marker foldcolumn=1 1444 | -------------------------------------------------------------------------------- /plugin/tagbar.vim: -------------------------------------------------------------------------------- 1 | " ============================================================================ 2 | " File: tagbar.vim 3 | " Description: List the current file's tags in a sidebar, ordered by class etc 4 | " Author: Jan Larres 5 | " Licence: Vim licence 6 | " Website: https://preservim.github.io/tagbar 7 | " Version: 3.1.1 8 | " Note: This plugin was heavily inspired by the 'Taglist' plugin by 9 | " Yegappan Lakshmanan and uses a small amount of code from it. 10 | " 11 | " Original taglist copyright notice: 12 | " Permission is hereby granted to use and distribute this code, 13 | " with or without modifications, provided that this copyright 14 | " notice is copied with it. Like anything else that's free, 15 | " taglist.vim is provided *as is* and comes with no warranty of 16 | " any kind, either expressed or implied. In no event will the 17 | " copyright holder be liable for any damamges resulting from the 18 | " use of this software. 19 | " ============================================================================ 20 | 21 | scriptencoding utf-8 22 | 23 | if &compatible || exists('g:loaded_tagbar') 24 | finish 25 | endif 26 | 27 | " Basic init {{{1 28 | 29 | if v:version < 700 30 | echohl WarningMsg 31 | echomsg 'Tagbar: Vim version is too old, Tagbar requires at least 7.0' 32 | echohl None 33 | finish 34 | endif 35 | 36 | if v:version == 700 && !has('patch167') 37 | echohl WarningMsg 38 | echomsg 'Tagbar: Vim versions lower than 7.0.167 have a bug' 39 | \ 'that prevents this version of Tagbar from working.' 40 | \ 'Please use the alternate version posted on the website.' 41 | echohl None 42 | finish 43 | endif 44 | 45 | function! s:init_var(var, value) abort 46 | if !exists('g:tagbar_' . a:var) 47 | execute 'let g:tagbar_' . a:var . ' = ' . string(a:value) 48 | endif 49 | endfunction 50 | 51 | function! s:setup_options() abort 52 | if exists('g:tagbar_position') 53 | " Map older deprecated values to correct values 54 | if g:tagbar_position ==# 'top' 55 | let g:tagbar_position = 'leftabove' 56 | elseif g:tagbar_position ==# 'bottom' 57 | let g:tagbar_position = 'rightbelow' 58 | elseif g:tagbar_position ==# 'left' 59 | let g:tagbar_position = 'topleft vertical' 60 | elseif g:tagbar_position ==# 'right' 61 | let g:tagbar_position = 'botright vertical' 62 | endif 63 | if g:tagbar_position !~# 'vertical' 64 | let previewwin_pos = 'rightbelow vertical' 65 | else 66 | let previewwin_pos = 'topleft' 67 | endif 68 | let default_pos = g:tagbar_position 69 | else 70 | if exists('g:tagbar_vertical') && g:tagbar_vertical > 0 71 | let previewwin_pos = 'rightbelow vertical' 72 | if exists('g:tagbar_left') && g:tagbar_left 73 | let default_pos = 'leftabove' 74 | else 75 | let default_pos = 'rightbelow' 76 | endif 77 | let g:tagbar_height = g:tagbar_vertical 78 | elseif exists('g:tagbar_left') && g:tagbar_left 79 | let previewwin_pos = 'topleft' 80 | let default_pos = 'topleft vertical' 81 | else 82 | let previewwin_pos = 'topleft' 83 | let default_pos = 'botright vertical' 84 | endif 85 | endif 86 | let options = [ 87 | \ ['autoclose', 0], 88 | \ ['autoclose_netrw', 0], 89 | \ ['autofocus', 0], 90 | \ ['autopreview', 0], 91 | \ ['autoshowtag', 0], 92 | \ ['case_insensitive', 0], 93 | \ ['compact', 0], 94 | \ ['expand', 0], 95 | \ ['file_size_limit', 0], 96 | \ ['foldlevel', 99], 97 | \ ['hide_nonpublic', 0], 98 | \ ['height', 10], 99 | \ ['indent', 2], 100 | \ ['jump_offset', 0], 101 | \ ['jump_lazy_scroll', 0], 102 | \ ['left', 0], 103 | \ ['help_visibility', 0], 104 | \ ['highlight_follow_insert', 0], 105 | \ ['highlight_method', 'nearest-stl'], 106 | \ ['ignore_anonymous', 0], 107 | \ ['no_autocmds', 0], 108 | \ ['position', default_pos], 109 | \ ['previewwin_pos', previewwin_pos], 110 | \ ['scopestrs', {}], 111 | \ ['scrolloff', 0], 112 | \ ['show_balloon', 1], 113 | \ ['show_data_type', 0], 114 | \ ['show_visibility', 1], 115 | \ ['show_linenumbers', 0], 116 | \ ['show_prefix', 1], 117 | \ ['show_suffix', 1], 118 | \ ['show_tag_count', 0], 119 | \ ['show_tag_linenumbers', 0], 120 | \ ['singleclick', 0], 121 | \ ['sort', 1], 122 | \ ['systemenc', &encoding], 123 | \ ['vertical', 0], 124 | \ ['width', 40], 125 | \ ['zoomwidth', 1], 126 | \ ['silent', 0], 127 | \ ['use_cache', 1], 128 | \ ['wrap', 0], 129 | \ ] 130 | 131 | for [opt, val] in options 132 | call s:init_var(opt, val) 133 | unlet val 134 | endfor 135 | endfunction 136 | call s:setup_options() 137 | 138 | if !exists('g:tagbar_iconchars') 139 | if has('multi_byte') && has('unix') && &encoding ==# 'utf-8' && 140 | \ (!exists('+termencoding') || empty(&termencoding) || &termencoding ==# 'utf-8') 141 | let g:tagbar_iconchars = ['▸', '▾'] 142 | else 143 | let g:tagbar_iconchars = ['+', '-'] 144 | endif 145 | endif 146 | 147 | function! s:setup_keymaps() abort 148 | let keymaps = [ 149 | \ ['jump', ''], 150 | \ ['preview', 'p'], 151 | \ ['previewwin', 'P'], 152 | \ ['nexttag', ''], 153 | \ ['prevtag', ''], 154 | \ ['showproto', ''], 155 | \ ['hidenonpublic', 'v'], 156 | \ 157 | \ ['openfold', ['+', '', 'zo']], 158 | \ ['closefold', ['-', '', 'zc']], 159 | \ ['togglefold', ['o', 'za']], 160 | \ ['openallfolds', ['*', '', 'zR']], 161 | \ ['closeallfolds', ['=', 'zM']], 162 | \ ['incrementfolds', ['zr']], 163 | \ ['decrementfolds', ['zm']], 164 | \ ['nextfold', 'zj'], 165 | \ ['prevfold', 'zk'], 166 | \ 167 | \ ['togglesort', 's'], 168 | \ ['togglecaseinsensitive', 'i'], 169 | \ ['toggleautoclose', 'c'], 170 | \ ['togglepause', 't'], 171 | \ ['zoomwin', 'x'], 172 | \ ['close', 'q'], 173 | \ ['help', ['', '?']], 174 | \ ] 175 | 176 | for [map, key] in keymaps 177 | call s:init_var('map_' . map, key) 178 | unlet key 179 | endfor 180 | endfunction 181 | call s:setup_keymaps() 182 | 183 | augroup TagbarSession 184 | autocmd! 185 | autocmd SessionLoadPost * nested call tagbar#RestoreSession() 186 | augroup END 187 | 188 | " Commands {{{1 189 | command! -nargs=? Tagbar call tagbar#ToggleWindow() 190 | command! -nargs=? TagbarToggle call tagbar#ToggleWindow() 191 | command! -nargs=? TagbarOpen call tagbar#OpenWindow() 192 | command! -nargs=0 TagbarOpenAutoClose call tagbar#OpenWindow('fcj') 193 | command! -nargs=0 TagbarClose call tagbar#CloseWindow() 194 | command! -nargs=1 -bang TagbarSetFoldlevel call tagbar#SetFoldLevel(, 0) 195 | command! -nargs=0 TagbarShowTag call tagbar#highlighttag(1, 1) 196 | command! -nargs=* TagbarCurrentTag echo tagbar#currenttag('%s', 'No current tag', ) 197 | command! -nargs=1 TagbarGetTypeConfig call tagbar#gettypeconfig() 198 | command! -nargs=? TagbarDebug call tagbar#debug#start_debug() 199 | command! -nargs=0 TagbarDebugEnd call tagbar#debug#stop_debug() 200 | command! -nargs=0 TagbarTogglePause call tagbar#toggle_pause() 201 | command! -nargs=0 TagbarForceUpdate call tagbar#ForceUpdate() 202 | command! -nargs=0 TagbarJump call tagbar#jump() 203 | command! -nargs=0 TagbarJumpPrev call tagbar#jumpToNearbyTag(-1) 204 | command! -nargs=0 TagbarJumpNext call tagbar#jumpToNearbyTag(1) 205 | 206 | 207 | " Modeline {{{1 208 | " vim: ts=8 sw=4 sts=4 et foldenable foldmethod=marker foldcolumn=1 209 | -------------------------------------------------------------------------------- /syntax/tagbar.vim: -------------------------------------------------------------------------------- 1 | " File: tagbar.vim 2 | " Description: Tagbar syntax settings 3 | " Author: Jan Larres 4 | " Licence: Vim licence 5 | " Website: https://preservim.github.io/tagbar 6 | " Version: 3.1.1 7 | 8 | scriptencoding utf-8 9 | 10 | if exists('b:current_syntax') 11 | finish 12 | endif 13 | 14 | let s:ics = escape(join(g:tagbar_iconchars, ''), ']^\-') 15 | 16 | let s:pattern = '\(^[' . s:ics . '] \?\)\@3<=[^-+: ]\+[^:]\+$' 17 | execute "syntax match TagbarKind '" . s:pattern . "'" 18 | 19 | let s:pattern = '\(\S\@