Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 56 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,64 @@

Syntax and indent files for [Swift](https://developer.apple.com/swift/)

If you don't have a preferred installation method check out
[vim-plug](https://github.com/junegunn/vim-plug).
## Features

- Syntax highlighting for modern Swift
- Filetype detection
- Smart indentation
- Compiler usage (`:compiler swiftc` → `:make`)

## Examples

![](https://raw.githubusercontent.com/keith/swift.vim/master/screenshots/screen.png)
![](https://raw.githubusercontent.com/keith/swift.vim/master/screenshots/screen2.png)

## Installation

### [LazyVim](https://www.lazyvim.org/)

> For [neovim](https://github.com/neovim/neovim) only

1. Locate your [plugins folder](https://www.lazyvim.org/configuration/plugins#-adding-plugins), make a new `.lua` file and name it `swift.lua`

2. add the following:

```lua
return {
"keith/swift.vim",
ft = "swift", -- filetype
}
```

The plugin should be automatically installed next time you start nvim!

> [!TIP]
> usual location for the plugins is `~/.config/nvim/lua/plugins/`)

### [Plug](https://github.com/junegunn/vim-plug)

1. Add the folowing to your vim-plug block:

```vim
Plug 'keith/swift.vim', { 'for': 'swift' }
```

2. Run `:PlugInstall`:

### [Packer](https://github.com/wbthomason/packer.nvim)

1. Add the following to your packer config:

```lua
require('packer').startup(function(use)
use { 'keith/swift.vim', ft = 'swift' }
end)
```

## Usage

Opening any `.swift` file should automatically enable the plugin.

##### Commands

- Run `:compiler swiftc` then `:make` to build current file.