Syntax and indent files for Swift
- Syntax highlighting for modern Swift
- Filetype detection
- Smart indentation
- Compiler usage (
:compiler swiftc
→:make
)
For neovim only
-
Locate your plugins folder, make a new
.lua
file and name itswift.lua
-
add the following:
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/
)
- Add the folowing to your vim-plug block:
Plug 'keith/swift.vim', { 'for': 'swift' }
- Run
:PlugInstall
:
- Add the following to your packer config:
require('packer').startup(function(use)
use { 'keith/swift.vim', ft = 'swift' }
end)
Opening any .swift
file should automatically enable the plugin.
- Run
:compiler swiftc
then:make
to build current file.