Skip to content

Instantly share code, notes, and snippets.

@chipxsd
Last active May 23, 2023 22:16
Show Gist options
  • Save chipxsd/63eddd0dce8770b94d3ca221ccee2cec to your computer and use it in GitHub Desktop.
Save chipxsd/63eddd0dce8770b94d3ca221ccee2cec to your computer and use it in GitHub Desktop.
Enable Swift Syntax Highlighting in Vim

How to Enable Syntax Highlighting in Vim for Swift

Make a shallow git clone of the official Swift repo and make a symbolic link from Swift's utils vim directory into ~/.vim/pack/bundle/start:

mkdir -p ~/.vim/pack/bundle/start
cd ~/Developer
git clone --depth 1 git@github.com:apple/swift.git
cd swift
ln -s ~/Developer/swift/utils/vim ~/.vim/pack/bundle/start/swift

Add the syntax highlighting to ~/.vimrc:

syntax on
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment