Skip to content

Instantly share code, notes, and snippets.

@sgur
Last active December 11, 2022 12:35
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save sgur/5711308 to your computer and use it in GitHub Desktop.
Save sgur/5711308 to your computer and use it in GitHub Desktop.
Delphi 用 .ctags
--c-kinds=+p
--c++-kinds=+p
--fields=+liaS
--extra=+q
--jcode=utf8
--langdef=delphi
--langmap=delphi:.pas
--regex-delphi=/(\w+)\s*=\s*\(\s*\w\s*\)/\1/t,Type/
--regex-delphi=/(\w+)\s*=\s*class\s*[^;]*$/\1/c,Class/
--regex-delphi=/^constructor\s+(T[a-zA-Z0-9_]+(<[a-zA-Z0-9_, ]+>)?\.)([a-zA-Z0-9_<>, ]+)(.*)+/\1\3/n,Constructor/
--regex-delphi=/^destructor\s+(T[a-zA-Z0-9_]+(<[a-zA-Z0-9_, ]+>)?\.)([a-zA-Z0-9_<>, ]+)(.*)+/\1\3/d,Destructor/
--regex-delphi=/^(procedure|function)\s+T[a-zA-Z0-9_<>, ]+\.([a-zA-Z0-9_<>, ]+)(.*)/\2/m,Method/
--regex-delphi=/^procedure\s+([a-zA-Z0-9_<>, ]+)[;(]/\1/p,Procedure/
--regex-delphi=/^function\s+([a-zA-Z0-9_<>, ]+)[;(]/\1/f,Function/
--regex-delphi=/^(uses|interface|implementation)$/\1/s,Section/
let g:tagbar_type_pascal = {
\ 'ctagstype' : 'delphi',
\ 'kinds' : [
\ 't:Type',
\ 'c:Class',
\ 'n:Constructor',
\ 'd:Destructor',
\ 'm:Method',
\ 'f:Function',
\ 'p:Procedure',
\ 's:Section',
\ ],
\ }
@dubst3pp4
Copy link

Thank you so much for this tip! I was wondering why the tagbar plugin did not generated the tags for my Free Pascal projects.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment