spacemacs/layers/+lang/swift
Arif Er 00f9ab19ac chore: update copyright headers to 2022
The script used to identify and update the change is added into the GitHub
workflows script directory. A workflow action can be created to trigger the
script to update the headers on the first of every new year. Possibly a task for
a consequent PR.
2022-06-03 17:32:20 +02:00
..
img Swift support initial import 2015-12-03 23:34:01 -05:00
README.org Update references to macOS 2019-10-13 12:04:40 +02:00
packages.el chore: update copyright headers to 2022 2022-06-03 17:32:20 +02:00

README.org

Swift layer

/TakeV/spacemacs/media/branch/develop/layers/+lang/swift/img/swift.png

Description

This layer adds support for Apple's Swift programming language, used as a general purpose scripting language.

Features:

  • Syntax highlighting with swift-mode
  • Indentation
  • Code navigation using imenu (built-in)
  • Automatic syntax checking with flycheck (available with the syntax-checking layer)

Install

First check that you are able to run this from the command line:

On macOS:

  xcrun swift

Then to use this configuration layer, add it to your ~/.spacemacs. You will need to add swift to the existing dotspacemacs-configuration-layers list in this file.

Usage information

Unless configured by the user, the REPL will be invoked using the command xcrun swift. You can launch the REPL using the key binding SPC m s s (or C-c C-z). The universal prefix SPC u (C-u) may be used to modify command invocation.

Key bindings

swift-mode

Key bindings Description
SPC m s s swift-mode-run-repl
SPC m s b swift-mode-send-buffer
SPC m s r swift-mode-send-region

Notes:

  1. swift-mode-run-repl will run or switch to an existing REPL.
  2. To edit the command invocation, prefix with SPC u (or C-u).
  3. Emacs key bindings in use are the those set by the package.

swift-repl-mode

Key bindings Description
SPC m s s swift-repl-mode-switch-back