docs: add installation steps (#160)

This commit is contained in:
Bastian
2025-09-02 17:48:09 +01:00
committed by GitHub
parent c76b52c68b
commit 75990ecbca

View File

@@ -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.