diff rc/vimrc @ 620:7ac088ee101a

Add typescript vim syntax
author nanaya <me@nanaya.pro>
date Tue, 30 Oct 2018 19:04:56 +0900
parents 7045cd713864
children 1002aff7e865
line wrap: on
line diff
--- a/rc/vimrc	Mon Jul 09 16:08:46 2018 +0900
+++ b/rc/vimrc	Tue Oct 30 19:04:56 2018 +0900
@@ -112,6 +112,11 @@
   autocmd BufRead,BufNewFile Vagrantfile set filetype=ruby
   autocmd BufRead,BufNewFile config.ru set filetype=ruby
   autocmd BufRead,BufNewFile supervisord.conf set filetype=dosini
+  " stolen from https://github.com/leafgarland/typescript-vim/blob/master/ftdetect/typescript.vim
+  " use `set filetype` to override default filetype=xml for *.ts files
+  autocmd BufNewFile,BufRead *.ts  set filetype=typescript
+  " use `setfiletype` to not override any other plugins like ianks/vim-tsx
+  autocmd BufNewFile,BufRead *.tsx setfiletype typescript
 
   autocmd BufRead,BufNewFile *.nginx set ft=nginx
   autocmd BufRead,BufNewFile */etc/nginx/* set ft=nginx