DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Newsletter
Log In / Join
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Related

  • How to Break Up Swift Concurrency
  • Swift: Master of Decoding Messy JSON
  • Unlocking the Power of Reflection in Mobile Development
  • Advanced Usage of Decodable in Swift: Handling Dynamic Keys

Trending

  • Applying Microservices Lessons to Multi-Agent AI Systems
  • Why Kotlin or Java Is the Wrong Question For Enterprises
  • When RabbitMQ Accepts a Message but Does Not Route It to a Queue
  • Beyond the Wall of Charts: How Advanced Observability Displaced the Telemetry Dashboard

Draft This article hasn't been published, so readers can't see it.

In moderation This article is waiting for review, so readers can't see it yet.

Deleted This article has been deleted, so readers can't see it.

  1. DZone
  2. Coding
  3. Frameworks
  4. ctags With Swift [snippet]

ctags With Swift [snippet]

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

By 
Rob Allen
·
Jul. 07, 16 · Code Snippet
Post on X (opens in a new tab) Share on LinkedIn (opens in a new tab)
3.2K Views

Join the DZone community Save articles, join the discussion, and download Refcards and Trend Reports with a free account.

Join for free Already a member? Log in

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:

Swift Essentials

Swift (programming language)

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

Opinions expressed by DZone contributors are their own.

Related

  • How to Break Up Swift Concurrency
  • Swift: Master of Decoding Messy JSON
  • Unlocking the Power of Reflection in Mobile Development
  • Advanced Usage of Decodable in Swift: Handling Dynamic Keys

Partner Resources

×

Comments

Loading comments

The comments didn't load

Please try again in a moment.

Likes

Loading

The next likes didn't load. Please try again.

The likes didn't load

Please try again in a moment.

See who liked this

Log in or join DZone for free to see who liked this article.

Log in Join for free
  • RSS
  • X
  • Facebook

ABOUT US

  • About DZone
  • Support and feedback
  • Community research

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 215
  • Nashville, TN 37211
  • [email protected]

Let's be friends:

  • RSS
  • X
  • Facebook