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
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Related

  • Swift: Master of Decoding Messy JSON
  • Unlocking the Power of Reflection in Mobile Development
  • Advanced Usage of Decodable in Swift: Handling Dynamic Keys
  • A Developer’s Guide to Multithreading and Swift Concurrency

Trending

  • Engineering Closed-Loop Graph-RAG Systems, Part 2: From Prompts to Rules
  • I Reverse-Engineered 50 API Breaches. The Same Five Mistakes Keep Appearing.
  • A Deep Dive into Tracing Agentic Workflows (Part 2)
  • Engineering Closed-Loop Graph-RAG Systems, Part 3: Closing the Loop in Graph-RAG Systems
  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 user avatar
Rob Allen
·
Jul. 07, 16 · Code Snippet
Likes (1)
Comment
Save
Tweet
Share
3.1K Views

Join the DZone community and get the full member experience.

Join For Free

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

  • Swift: Master of Decoding Messy JSON
  • Unlocking the Power of Reflection in Mobile Development
  • Advanced Usage of Decodable in Swift: Handling Dynamic Keys
  • A Developer’s Guide to Multithreading and Swift Concurrency

Partner Resources

×

Comments

The likes didn't load as expected. Please refresh the page and try again.

  • 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