Back to Spacevim

Use Vim as a Swift IDE

docs/_posts/2020-08-10-use-vim-as-a-swift-ide.md

2.4.01.3 KB
Original Source

Blogs >> Use Vim as a Swift IDE

This is a general guide for using SpaceVim as a Swift IDE, including layer configuration and usage. Each of the following sections will be covered:

<!-- vim-markdown-toc GFM --> <!-- vim-markdown-toc -->

Enable language layer

To add swift language support in SpaceVim, you need to enable the lang#swift layer. Press SPC f v d to open SpaceVim configuration file, and add following configuration:

toml
[[layers]]
  name = "lang#swift"

for more info, you can read the lang#swift layer documentation.

code running

The default code running key binding is SPC l r. It will run swift current_file asynchronously. And the stdout will be shown on a runner buffer.

REPL support

Start a swift inferior REPL process with SPC l s i. After the REPL process being started, you can send code to inferior process. All key bindings prefix with SPC l s, including sending line, sending selection or even send whole buffer.