mirror of
https://github.com/keith/swift.vim.git
synced 2025-12-12 20:35:53 +01:00
docs: add installation steps (#160)
This commit is contained in:
58
README.md
58
README.md
@@ -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
|
||||
|
||||

|
||||

|
||||
|
||||
## 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.
|
||||
|
||||
Reference in New Issue
Block a user