From 863b52e73cab25edf6d8dd5c9b4ab231b10d600d Mon Sep 17 00:00:00 2001 From: bastiangx Date: Sat, 30 Aug 2025 18:55:15 +0100 Subject: [PATCH] docs: add installation steps --- README.md | 58 +++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 56 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index a15233f..e224e0e 100644 --- a/README.md +++ b/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 ![](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.