Using Zed and Swift Beyond App Development
Aug 9, 2026 - ⧖ 3.0 minAlso available in: Português
2026: the last year of the human programmer...
It's a joke! 2026 is just another year in a capitalist society, and we need to survive. Be strong, my friends.
After 12 years of iOS programming, I've learned a lot of Swift, and I started thinking: why should I use other languages to write CLIs and other solutions? Yeah, Python, I love you, but my first love was Swift.
It's common for mobile developers not to view Swift as a general-purpose language, or as a way to write scripts or CLI tools to support and solve other kinds of problems. When we think about Swift, we often don't connect it with Linux and CI development, but that is no longer true in 2026. The community and the language have moved to create a new ecosystem for non-mobile use, making this an amazing moment for the community to accelerate adoption.
But the main hurdle for many developers is the IDE. Xcode is traditionally viewed as an IDE solely for mobile developers—or at least, that is the mainstream feeling. However, to my surprise, setting up the Zed editor for Swift is extremely simple!
Using swiftly and Zed, your environment will be fully ready to build CLI tools and Web Apps with Swift. Here is a quick guide on how to get started.
1. Installing Swift with Swiftly
swiftly is a modern and lightweight toolchain manager for Swift. It makes it incredibly easy to install, manage, and switch between different Swift versions on your system.
Installation
To install swiftly, run the following command in your terminal:
curl -sSf https://swift-server.github.io/swiftly/swiftly-install.sh | bash
Follow the on-screen instructions. Once the installation is complete, make sure to restart your terminal session or reload your shell profile to apply the environment changes.
Managing Swift Versions
With swiftly installed, you can easily install and switch between Swift toolchains:
# Install the latest stable Swift version
swiftly install latest
# Install a specific version
swiftly install 6.0.1
# Switch to a specific version of Swift
swiftly use 6.0.1
To verify that everything is configured correctly, run:
swift --version
2. Setting Up Zed Editor for Swift
Zed has excellent, native support for Swift out of the box! It uses Swift's built-in sourcekit-lsp (Language Server Protocol) to provide autocompletion, diagnostics, and code navigation.
Basic Setup
Since sourcekit-lsp comes pre-installed with Swift, Zed will automatically find and launch the language server as long as swift is available in your shell's PATH. No extra plugin installations are required!
Adding Formatting Support (Optional)
To keep your Swift code clean and formatted on save, you can configure swift-format.
-
Install
swift-formaton your system. On macOS, you can do this easily via Homebrew:brew install swift-format -
Open your Zed settings (
Cmd + ,or settings.json) and add the following configuration to enable formatting on save for Swift files:{"languages" : {"Swift" : {"format_on_save" :"on" ,"formatter" : {"external" : {"command" :"swift-format" ,"arguments" : ["format" ,"--in-place" ] } } } } }
Now you have a blazing-fast IDE experience with auto-completion, diagnostics, and auto-formatting, all powered by Zed and Swift!