Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

ctags With Swift [snippet]

DZone's Guide to

ctags With Swift [snippet]

Check out Rob Allen's list of .ctags that he has added to his file to support Swift.

· Mobile Zone
Free Resource

Get gorgeous, multi-touch charts for your iOS application with just a few lines of code.

I always seem to end up in vim sooner or later, and I use Tim Pope's excellent Effortless Ctags with Git process to keep my ctags file up to date for my projects.

As I'm now coding in Swift too, I needed ctags to support Swift. This is what I've added to my .ctags file:

--langdef=Swift 
--langmap=Swift:+.swift 
--regex-swift=/(var|let)[ \t]+([^:=]+).*$/\2/,variable/ 
--regex-swift=/func[ \t]+([^\(\)]+)\([^\(\)]*\)/\1/,function/ 
--regex-swift=/class[ \t]+([^:\{]+).*$/\1/,class/ 
--regex-swift=/protocol[ \t]+([^:\{]+).*$/\1/,protocol/

Any improvements, welcome!

vim.swift

As I'm writing about Swift and vim, I should also point out that the vim-swift plugin by Kevin Ballard is a must-have!

Related Refcard:

.Net developers: use Highcards, the industry's leading interactive charting library, without writing a single line of JavaScript.

Topics:
process ,pope ,git ,file ,plugin ,project ,swift ,improvements

Published at DZone with permission of Rob Allen, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

THE DZONE NEWSLETTER

Dev Resources & Solutions Straight to Your Inbox

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.

X

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}