diff runtime/filetype.vim @ 31499:16174b7435a0 v9.0.1082

patch 9.0.1082: some jsonc files are not recognized Commit: https://github.com/vim/vim/commit/104b2ff4d0ec9248ba0b979aa3bbccb65fcad422 Author: kylo252 <59826753+kylo252@users.noreply.github.com> Date: Mon Dec 19 20:42:49 2022 +0000 patch 9.0.1082: some jsonc files are not recognized Problem: Some jsonc files are not recognized. Solution: Add patterns for jsonc and move some from json to jsonc. (closes #11711)
author Bram Moolenaar <Bram@vim.org>
date Mon, 19 Dec 2022 21:45:03 +0100
parents 15c80d8bc515
children 7f3f8543611e
line wrap: on
line diff
--- a/runtime/filetype.vim
+++ b/runtime/filetype.vim
@@ -993,23 +993,24 @@ au BufNewFile,BufRead *.jgr			setf jgrap
 " Jovial
 au BufNewFile,BufRead *.jov,*.j73,*.jovial	setf jovial
 
-" JSON
-au BufNewFile,BufRead *.json,*.jsonp,*.webmanifest	setf json
-
 " JSON5
 au BufNewFile,BufRead *.json5			setf json5
 
 " JSON Patch (RFC 6902)
-au BufNewFile,BufRead *.json-patch			setf json
+au BufNewFile,BufRead *.json-patch		setf json
 
 " Jupyter Notebook is also json
-au BufNewFile,BufRead *.ipynb				setf json
+au BufNewFile,BufRead *.ipynb			setf json
 
 " Other files that look like json
-au BufNewFile,BufRead .babelrc,.eslintrc,.prettierrc,.firebaserc  setf json
-
-" JSONC
-au BufNewFile,BufRead *.jsonc			setf jsonc
+au BufNewFile,BufRead .prettierrc,.firebaserc	setf json
+
+" JSONC (JSON with comments)
+au BufNewFile,BufRead *.jsonc,.babelrc,.eslintrc,.jsfmtrc 	setf jsonc
+au BufNewFile,BufRead .jshintc,.hintrc,.swrc,[jt]sconfig*.json 	setf jsonc
+
+" JSON
+au BufNewFile,BufRead *.json,*.jsonp,*.webmanifest	setf json
 
 " Jsonnet
 au BufNewFile,BufRead *.jsonnet,*.libsonnet	setf jsonnet