Skip to content

Conversation

@etcwilde
Copy link
Member

This is an article on setting up Neovim for Swift development. It covers setting up a package manager, LSP, auto-completions, snippets, and finally some helpful autocommands.

rdar://127610592

This is an article on setting up Neovim for Swift development.
It covers setting up a package manager, LSP, auto-completions, snippets,
and finally some helpful autocommands.
LSP-driven autocompletion with `nvim-cmp`, and snippets with `LuaSnip`. Then
we'll finish with some autocommands that are useful if you need to read
swiftinterface files or find yourself reading SIL. If you already have Neovim,
Swift, and a package manager installed, you can skip down to setting up
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider adding a "Note" or a return here to separate it from the previous sentence to call out they can skip this step if already installed.

Note: If you already have Neovim, Swift, and a package manager installed, you can skip down...


Alternatively, the neovim github repository has downloadable packages with the
latest versions. Instructions are available at
https://github.com/neovim/neovim/blob/master/INSTALL.md#install-from-download
Copy link
Contributor

@RobinBateman808 RobinBateman808 May 24, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider embedding long GitHub links using the specific name of the section to avoid confusion and add clarity. For example in the sentence, "Alternatively, the neovim GitHub repository has downloadable packages with the
latest versions. See Install from download for more information."

$ tar xf swift-5.10-RELEASE-ubuntu22.04.tar.gz
```

That drops a `swift-5.10-RELEASE-ubuntu22.04/usr` directory in our Downloads
Copy link
Contributor

@RobinBateman808 RobinBateman808 May 24, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is Downloads part of the UI? If so, consider changing to Downloads. If not part of the UI, but is a placeholder, you can use italics to call it out: Downloads

@etcwilde
Copy link
Member Author

etcwilde commented Jun 5, 2024

Alright, try that introduction.

We should link to the Install Swift page on Swift.org as that contains a comprehensive guide for all the different platforms, especially once #676 is landed.

Still need to think about the Install section. There are several ways and I didn't want to get bogged down in the details of installing Swift or Neovim for each platform given that I'm already linking to Neovim's install page which lists out the different ways to install Neovim on each platform. Swift, yeah, I'll look into that.

Comment on lines 68 to 70
$ cd ~/Downloads
$ wget https://download.swift.org/swift-5.10-release/ubuntu2204/swift-5.10-RELEASE/swift-5.10-RELEASE-ubuntu22.04.tar.gz
$ tar xf swift-5.10-RELEASE-ubuntu22.04.tar.gz
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah we don't have a good story for that at the moment unfortunately

@federicobucchi federicobucchi mentioned this pull request Jun 6, 2024
etcwilde added 3 commits June 6, 2024 14:07
The console code-block language recognizes the prompt. With recent
changes to the CSS, things marked as part of the prompt aren't
selectable making it easier to copy-paste commands.
These are the names of the plugins, replacing backticks with italicizing
the plugin name.
It's a little easier to understand what is going on looking at the title
of the issues about dynamic registration and neovim than the raw link
text.
author: [etcwilde]
---

Neovim is a modern reimplementation of _Vi IMproved (vim)_, a popular terminal-based text
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have mixed feelings on expanding vim. It's technically not wrong, but I don't think it helps with comprehension and makes it a little awkward to read. Thoughts? @al45tair, what do you think? Maybe I've been looking at this for too long?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ack. The recommendation is based on standard writing style guidelines. Exceptions can be made if your target audience already understands the terminology and definition.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd probably make sure that I spelled it Vim, rather than in all lowercase, unless it's a command in which case vim. I don't think I'd expand it — I think it's a name at this point. It's also a little tricky to expand, because vi was a shortening of VIsual, so vim is a play on words — it's both VIsual and IMproved.

In any event, I think the audience is likely familiar with Vim.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(Having read through it, a few times, I don't mind the expansion either, so if you want to leave it how it is, that's fine by me.)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Neo-VIsual-IMproved (Neovim) intensifies. No, I think that looks silly and I think that will actually confuse more people than it helps.

I'll go ahead and capitalize the name though.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm good with the majority vote. Thanks!

etcwilde added 3 commits June 7, 2024 10:28
Removing the section on downloading the tarball and replacing it with a
reference back to the swift.org installation page.
Fixing capitalization on Vim and Vi. Also removing the expansion of Vim.
It's the name of the tool at this point and folks reading this document
should be familiar with it, or at the very least, "VIsual IMproved", is
not particularly enlightening if you don't know what it is.
Moving the link to the Neovim install page up for that folks who are not
using Ubuntu.
That's not very exciting to look at, so I've added a few additional plugins to
make it look more appealing.

To check that it's working, launch Neovim. You should first see an error saying
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The last nit ... consider formatting for easier readability:

"To check that it's working:

  1. Launch Neovim.
    You should first see an error saying that there were no specs found for module plugins. This just means there aren't any plugins.
  2. Press Enter and type, :Lazy.
    lazy.nvim will list the plugins loaded. There should only be one right now: "lazy.nvim". This is lazy.nvim tracking and updating itself.
  3. From the lazy.nvim menu, press I to install new plugins.
    U updates the plugins and X deletes any plugins that lazy.nvim installed, but are no longer being tracked in your configuration."

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There, I broke up apart the last point a bit further so that each button is a separate element.
Something I'm noticing, if I try to number them, the website generator seems very intent on renumbering all of the points as 1. so I left them as an unordered list. Will that work?

To check that it's working:

  • Launch Neovim.

    You should first see an error saying that there were no specs found for
    module plugins. This just means that there aren't any plugins.

  • Press Enter and type, :Lazy.

    lazy.nvim lists the plugins installed. There should only be one right now:
    "lazy.nvim". This is lazy.nvim tracking and updating itself.

  • We can manage out plugins through the lazy.nvim menu.

    • Pressing I will install new plugins.
    • Pressing U will update installed plugins.
    • Pressing X will delete any plugins that lazy.nvim installed, but are
      no longer tracked in your configuration.

Copy link
Contributor

@RobinBateman808 RobinBateman808 Jun 7, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That works and looks good. Thanks.

@etcwilde etcwilde force-pushed the ewilde/zero-to-swift-nvim branch from 28c1d45 to d219e58 Compare June 7, 2024 21:29
Answering some review feedback to split up some of the longer
paragraphs.
@etcwilde etcwilde force-pushed the ewilde/zero-to-swift-nvim branch from d219e58 to 02c4ab9 Compare June 7, 2024 21:43
@etcwilde
Copy link
Member Author

etcwilde commented Jun 7, 2024

@swift-ci please test

@parispittman
Copy link
Member

lgtm - thanks!!

@parispittman parispittman merged commit 0d3634c into swiftlang:main Jun 7, 2024
@etcwilde etcwilde deleted the ewilde/zero-to-swift-nvim branch June 7, 2024 22:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants