Skip to content

Instantly share code, notes, and snippets.

@mgrider
Forked from jlehikoinen/setup.sh
Last active March 22, 2024 01:55
Show Gist options
  • Star 22 You must be signed in to star a gist
  • Fork 4 You must be signed in to fork a gist
  • Save mgrider/dd22c1eb82af227d736a0cb25007427b to your computer and use it in GitHub Desktop.
Save mgrider/dd22c1eb82af227d736a0cb25007427b to your computer and use it in GitHub Desktop.
Swift syntax highlighting for Vim
# Swift syntax highlighting for Vim
# Original Source: http://wingsquare.com/blog/swift-script-syntax-highlighting-and-indentation-for-vim-text-editor/
# Another helpful article: https://billyto.github.io/blog/swift-syntax-vim
# More about Vim packages: http://vimcasts.org/episodes/packages/
echo "--- creating ~/.vim/pack/bundle/start dir.."
mkdir -p ~/.vim/pack/bundle/start
echo "--- Cloning Apple's Swift repo.."
git clone --depth=1 https://github.com/apple/swift/
echo "--- Copying plugin to Vim bundles.."
cp -r ./swift/utils/vim ~/.vim/pack/bundle/start/swift
echo "--- Cleaning up, removing swift repo.."
rm -rf ./swift/
@alexwal
Copy link

alexwal commented Aug 31, 2019

Errors because ~/.vim/bundle/start/swift != ~/.vim/pack/bundle/start

@mgrider
Copy link
Author

mgrider commented Sep 5, 2019

Errors because ~/.vim/bundle/start/swift != ~/.vim/pack/bundle/start

D'oh! (Fixed.)

@samflattery
Copy link

Use git clone --depth=1, otherwise the entire swift repo is over 1gb

@mgrider
Copy link
Author

mgrider commented Jan 21, 2020

Good advice.

@benman1
Copy link

benman1 commented Apr 13, 2020

Thanks!

@csytsma
Copy link

csytsma commented Jul 16, 2020

Brilliant, thanks!

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