Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. Swift
  3. swift-mode

swift-mode

GPL-3.0Emacs Lispv10.0.0

An Emacs major mode providing syntax highlighting, indentation, and development tools for Apple's Swift programming language.

GitHubGitHub
380 stars46 forks0 contributors

What is swift-mode?

swift-mode is an Emacs major mode that provides comprehensive editing support for Apple's Swift programming language. It includes syntax highlighting, intelligent indentation, code navigation tools, and integrated development features like a REPL, building, and debugging. It solves the problem of editing Swift code efficiently within the Emacs editor.

Target Audience

Emacs users who develop in Swift, including those working on iOS, macOS, or server-side Swift projects and seeking a powerful, customizable editing environment.

Value Proposition

Developers choose swift-mode for its deep integration with Emacs workflows, offering a native-feeling editing experience for Swift with tools for building, debugging, and interactive development, all within a highly extensible editor.

Overview

Emacs support for Apple's Swift programming language.

Use Cases

Best For

  • Editing Swift source code in Emacs with syntax highlighting
  • Navigating Swift codebases using structural editing commands
  • Running a Swift REPL interactively within an Emacs buffer
  • Building and debugging Swift modules directly from Emacs
  • Developing iOS applications with integrated build and debug tools
  • Writing Swift code with context-aware automatic indentation

Not Ideal For

  • Developers using Xcode or other full-featured IDEs with native Swift support
  • Teams requiring flawless indentation for complex Swift syntax patterns, such as those with nested conditional operators
  • Projects that rely on integrated linting and error checking without additional package installation
  • Swift codebases heavily using older Swift 3.0 constructs like C-style for-loops

Pros & Cons

Pros

Robust Syntax Highlighting

Provides comprehensive font lock for Swift syntax elements, ensuring clear visual differentiation in code as part of core features.

Smart Indentation Engine

Offers context-aware indentation with support for complex expressions and nested blocks, demonstrated in the README with examples like Utrecht style.

Integrated Development Tools

Includes commands for running a Swift REPL, building modules and iOS apps, and debugging directly from Emacs via M-x functions.

Structural Code Navigation

Enables efficient movement and manipulation with Emacs-native functions like beginning-of-defun and narrow-to-defun for better code exploration.

Cons

Indentation Ambiguities

Admits inaccuracies in indenting complex cases like conditional operators and regexp literals, requiring manual adjustments as documented in limitations.

Limited Modern Syntax Support

Does not fully support some older Swift 3.0 constructs and has edge cases with newer syntax, such as issues with colons and custom operators.

Additional Setup Required

Lacks built-in flycheck; users must install separate packages like flycheck-swift for linting, adding to initial configuration effort.

Frequently Asked Questions

Quick Stats

Stars380
Forks46
Contributors0
Open Issues5
Last commit24 days ago
CreatedSince 2014

Tags

#emacs#syntax-highlighting#emacs-mode#repl#major-mode#editor-support#ios-development#emacs-lisp#swift#debugging#swift-programming-language#elisp

Built With

E
Emacs Lisp

Included in

Swift26.0k
Auto-fetched 10 hours ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub