{"id":15387326,"url":"https://github.com/rhysd/vim-fixjson","last_synced_at":"2025-04-15T18:30:36.244Z","repository":{"id":55444061,"uuid":"117359061","full_name":"rhysd/vim-fixjson","owner":"rhysd","description":"Vim plugin for fixjson; a JSON fixer for Humans","archived":false,"fork":false,"pushed_at":"2020-12-30T14:40:32.000Z","size":24,"stargazers_count":28,"open_issues_count":2,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-29T00:33:22.251Z","etag":null,"topics":["fixer","formatter","json","vim","vim-plugin"],"latest_commit_sha":null,"homepage":"https://github.com/rhysd/fixjson","language":"Vim script","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rhysd.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-01-13T16:28:24.000Z","updated_at":"2025-02-06T14:28:00.000Z","dependencies_parsed_at":"2022-08-15T00:21:00.216Z","dependency_job_id":null,"html_url":"https://github.com/rhysd/vim-fixjson","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rhysd%2Fvim-fixjson","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rhysd%2Fvim-fixjson/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rhysd%2Fvim-fixjson/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rhysd%2Fvim-fixjson/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rhysd","download_url":"https://codeload.github.com/rhysd/vim-fixjson/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249128857,"owners_count":21217230,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["fixer","formatter","json","vim","vim-plugin"],"created_at":"2024-10-01T14:53:38.530Z","updated_at":"2025-04-15T18:30:35.662Z","avatar_url":"https://github.com/rhysd.png","language":"Vim script","funding_links":[],"categories":[],"sub_categories":[],"readme":"Vim integration of [fixjson][]\n==============================\n\nThis is a Vim plugin for [fixjson][]. fixjson is a JSON fixer/formatter using\n[(relaxed) JSON5](https://github.com/rhysd/json5).\n\nThis plugin automatically fixes a JSON file asynchronously on saving the file while editing.\n\n- Pretty-printing JSON5 input\n  - ES5 syntax is available to write up\n- Fixes various failures while humans writing JSON\n  - Fixes trailing commas objects or arrays\n  - Fixes missing commas for elements of objects or arrays\n  - Adds quotes to keys in objects\n  - Newlines in strings\n  - Hex numbers\n  - Fixes single quotes to double quotes\n- Fixing/Formatting is done asynchronously. So it does not block user input (e.g. moving cursor)\n\n## Screenshots\n\nWhen moving a line to another line, you no longer need to care about a trailing comma:\n\n![modify keys](https://github.com/rhysd/ss/raw/master/fixjson/modifykeys.gif)\n\nAnd you also don't need to care about a trailing comma of previous line when adding a new element\nto an object or an array:\n\n![add key](https://github.com/rhysd/ss/raw/master/fixjson/addkey.gif)\n\nWhen adding a new key-value to an object, quotes of the key are fixed. And single quotes for strings\nare also fixed to double quotes:\n\n![key quotes](https://github.com/rhysd/ss/raw/master/fixjson/keyquotes.gif)\n\nJSON string does not allow multi-line string. `\\n` is required to embed multi-line string to JSON.\nfixjson automatically fixes newlines in strings. This is useful when copy\u0026paste some string to JSON\nfile:\n\n![newlines in string](https://github.com/rhysd/ss/raw/master/fixjson/newlines.gif)\n\nJSON only accepts decimal digits for numbers. fixjson automatically converts `0x` hex numbers to\ndecimal numbers. You no longer need to convert hex numbers manually:\n\n![hex numbebr](https://github.com/rhysd/ss/raw/master/fixjson/number.gif)\n\nAnd of course it pretty-prints the JSON code, with automatic indent detection:\n\n![pretty printing](https://github.com/rhysd/ss/raw/master/fixjson/prettyprint.gif)\n\n## Installation\n\nPlease use your favorite plugin manager or Vim standard `:packopt` to install.\n\nFor example (neobundle.vim):\n\n```vim\ncall neobundle#add('rhysd/vim-fixjson', {\n            \\ 'lazy' : 1,\n            \\ 'autoload' : {\n            \\     'filetypes' : 'json'\n            \\   }\n            \\ })\n```\n\nIf [fixjson](https://www.npmjs.com/package/fixjson) is not installed globally, vim-fixjson installs\nit locally to `/path/to/vim-fixjson/node_modules` using npm pacakge manager. So you don't need to\ninstall fixjson command manually.\n\n## Usage\n\nAuto-fix on saving a JSON file is enabled by default. And you can also run a `fixjson` formatter by\n`:FixJson` command.\n\nIf you want to update local `fixjson` command, run `:FixJsonUpdateLocalCommand`.\n\nAsynchronous formatting is implemented with [Vital.Async.Promise][] and [Vital.System.Job][].\nIt requires modern Vim or Neovim (Vim 8.0.27+ or Neovim 0.2.0+). If the requirements are not met,\nit falls back to synchronous formatting.\n\nIf you want to format JSON only manually with `:FixJson`, please set `g:fixjson_fix_on_save` to `0`.\n\nIf you want to specify an indent size explicitly, set the number to `g:fixjson_indent_size`.\nBy default, `fixjson` detects an indent size automatically.\n\n## License\n\n```\nCopyright (c) 2018 rhysd\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies\nof the Software, and to permit persons to whom the Software is furnished to do so,\nsubject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\nINCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\nPURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\nLIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR\nTHE USE OR OTHER DEALINGS IN THE SOFTWARE.\n```\n\n[fixjson]: https://github.com/rhysd/fixjson\n[Vital.Async.Promise]: https://github.com/vim-jp/vital.vim/blob/master/autoload/vital/__vital__/Async/Promise.vim\n[Vital.System.Job]: https://github.com/lambdalisue/vital-System-Job\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frhysd%2Fvim-fixjson","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frhysd%2Fvim-fixjson","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frhysd%2Fvim-fixjson/lists"}