Skip to content

Commit c2e67ab

Browse files
committed
Enable typescript for Vim (in tsx files)
1 parent d172ba8 commit c2e67ab

File tree

2 files changed

+8
-10
lines changed

2 files changed

+8
-10
lines changed

plugins.vim

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,8 @@ call plug#begin('~/.vim/plugged')
2424

2525
" Javascript
2626
Plug 'pangloss/vim-javascript'
27-
Plug 'maksimr/vim-jsbeautify' " Allows use of jsbeautifier
28-
Plug 'maxmellon/vim-jsx-pretty' " Syntax highlighting and indenting for JSX
29-
"Plug 'leafgarland/typescript-vim' " Syntax file and other settings for TypeScript.
27+
"Plug 'maksimr/vim-jsbeautify' " Allows use of jsbeautifier
28+
Plug 'leafgarland/typescript-vim' " Syntax file and other settings for TypeScript.
3029

3130
" Elixir
3231
"Plug 'elixir-editors/vim-elixir' " Syntax highlighting, Filetype detection, Automatic indentation
@@ -87,13 +86,9 @@ nmap <leader>tl :TestLast<CR>
8786
nmap <leader>tv :TestVisit<CR>
8887
8988
" Vim Javascript Configurations
90-
"let g:javascript_plugin_jsdoc = 1 " Syntax highlighting for http://usejsdoc.org
91-
"let g:javascript_plugin_flow = 1 " Syntax highlighting for https://flowtype.org
92-
"let g:javascript_plugin_ngdoc = 1 " Syntax highlighting for NGDocs
93-
nmap <leader>jf :call JsBeautify()<cr>" Formart Javascript Files
94-
95-
" Vim JSX Configurations
96-
let g:vim_jsx_pretty_colorful_config = 1
89+
let g:javascript_plugin_jsdoc = 1 " Syntax highlighting for http://usejsdoc.org
90+
let g:javascript_plugin_flow = 1 " Syntax highlighting for https://flowtype.org
91+
let g:javascript_plugin_ngdoc = 1 " Syntax highlighting for NGDocs
9792

9893
" Vim Code Fmt
9994
"nmap <leader>fl :FormatLines<cr> " Format Lines

vimrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ runtime macros/matchit.vim
88
let mapleader=" "
99

1010
" Theme
11+
set syntax=on
1112
set background=dark
1213
colorscheme solarized
1314

@@ -86,5 +87,7 @@ if empty(glob('~/.vim/autoload/plug.vim'))
8687
autocmd VimEnter * PlugInstall --sync | source $MYVIMRC
8788
endif
8889

90+
autocmd BufNewFile,BufRead *.tsx setlocal filetype=typescript
91+
8992
" Plugin definitions and configurations
9093
source ~/.vim/plugins.vim

0 commit comments

Comments
 (0)