This repository has been archived on 2024-10-22. You can view files and clone it, but cannot push or open issues or pull requests.
spacemacs/layers/+lang/swift
2018-10-11 00:13:43 +03:00
..
img
packages.el Revert "Defer packages by default using use-package-always-defer" 2018-03-03 23:40:10 -05:00
README.org Reformat documentation 2018-10-11 00:13:43 +03:00

Swift layer

/TakeV/spacemacs/media/commit/cd39f80c24faa9ad2833fe54e2e76a823b557c53/layers/+lang/swift/img/swift.png

Description

This layer adds support for Apples 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 OS X:

  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 keybinding 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