vimrc 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567
  1. " Use pathogen to load other plugins
  2. execute pathogen#infect()
  3. Helptags
  4. filetype plugin indent on
  5. set encoding=utf-8
  6. set spelllang=en_us
  7. " Search settings
  8. set incsearch
  9. set ignorecase
  10. set smartcase
  11. set hlsearch
  12. " Indentation and tab functionality
  13. set tabstop=2
  14. set shiftwidth=2
  15. set softtabstop=2
  16. set expandtab
  17. set autoindent
  18. set smarttab
  19. set smartindent
  20. " Code Folding
  21. set foldopen-=block
  22. set nofoldenable
  23. set foldmethod=indent
  24. set foldnestmax=10
  25. set viewoptions=cursor,folds,slash,unix
  26. set noshowmode
  27. " Command expiration
  28. set timeout
  29. set ttimeoutlen=15
  30. " Set font for (m|g)vim
  31. set guifont=Meslo\ LG\ S\ for\ Powerline:h11
  32. set guioptions=ce
  33. set mouse=a
  34. set number " Line numbers
  35. set nowrap " Line Wrapping
  36. set hidden " Just hide buffer when :bd'ing
  37. set autoread " Automatically update externally updated files
  38. set cc=80 " Which line is the 80th column?
  39. set tw=80 " Text width line wrapping
  40. set splitright " New window split settings
  41. set splitbelow " New window split settings
  42. set viminfo^=% " Remember buffer info on close
  43. set completeopt=menu
  44. set maxmempattern=8171906 " Because some files are big
  45. """"""""""""""""""""""""""""
  46. " Keybinds
  47. """"""""""""""""""""""""""""
  48. com! W w
  49. com! Q q
  50. let mapleader="\<space>"
  51. " Wrapped lines treated like normal ones
  52. nnoremap j gj
  53. nnoremap k gk
  54. nnoremap <leader>S :call ToggleSpellCheck()<cr>
  55. function! ToggleSpellCheck()
  56. if &spell ==# "nospell"
  57. set spell
  58. else
  59. set nospell
  60. endif
  61. endfunction
  62. " Set CTRL+S to save becuase I smack that every 10 seconds on whatever application I use
  63. command! -nargs=0 Save if &modified | confirm write | endif
  64. nnoremap <silent> <C-s> :Save<CR>
  65. inoremap <C-s> <C-o>:Save<CR>
  66. vnoremap <C-s> <C-o>:Save<CR>
  67. " CTRL+w to close the current buffer
  68. nnoremap <silent> <C-w> :Sayonara<CR>
  69. nnoremap <silent> <S-w> :hide<CR>
  70. " Buffer magic
  71. nnoremap <leader>l :ls<CR>:b<space>
  72. nnoremap <leader>; :tabs<CR>:tabn<space>
  73. " Switch indentation settings
  74. nnoremap <leader>y :set expandtab tabstop=4 shiftwidth=4 softtabstop=4<CR>
  75. nnoremap <leader>Y :set expandtab tabstop=8 shiftwidth=8 softtabstop=4<CR>
  76. nnoremap <leader>m :set expandtab tabstop=2 shiftwidth=2 softtabstop=2<CR>
  77. nnoremap <leader>M :set noexpandtab tabstop=8 softtabstop=4 shiftwidth=4<CR>
  78. " To wrap or not to wrap
  79. nnoremap <leader>w :setlocal wrap!<CR>:setlocal wrap?<CR>
  80. " Window Switching and Resizing
  81. nnoremap <silent> <C-k> :wincmd k<CR>
  82. nnoremap <silent> <C-j> :wincmd j<CR>
  83. nnoremap <silent> <C-h> :wincmd h<CR>
  84. nnoremap <silent> <C-l> :wincmd l<CR>
  85. if has("nvim")
  86. nnoremap <silent> <A-K> :wincmd K<CR>
  87. nnoremap <silent> <A-J> :wincmd J<CR>
  88. nnoremap <silent> <A-H> :wincmd H<CR>
  89. nnoremap <silent> <A-L> :wincmd L<CR>
  90. nnoremap <silent> <A-T> :wincmd T<CR>
  91. else
  92. nnoremap <silent> K :wincmd K<CR>
  93. nnoremap <silent> J :wincmd J<CR>
  94. nnoremap <silent> H :wincmd H<CR>
  95. nnoremap <silent> L :wincmd L<CR>
  96. nnoremap <silent> T :wincmd T<CR>
  97. endif
  98. nnoremap <silent> + :wincmd +<CR>
  99. nnoremap <silent> _ :wincmd -<CR>
  100. nnoremap <silent> ) :wincmd ><CR>
  101. nnoremap <silent> ( :wincmd <<CR>
  102. nnoremap <silent> <leader>r :wincmd r<CR>
  103. nnoremap <silent> <leader>R :wincmd R<CR>
  104. " Navigate tag stack
  105. nmap <A-]> <C-]>
  106. nmap <A-[> <C-T>
  107. " ALt+d to duplicate a line, vmode version is best for SHIFT+V, not the others
  108. nmap Y y$
  109. nnoremap <A-d> "yyy"yp
  110. vnoremap <A-d> "yy<C-o>"yp
  111. inoremap <A-d> <C-o>:yank<CR><C-o>:put<CR>
  112. " Yank/put to clipboard
  113. nnoremap <A-p> "+p
  114. vnoremap <A-p> "+p
  115. nnoremap <expr> <silent> <A-y> '"+' . (v:count ? v:count : '') . 'y'
  116. vnoremap <A-y> "+y
  117. " Move lines of text via alt+[jk]
  118. nnoremap <silent> <A-j> :m+1<CR>==
  119. nnoremap <silent> <A-k> :m-2<CR>==
  120. vnoremap <silent> <A-j> :m '>+1<CR>gv=gv
  121. vnoremap <silent> <A-k> :m '<-2<CR>gv=gv
  122. " Move text left/right via alt+[hl]
  123. nnoremap <silent> <A-l> "mx"mp
  124. nnoremap <silent> <A-h> "mxhh"mp
  125. " TODO: Maintain selection
  126. vnoremap <silent> <A-l> "mx"mp
  127. vnoremap <silent> <A-h> "mxhh"mp
  128. " Clear searches so there aren't underlined words.
  129. nnoremap <silent> <C-i> :nohlsearch<CR>
  130. " Formatting
  131. nmap <silent> =j :FormatJSON<CR>
  132. nmap <silent> =x :FormatXML<CR>
  133. nmap <silent> =, :s/$/,/<CR><C-i>
  134. " Set specific directories for swap, undo, and backups.
  135. set backupdir=~/.vim/tmp/backup//
  136. set directory=~/.vim/tmp/swap//
  137. set undodir=~/.vim/tmp/undo//
  138. set viewdir=~/.vim/tmp/view//
  139. set undofile
  140. map <S-k> <nop>
  141. map <S-q> <nop>
  142. """"""""""""""""""""""""""""
  143. " vim-rspec
  144. """"""""""""""""""""""""""""
  145. map <silent> <leader>t :call RunCurrentSpecFile()<CR>
  146. map <silent> <leader>a :call RunAllSpecs()<CR>
  147. map <silent> <leader>s :call RunNearestSpec()<CR>
  148. map <silent> <leader>k :call RunLastSpec()<CR>
  149. let g:rspec_command = "!if command -v rspec >/dev/null 2>&1; then rspec {spec}; else; bundle exec spec {spec}; fi"
  150. """"""""""""""""""""""""""""
  151. " Ctrl-P Settings
  152. """"""""""""""""""""""""""""
  153. " Keybinding and functionality
  154. let g:ctrlp_map = "<leader>o"
  155. " Move Ctrl-P to top of the screen
  156. let g:ctrlp_match_window_bottom = 0
  157. let g:ctrlp_match_window_reversed = 0
  158. " Ignore some filetypes
  159. let g:ctrlp_custom_ignore = 'node_modules\|DS_STORE\|\v\~$|\.(o|swp|pyc|wav|mp3|ogg|blend)$|(^|[/\\])\.(hg|git|bzr)($|[/\\])|__init__\.py'
  160. "let g:ctrlp_by_filename = 1
  161. let g:ctrlp_clear_cache_on_exit = 0
  162. " Uncomment to show hidden directories.
  163. "let g:ctrlp_show_hidden = 1
  164. """"""""""""""""""""""""""""
  165. " Airline (Powerline replacement)
  166. """"""""""""""""""""""""""""
  167. let g:airline_theme = 'powerlineish'
  168. let g:airline_powerline_fonts = 1
  169. """"""""""""""""""""""""""""
  170. " NerdTree
  171. """"""""""""""""""""""""""""
  172. " Directory tree toggle
  173. nnoremap <leader>e :NERDTreeToggle<CR>
  174. """"""""""""""""""""""""""""
  175. " NerdCommenter
  176. """"""""""""""""""""""""""""
  177. map <leader>cc <plug>NERDCommenterToggle
  178. " For some reason, CommentToggle doesn't work unless this is
  179. " remapped, so remapping it to something I won't ever use.
  180. map <leader><A-/><space> <plug>NERDCommenterComment
  181. """"""""""""""""""""""""""""
  182. " TeX Settings
  183. """"""""""""""""""""""""""""
  184. let g:tex_flavor = "latex"
  185. let g:LatexBox_latexmk_options = "-pvc -pdfps"
  186. """"""""""""""""""""""""""""
  187. " Rails.vim
  188. """"""""""""""""""""""""""""
  189. let g:rails_gem_projections = {
  190. \ "fabrication": {
  191. \ "spec/fabricators/*_fabricator.rb": {
  192. \ "command": "fabricator",
  193. \ "affinity": "model",
  194. \ "alternate": "app/models/{}.rb",
  195. \ "related": "db/schema.rb#{plural}",
  196. \ "test": "spec/models/{}_spec.rb",
  197. \ "template": "# frozen_string_literal: true\n\nFabricator :{} do\nend",
  198. \ "keywords": "Fabricate Fabricator sequence"
  199. \ }
  200. \ },
  201. \ "webpacker": {
  202. \ "app/javascript/packs/*.js": {
  203. \ "command": "pack",
  204. \ "test": "spec/javascript/{}.test.js"
  205. \ },
  206. \ "app/javascript/packs/*.jsx": {
  207. \ "command": "pack",
  208. \ "test": "spec/javascript/{}.test.jsx"
  209. \ },
  210. \ "app/javascript/packs/*.ts": {
  211. \ "command": "pack",
  212. \ "test": "spec/javascript/{}.test.ts"
  213. \ },
  214. \ "app/javascript/packs/*.tsx": {
  215. \ "command": "pack",
  216. \ "test": "spec/javascript/{}.test.tsx"
  217. \ },
  218. \ },
  219. \ "factory_bot_rails": {
  220. \ "spec/factories/*_factory.rb": {
  221. \ "command": "factory",
  222. \ "affinity": "collection",
  223. \ "alternate": "app/models/{singular}.rb",
  224. \ "related": "db/schema.rb#{plural}",
  225. \ "test": "spec/models/{singular}_spec.rb",
  226. \ "template": "# frozen_string_literal: true\n\nFactoryBot.define do\n factory :{singular} do\n end\nend",
  227. \ "keywords": "factory sequence"
  228. \ }
  229. \ },
  230. \ "factory_bot": {
  231. \ "spec/factories/*_factory.rb": {
  232. \ "command": "factory",
  233. \ "affinity": "collection",
  234. \ "alternate": "app/models/{singular}.rb",
  235. \ "related": "db/schema.rb#{plural}",
  236. \ "test": "spec/models/{singular}_spec.rb",
  237. \ "template": "# frozen_string_literal: true\n\nFactoryBot.define do\n factory :{singular} do\n end\nend",
  238. \ "keywords": "factory sequence"
  239. \ }
  240. \ },
  241. \ "jasmine": {
  242. \ "spec/javascripts/*_spec.coffee": {
  243. \ "command": "rice",
  244. \ "template": "describe {camelcase|capitalize}, ->\n ",
  245. \ "keywords": "describe it beforeEach expect loadFixtures xit"
  246. \ },
  247. \ "spec/javascripts/*_spec.js": {
  248. \ "command": "rice",
  249. \ "template": "describe({camelcase|capitalize}, function() {\n \n})",
  250. \ "keywords": "describe it beforeEach expect loadFixtures xit"
  251. \ }
  252. \ },
  253. \ "interactor-rails": {
  254. \ "app/interactors/*.rb": {
  255. \ "command": "interactor",
  256. \ "template": "# frozen_string_literal: true\n\nclass {camelcase|capitalize|colons}\n\nend"
  257. \ },
  258. \ },
  259. \ "cucumber-rails": {
  260. \ "features/*.feature": {
  261. \ "command": "feature",
  262. \ "template": "Feature: {capitalize}\n\n Scenario: " ,
  263. \ },
  264. \ "features/step_definitions/*_steps.rb": {
  265. \ "command": "steps",
  266. \ "affinity": "collection"
  267. \ }
  268. \ },
  269. \ "draper": {
  270. \ "app/decorators/*_decorator.rb": {
  271. \ "command": "decorator",
  272. \ "affinity": "model",
  273. \ "alternate": "app/models/{}.rb",
  274. \ "related": "db/schema.rb#{plural}",
  275. \ "test": "spec/decorators/{}_decorator_spec.rb",
  276. \ "template": "# frozen_string_literal: true\n\nclass {camelcase|capitalize|colons}Decorator < Draper::Decorator\n\nend",
  277. \ "keywords": "delegate_all"
  278. \ }
  279. \ },
  280. \ "graphql": {
  281. \ "app/graphql/types/*_type.rb": {
  282. \ "command": "type",
  283. \ "affinity": "model",
  284. \ "alternate": "app/models/{}.rb",
  285. \ "related": "app/graphql/*_schema.rb#{plural}",
  286. \ "test": "spec/graphql/type/{}_type_spec.rb",
  287. \ "template": "# frozen_string_literal: true\n\nTypes::{camelcase|capitalize|colons}Type = GraphQL::ObjectType.define do\n name '{capitalize}'\nend",
  288. \ },
  289. \ "app/graphql/mutations/*.rb": {
  290. \ "command": "mutation",
  291. \ "affinity": "model",
  292. \ "alternate": "app/models/{}.rb",
  293. \ "test": "spec/graphql/mutations/{}_spec.rb",
  294. \ "template": "# frozen_string_literal: true\n\nclass Mutations::{camelcase|capitalize|colons} < GraphQL::Function\n \nend",
  295. \ }
  296. \ }
  297. \ }
  298. let g:rails_projections = {
  299. \ "app/services/*.rb": {"command": "service"},
  300. \ "app/extras/*.rb": {"command": "service"}
  301. \ }
  302. """"""""""""""""""""""""""""
  303. " delimitMate
  304. """"""""""""""""""""""""""""
  305. exec "set <BS>=\<C-H>"
  306. let g:delimitMate_expand_space = 1
  307. let g:delimitMate_expand_cr = 1
  308. """"""""""""""""""""""""""""
  309. " YCM Settings
  310. """"""""""""""""""""""""""""
  311. let g:ycm_autoclose_preview_window_after_completion = 1
  312. let g:ycm_server_log_level = 'error'
  313. "let g:ycm_show_diagnostics_ui = 0
  314. """"""""""""""""""""""""""""
  315. " Colors and Themes
  316. """"""""""""""""""""""""""""
  317. syntax enable
  318. "Set 256 color mode (not always needed).
  319. if $TERM == "xterm-256color" || $TERM == "screen-256color" || $COLORTERM == "xfce4-terminal"
  320. set t_Co=256
  321. endif
  322. " Use a nice color scheme
  323. colors monokai
  324. " but override matchparen color
  325. hi MatchParen ctermfg=160 ctermbg=NONE cterm=underline guifg=#df0000 guibg=NONE gui=underline
  326. """"""""""""""""""""""""""""""""""""""""
  327. " Useful Stuff
  328. """"""""""""""""""""""""""""""""""""""""
  329. " Delete trailing whitespaces on saving.
  330. function! DeleteTrailingWS()
  331. if !exists('b:noStrip')
  332. exe "normal mz"
  333. %s/\s\+$//ge
  334. exe "normal `z"
  335. endif
  336. endfunction
  337. au BufWrite * :call DeleteTrailingWS()
  338. au FileType go let b:noStrip=1
  339. if !has("nvim")
  340. " Allow the use of ALT as a function key.
  341. let c='a'
  342. while c <= 'z'
  343. exec "set <A-".c.">=\e".c
  344. exec "imap \e".c." <A-".c.">"
  345. let c = nr2char(1+char2nr(c))
  346. endw
  347. endif
  348. " Smart indent when entering insert mode with i on empty lines
  349. function! IndentWithI()
  350. if len(getline('.')) == 0
  351. return "\"_cc"
  352. else
  353. return "i"
  354. endif
  355. endfunction
  356. nnoremap <expr> i IndentWithI()
  357. " For auto-aligning '|' delimited tables
  358. inoremap <silent> <Bar> <Bar><Esc>:call <SID>align()<CR>a
  359. function! s:align()
  360. let p = '^\s*|\s.*\s|\s*$'
  361. if exists(':Tabularize') && getline('.') =~# '^\s*|' && (getline(line('.')-1) =~# p || getline(line('.')+1) =~# p)
  362. let column = strlen(substitute(getline('.')[0:col('.')],'[^|]','','g'))
  363. let position = strlen(matchstr(getline('.')[0:col('.')],'.*|\s*\zs.*'))
  364. Tabularize/|/l1
  365. normal! 0
  366. call search(repeat('[^|]*|',column).'\s\{-\}'.repeat('.',position),'ce',line('.'))
  367. endif
  368. endfunction
  369. " Set tabline at the top
  370. function! Tabline()
  371. let s = ''
  372. for i in range(tabpagenr('$'))
  373. let tab = i + 1
  374. let bufnr = tabpagebuflist(tab)[tabpagewinnr(tab) - 1]
  375. let bufname = bufname(bufnr)
  376. let bufmodified = getbufvar(bufnr, "&mod")
  377. let s .= '%' . tab . 'T'
  378. let s .= (tab == tabpagenr() ? '%#TabLineSel#' : '%#TabLine#')
  379. let s .= ' ' . tab . (bufmodified ? '+' : '') . ': '
  380. let s .= (bufname != '' ? fnamemodify(bufname, ':t') . ' ' : '--- ')
  381. endfor
  382. let s .= '%#TabLineFill#'
  383. return s
  384. endfunction
  385. set tabline=%!Tabline()
  386. " Go settings
  387. au BufRead,BufNewFile *.go set filetype=go
  388. au BufWritePre *.go :GoImports
  389. au FileType go map <buffer> <silent> <leader>t :GoTest<CR>
  390. au FileType go map <buffer> <silent> <leader>i :GoInfo<CR>
  391. let g:go_highlight_functions = 1
  392. let g:go_highlight_methods = 1
  393. let g:go_highlight_fields = 1
  394. let g:go_highlight_types = 1
  395. let g:go_highlight_operators = 0
  396. let g:go_highlight_extra_types = 1
  397. let g:go_highlight_format_strings = 1
  398. let g:go_highlight_generate_tags = 1
  399. let g:go_fmt_autosave = 0 " Let syntastic do this
  400. let g:go_fmt_experimental = 1 " Maintain folds after GoFmt + write
  401. set rtp+=$GOPATH/src/github.com/golang/lint/misc/vim
  402. au BufRead,BufNewFile *.go map <leader>d :GoDeclsDir<cr>
  403. " JSON things
  404. let g:vim_json_syntax_conceal = 1
  405. com! FormatJSON %!python -m json.tool
  406. com! FormatXML %!xmllint --format -
  407. " Filetypes
  408. au BufRead,BufNewFile *.Dockerfile set filetype=dockerfile
  409. au BufRead,BufNewFile *.xsd set filetype=xml
  410. au BufRead,BufNewFile *.wsdl set filetype=xml
  411. " F10 to print syntax highlighting for selection under cursor
  412. map <F10> :echo "hi<" . synIDattr(synID(line("."),col("."),1),"name") . '> trans<'
  413. \ . synIDattr(synID(line("."),col("."),0),"name") . "> lo<"
  414. \ . synIDattr(synIDtrans(synID(line("."),col("."),1)),"name") . ">"<CR>
  415. let g:rustfmt_autosave = 1
  416. let g:ycm_rust_src_path = $RUST_SRC_PATH
  417. let g:rust_src_path = $RUST_SRC_PATH
  418. autocmd BufRead *.rs :setlocal tags=./rusty-tags.vi;/,$RUST_SRC_PATH/rusty-tags.vi
  419. autocmd BufWrite *.rs :silent! exec "!rusty-tags vi --quiet --start-dir=" . expand('%:p:h') . "&" <bar> redraw!
  420. " Fix backspace
  421. imap <silent> <BS> <C-R>=YcmOnDeleteChar()<CR><Plug>delimitMateBS
  422. function! YcmOnDeleteChar()
  423. if pumvisible()
  424. return "\<C-y>"
  425. endif
  426. return ""
  427. endfunction
  428. let g:LatexBox_latexmk_async = 1
  429. let g:LatexBox_latexmk_preview_continuously = 1
  430. " OmniSharp settings are disabled because YCM does it better
  431. let g:Omnisharp_start_server = 0
  432. let g:ycm_auto_start_csharp_server = 1
  433. let g:ycm_auto_stop_csharp_server = 1
  434. " Source project specific settings from .git/project.vim if the file exists
  435. " this kinda sucks because
  436. " a) depends on fugutive
  437. " b) will only source one .git/project.vim ever, per vim instance
  438. " c) can potentially source something you don't want
  439. autocmd BufEnter,VimEnter * call s:MaybeRunProjectSettings(expand("<amatch>"))
  440. let g:custom_project_settings_loaded = 0
  441. function! s:MaybeRunProjectSettings(file)
  442. if g:custom_project_settings_loaded == 1
  443. return
  444. endif
  445. let git_dir = fugitive#extract_git_dir(@%)
  446. if git_dir != ""
  447. if filereadable(git_dir.'/project.vim')
  448. exec "source ".(git_dir.'/project.vim')
  449. endif
  450. endif
  451. let g:custom_project_settings_loaded = 1
  452. endfunction
  453. if has('nvim')
  454. let g:python_host_prog = "/bin/python2"
  455. let g:python3_host_prog = "/bin/python3"
  456. endif
  457. let g:ycm_key_list_select_completion = ['<C-n>', '<Down>']
  458. let g:ycm_key_list_previous_completion = ['<C-p>', '<Up>']
  459. let g:SuperTabDefaultCompletionType = '<C-n>'
  460. let g:UltiSnipsSnippetsDir="$HOME/.vim/snippets"
  461. let g:UltiSnipsExpandTrigger="<tab>"
  462. let g:UltiSnipsJumpForwardTrigger="<tab>"
  463. let g:UltiSnipsJumpBackwardTrigger="<s-tab>"
  464. let g:ale_completion_enabled = 0
  465. let g:airline#extensions#ale#enabled = 1
  466. let g:ale_linters = {
  467. \ 'javascript': ['eslint'],
  468. \ 'ruby': ['rubocop'],
  469. \}
  470. let g:ale_fixers = {
  471. \ 'javascript': ['eslint', 'prettier'],
  472. \ 'typescript': ['eslint', 'prettier'],
  473. \ 'scss': ['prettier'],
  474. \ 'html': ['prettier'],
  475. \ 'ruby': ['rubocop'],
  476. \}
  477. let g:ale_fix_on_save = 1
  478. let g:ale_lint_delay = 1000
  479. " ts/tsx highlighting sucks a lot and I'm not inclined to fix it right now.
  480. " Should be able to get by with using javascript{,.jsx} highlighting for now
  481. au BufRead,BufNewFile *.ts set filetype=javascript
  482. au BufRead,BufNewFile *.tsx set filetype=javascript.jsx