All Projects → kevinoid → vim-jsonc

kevinoid / vim-jsonc

Licence: MIT license
⚠️Deprecated⚠️: Vim syntax highlighting plugin for JSON with C-style line (//) and block (/* */) comments.

Programming Languages

Vim Script
2826 projects
shell
77523 projects

Projects that are alternatives of or similar to vim-jsonc

Vimpanel
A modern side panel for Vim
Stars: ✭ 97 (+86.54%)
Mutual labels:  vim-plugin, vim-plugins
vim-phpstan
A Vim plugin for PHPStan - https://github.com/phpstan/phpstan. It calls `phpstan` to do static analysis of your PHP code and displays the errors in Vim's quickfix list.
Stars: ✭ 26 (-50%)
Mutual labels:  vim-plugin, vim-plugins
Vim Todo Lists
Vim plugin for TODO lists
Stars: ✭ 126 (+142.31%)
Mutual labels:  vim-plugin, vim-plugins
Vim Strand
A barebones Vim plugin manger written in Rust
Stars: ✭ 38 (-26.92%)
Mutual labels:  vim-plugin, vim-plugins
Visual Split.vim
Vim plugin to control splits with visual selections or text objects
Stars: ✭ 190 (+265.38%)
Mutual labels:  vim-plugin, vim-plugins
Vim Systemd Syntax
Syntax highlighting for systemd service files in Vim.
Stars: ✭ 57 (+9.62%)
Mutual labels:  vim-plugin, vim-plugins
Vimux
easily interact with tmux from vim
Stars: ✭ 1,980 (+3707.69%)
Mutual labels:  vim-plugin, vim-plugins
Alchemist.vim
Elixir Integration Into Vim
Stars: ✭ 632 (+1115.38%)
Mutual labels:  vim-plugin, vim-plugins
Exit Vim
Vim plugin that exits Vim on startup
Stars: ✭ 176 (+238.46%)
Mutual labels:  vim-plugin, vim-plugins
Vim Dadbod Completion
Database autocompletion powered by https://github.com/tpope/vim-dadbod
Stars: ✭ 163 (+213.46%)
Mutual labels:  vim-plugin, vim-plugins
Hot Reload.vim
A (Neo)vim plugin for Flutter to automatically hot reload the project every time a file is saved
Stars: ✭ 33 (-36.54%)
Mutual labels:  vim-plugin, vim-plugins
Nerdtree
A tree explorer plugin for vim.
Stars: ✭ 16,380 (+31400%)
Mutual labels:  vim-plugin, vim-plugins
Vimcompletesme
You don't Complete Me; Vim Completes Me! A super simple, super minimal, super light-weight tab completion plugin for Vim.
Stars: ✭ 752 (+1346.15%)
Mutual labels:  vim-plugin, vim-plugins
Fzf Filemru
File MRU with fzf.vim
Stars: ✭ 76 (+46.15%)
Mutual labels:  vim-plugin, vim-plugins
Context.vim
Vim plugin that shows the context of the currently visible buffer contents
Stars: ✭ 688 (+1223.08%)
Mutual labels:  vim-plugin, vim-plugins
Ale
Check syntax in Vim asynchronously and fix files, with Language Server Protocol (LSP) support
Stars: ✭ 11,380 (+21784.62%)
Mutual labels:  vim-plugin, vim-plugins
Nerdcommenter
Vim plugin for intensely nerdy commenting powers
Stars: ✭ 4,454 (+8465.38%)
Mutual labels:  vim-plugin, vim-plugins
Tmux Complete.vim
Vim plugin for insert mode completion of words in adjacent tmux panes
Stars: ✭ 447 (+759.62%)
Mutual labels:  vim-plugin, vim-plugins
Targets.vim
Vim plugin that provides additional text objects
Stars: ✭ 2,114 (+3965.38%)
Mutual labels:  vim-plugin, vim-plugins
Vifm.vim
Vim plugin that allows use of vifm as a file picker
Stars: ✭ 197 (+278.85%)
Mutual labels:  vim-plugin, vim-plugins

⚠️ Deprecated ⚠️

Support for the jsonc filetype is included in Vim 8.2.3117 and later (#8500) and NeoVim 0.6.0 and later (#15494). Using the built-in jsonc filetype plugin is recommended.

Note: The built-in jsonc filetype is currently only applied to files with the .jsonc extension. To use the filetype for additional files, consider adding a modeline comment and/or copying ftdetect/jsonc.vim from this plugin into 'runtimepath'.

JSON with Comments for Vim

Vim syntax highlighting plugin for JSON with C-style line (//) and block (/* */) comments.

It defines a filetype named jsonc (matching the name used in VS Code, a Microsoft parser library, .mocharc.jsonc, and the jsonc npm package) which can be applied to files using set ft=jsonc or a modeline.

Installation

This plugin can be installed in the usual ways:

Using Vim Packages

git clone https://github.com/kevinoid/vim-jsonc.git ~/.vim/pack/git-plugins/start/vim-jsonc

Using Pathogen

git clone https://github.com/kevinoid/vim-jsonc.git ~/.vim/bundle/vim-jsonc

Using Vundle

Add the following to .vimrc:

Plugin 'kevinoid/vim-jsonc'

Then run :PluginInstall.

Using vim-plug

Add the following to .vimrc between plug#begin() and plug#end():

Plug 'kevinoid/vim-jsonc'

Implementation

This plugin loads the JSON syntax plugin, clears the syntax group for comments as errors, then defines additional syntax to match C-style comments.

This project was inspired by, and the code is based on, elzr/vim-json#61 by @TheLocehiliosan.

Filetype Detection

Once installed, the jsonc filetype is automatically used for files named *.jsonc, *.cjson, and *.cjsn. Additionally, some configuration files known to support JSON with comments are recognized by name. See ftdetect/jsonc.vim for the complete list.

To use the jsonc filetype for additional file names/paths, consider using an :autocmd. For example, to treat files with the extension mycjson as jsonc by adding the following to vimrc:

autocmd BufRead,BufNewFile *.mycjson set filetype=jsonc

Note: Users with large or complex configurations may want to consider placing the :autocmd in after/filetype.vim or ftdetect/mycjson.vim for performance and to keep vimrc manageable. See :filetype, new-filetype, and after-directory for details.

If the file name or extension is widely used for JSON with comments, please consider sending a pull request to add it to ftdetect/jsonc.vim.

Contributing

Contributions are appreciated! Please add tests where possible and ensure ./run-tests.sh passes.

If the desired change is large, complex, backwards-incompatible, can have significantly differing implementations, or may not be in scope for this project, opening an issue before writing the code can avoid frustration and save a lot of time and effort.

License

This package is available under the terms of the MIT License.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].