Home Blog CV Projects Patterns Notes Book Colophon Search

TypeScript and Vim on MacOS X

28 Nov, 2016

To get TypeScript syntax highlighting, autocomplete and lookup without guessing indentation vim on Mac OS X using brew I ran these commands:

With brew permissions:

brew install luajit
brew uninstall macvim
brew uninstall vim
brew install macvim --with-cscope --with-lua --HEAD
brew install vim --with-override-system-vi  --with-cscope  --with-luajit  --HEAD

Then as my user:

mkdir -p ~/.vim/autoload ~/.vim/bundle && curl -LSso ~/.vim/autoload/pathogen.vim https://tpo.pe/pathogen.vim
git clone https://github.com/leafgarland/typescript-vim.git ~/.vim/bundle/typescript-vim
git clone https://github.com/Shougo/vimproc.vim.git ~/.vim/bundle/vimproc.vim
pushd ~/.vim/bundle/vimproc.vim
make
popd
git clone https://github.com/Quramy/tsuquyomi.git ~/.vim/bundle/tsuquyomi
cat << EOF > ~/.vimrc
execute pathogen#infect()
let g:typescript_indent_disable = 1
syntax on
EOF

Now I get syntax highlighting, and in edit mode I can press <ctrl+x><ctrl+o> to autocomplete or <ctrl+x><ctrl+]> to see a source definition.

Neat!

Copyright James Gardner 1996-2020 All Rights Reserved. Admin.