Skip to content

Commit 5b5eb2e

Browse files
author
Keith Smiley
committed
Merge pull request #95 from keith/kylef/ctags
Add ctags and Tagbar configuration
2 parents 59282ab + 5d5f814 commit 5b5eb2e

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

ctags/swift.cnf

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
--langdef=swift
2+
--langmap=swift:.swift
3+
--regex-swift=/[[:<:]]class[[:>:]][[:space:]]+([[:alnum:]_]+)/\1/c,class/
4+
--regex-swift=/[[:<:]]enum[[:>:]][[:space:]]+([[:alnum:]_]+)/\1/e,enum/
5+
--regex-swift=/[[:<:]]func[[:>:]][[:space:]]+([[:alnum:]_]+)/\1/f,function/
6+
--regex-swift=/[[:<:]]protocol[[:>:]][[:space:]]+([[:alnum:]_]+)/\1/P,protocol/
7+
--regex-swift=/[[:<:]]struct[[:>:]][[:space:]]+([[:alnum:]_]+)/\1/s,struct/
8+
--regex-swift=/[[:<:]]extension[[:>:]][[:space:]]+([[:alnum:]_]+)/\1/E,extension/
9+
--regex-swift=/[[:<:]]typealias[[:>:]][[:space:]]+([[:alnum:]_]+)/\1/t,typealias/

plugin/swift.vim

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
let g:tagbar_type_swift = {
2+
\ 'ctagstype': 'swift',
3+
\ 'kinds': [
4+
\ 'P:protocol',
5+
\ 'c:class',
6+
\ 's:struct',
7+
\ 'e:enum',
8+
\ 'E:extension',
9+
\ 'f:function',
10+
\ 't:typealias'
11+
\ ],
12+
\ 'sort': 0,
13+
\ 'deffile': expand('<sfile>:p:h:h') . '/ctags/swift.cnf'
14+
\ }

0 commit comments

Comments
 (0)