Skip to content

Instantly share code, notes, and snippets.

@cds-amal
Forked from shuangjj/ctags-solidity
Created January 25, 2018 12:26
Show Gist options
  • Save cds-amal/ac7ee27d539bc2570b7ccaa89e6d9dcd to your computer and use it in GitHub Desktop.
Save cds-amal/ac7ee27d539bc2570b7ccaa89e6d9dcd to your computer and use it in GitHub Desktop.
vim ~/.ctags
--langdef=Solidity
--langmap=Solidity:.sol
--regex-Solidity=/^contract[ \t]+([a-zA-Z0-9_]+)/\1/c,contract/
--regex-Solidity=/[ \t]*function[ \t]+([a-zA-Z0-9_]+)/\1/f,function/
--regex-Solidity=/[ \t]*event[ \t]+([a-zA-Z0-9_]+)/\1/e,event/
--regex-Solidity=/[ \t]*(struct[ \t]+[a-zA-Z0-9_]+)([ \t]*\{)/\1/v,variable/
--regex-Solidity=/[ \t]*(enum[ \t]+[a-zA-Z0-9_]+)([ \t]*\{)/\1/v,variable/
--regex-Solidity=/[ \t]*mapping[ \t]+\(([a-zA-Z0-9_]+)[ \t]*=>[ \t]*([a-zA-Z0-9_]+)\)[ \t]+([a-zA-Z0-9_]+)/\3 (\1=>\2)/m,mapping/
vim ~/.vimrc
let g:tagbar_type_solidity = {
\ 'ctagstype': 'solidity',
\ 'kinds' : [
\ 'c:contracts',
\ 'e:events',
\ 'f:functions',
\ 'm:mappings',
\ 'v:varialbes',
\ ]
\ }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment