Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
fix(vim): work around unwanted "javascriptreact"/"typescriptreact" fi…
…letypes

See:

vim/vim#4830

and specifically my comment here:

vim/vim#4830 (comment)
  • Loading branch information
wincent committed Oct 25, 2019
1 parent d01c887 commit 90c278d
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion roles/dotfiles/files/.vim/ftdetect/jest.vim
@@ -1,7 +1,7 @@
autocmd FileType * call s:Test()

function! s:Test()
if match(&filetype, '\v<javascript|typescript>') == -1
if match(&filetype, '\v<javascript|javascriptreact|typescript|typescriptreact>') == -1
return
endif

Expand Down
2 changes: 1 addition & 1 deletion roles/dotfiles/files/.vim/ftdetect/tsx.vim
@@ -1 +1 @@
autocmd BufNewFile,BufRead *.tsx noautocmd set filetype=typescript.tsx
autocmd BufNewFile,BufRead *.tsx noautocmd set filetype+=.tsx
3 changes: 3 additions & 0 deletions roles/dotfiles/files/.vim/ftplugin/javascriptreact.vim
@@ -0,0 +1,3 @@
" Work around filetype that landed in upstream Vim here:
" https://github.com/vim/vim/issues/4830
execute 'noautocmd set filetype=' . substitute(&filetype, 'javascriptreact', 'javascript', '')
3 changes: 3 additions & 0 deletions roles/dotfiles/files/.vim/ftplugin/typescriptreact.vim
@@ -0,0 +1,3 @@
" Work around filetype that landed in upstream Vim here:
" https://github.com/vim/vim/issues/4830
execute 'noautocmd set filetype=' . substitute(&filetype, 'typescriptreact', 'typescript', '')

0 comments on commit 90c278d

Please sign in to comment.