vimrc 17 KB

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