Giter Club home page Giter Club logo

vim-sjson's Introduction

sjson.vim

sjson.vim provides syntax highlighting to the simplified JSON ("SJSON") file format used by the Bitsquid engine.

Installation

Install via your plugin manager or method of choice. There are no special installation requirements.

Detecting SJSON Files

Most SJSON files don't actually use the .sjson extension. Instead they are named according to the type of object they represent in the engine. This complicates filetype detection, as the extensions in practice often conflict with other common extensions (and individual projects may have unique extensions that this plugin cannot account for).

Generally, all the SJSON files for a given project are underneath a particular directory. Thus, you can assume all files under that directory are SJSON and encode that assumption in your .vimrc:

augroup set_sjson_filetype
  autocmd!
  autocmd BufRead,BufNewFile ~/your/project/data/path/* set filetype=sjson
auground end

Highlight Groups

sjson.vim defines the following highlight groups.

  • sjsonKeyword (keywords like null, true and false)
  • sjsonComment (comments, which are C++-style; C-style comments are not yet supported)
  • sjsonBracket (opening and closing square brackets)
  • sjsonBrace (opening and closing curly braces)
  • sjsonEquals (the assignment operator)
  • sjsonComma (the comma)
  • sjsonNumber (numbers)
  • sjsonString (characters enclosed in double quotes)

These are initially all linked to standard highlight groups; if you want to provide custom highlighting you can override the group in your own .vimrc. For example, if you want to make commas (which are optional in SJSON) really stand out, you could put

highlight sjsonComma guifg=#ff0000 gui=bold

somewhere in your .vimrc

vim-sjson's People

Contributors

jpetrie avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.