You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: documentation/articles/zero-to-swift-nvim.md
+21-19Lines changed: 21 additions & 19 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,11 +1,11 @@
1
1
---
2
2
layout: page
3
3
date: 2024-06-04 15:13:07
4
-
title: From Zero to Swift | Configuring Neovim for Swift Development
4
+
title: Configuring Neovim for Swift Development
5
5
author: [etcwilde]
6
6
---
7
7
8
-
Neovim is a modern reimplementation of _Vim_, a popular terminal-based text
8
+
[Neovim](https://neovim.io) is a modern reimplementation of _Vim_, a popular terminal-based text
9
9
editor.
10
10
Neovim adds new features like asynchronous operations and powerful Lua bindings
11
11
for a snappy editing experience, in addition to the improvements _Vim_ brings to
@@ -14,6 +14,8 @@ the original _Vi_ editor.
14
14
This article walks you through configuring Neovim for Swift development,
15
15
providing configurations for various plugins to build a working Swift editing
16
16
experience.
17
+
The configuration files are built up step by step and the end of the article contains the
18
+
fully assembled versions of those files.
17
19
It is not a tutorial on how to use Neovim and assumes some familiarity
18
20
with modal text editors like _Neovim_, _Vim_, or _Vi_.
19
21
We are also assuming that you have already installed a Swift toolchain on your
@@ -29,7 +31,7 @@ Basic setup and configuration includes:
29
31
1. Installing Neovim.
30
32
2. Installing `lazy.nvim` to manage our plugins.
31
33
3. Configuring the SourceKit-LSP server.
32
-
4. Setting up Language-Server-driven autocompletion with _nvim-cmp_.
34
+
4. Setting up Language-Server-driven code completion with _nvim-cmp_.
33
35
5. Setting up snippets with _LuaSnip_.
34
36
35
37
The following sections are provided to help guide you through the setup:
@@ -38,8 +40,9 @@ The following sections are provided to help guide you through the setup:
38
40
-[Package Management](#packaging-with-lazy)
39
41
-[Language Server Support](#language-server-support)
40
42
-[File Updates](#file-updating)
41
-
-[Autocomplete](#auto-complete)
43
+
-[Code Completion](#code-completion)
42
44
-[Snippets](#Snippets)
45
+
-[Fully Assembled Configuration Files](#files)
43
46
44
47
> Tip: If you already have Neovim, Swift, and a package manager installed, you can skip to setting up [Language Server support](#language-server-support).
45
48
@@ -194,10 +197,10 @@ return {
194
197
}
195
198
```
196
199
197
-
While this gives us LSP support through sourcekit-lsp, there are no keybindings,
198
-
so it's not very practical. Lets hook those up now.
200
+
While this gives us LSP support through SourceKit-LSP, there are no keybindings,
201
+
so it's not very practical. Let's hook those up now.
199
202
200
-
We'll set up an auto command that fires when LSP attaches in the `config`
203
+
We'll set up an auto command that fires when an LSP server attaches in the `config`
201
204
function under where we set up the `sourcekit` server. The keybindings are
202
205
applied to all LSP servers so you end up with a consistent experience across
203
206
languages.
@@ -231,7 +234,7 @@ SourceKit-LSP increasingly relies on the editor informing the server when
231
234
certain files change. This need is communicated through _dynamic registration_.
232
235
You don't have to understand what that means, but Neovim doesn't implement
233
236
dynamic registration. You'll notice this when you update your package manifest,
234
-
or add new files to your compile-commands file and LSP doesn't work without
237
+
or add new files to your `compile_commands.json` file and LSP doesn't work without
235
238
restarting Neovim.
236
239
237
240
Instead, we know that SourceKit-LSP needs this functionality, so we'll enable it
@@ -255,16 +258,16 @@ following issues describe the issue in more detail:
0 commit comments