]> git.madduck.net Git - etc/vim.git/commitdiff

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

Add requirement of json syntax
authorHiroshi Shirosaki <h.shirosaki@gmail.com>
Fri, 22 Jan 2016 00:28:22 +0000 (09:28 +0900)
committerHiroshi Shirosaki <h.shirosaki@gmail.com>
Fri, 22 Jan 2016 00:28:22 +0000 (09:28 +0900)
Ubuntu vim package does not have json syntax.

Makefile
README.md
syntax/markdown.vim
test/run-tests.sh
test/vimrc

index a50adc0b9c5927025e377d1dbcbf5cdf7275327e..231c0af1dfdf75e7365e892c284001029f953909 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -18,13 +18,14 @@ install:
        mkdir -pv ${REGISTRY}
        cp -v registry/markdown.yaml ${REGISTRY}/markdown.yaml
 
        mkdir -pv ${REGISTRY}
        cp -v registry/markdown.yaml ${REGISTRY}/markdown.yaml
 
-test: build/tabular build/vim-toml build/vader.vim
+test: build/tabular build/vim-toml build/vim-json build/vader.vim
        test/run-tests.sh
 .PHONY: test
 
        test/run-tests.sh
 .PHONY: test
 
-update: build/tabular build/vim-toml build/vader.vim
+update: build/tabular build/vim-toml build/vim-json build/vader.vim
        cd build/tabular && git pull
        cd build/vim-toml && git pull
        cd build/tabular && git pull
        cd build/vim-toml && git pull
+       cd build/vim-json && git pull
        cd build/vader.vim && git pull
 .PHONY: update
 
        cd build/vader.vim && git pull
 .PHONY: update
 
@@ -34,6 +35,9 @@ build/tabular: | build
 build/vim-toml: | build
        git clone https://github.com/cespare/vim-toml build/vim-toml
 
 build/vim-toml: | build
        git clone https://github.com/cespare/vim-toml build/vim-toml
 
+build/vim-json: | build
+       git clone https://github.com/elzr/vim-json build/vim-json
+
 build/vader.vim: | build
        git clone https://github.com/junegunn/vader.vim build/vader.vim
 
 build/vader.vim: | build
        git clone https://github.com/junegunn/vader.vim build/vader.vim
 
index 60c58eca969bfd0b267f8661fb736132f751e6fe..6780572aa11fd1b4d572fbdfb07c3d8752c1a010 100644 (file)
--- a/README.md
+++ b/README.md
@@ -159,6 +159,8 @@ let g:vim_markdown_toml_frontmatter = 1
 
 Highlight JSON front matter as used by [Hugo](https://gohugo.io/content/front-matter/).
 
 
 Highlight JSON front matter as used by [Hugo](https://gohugo.io/content/front-matter/).
 
+JSON syntax highlight requires [vim-json](https://github.com/elzr/vim-json).
+
 ```vim
 let g:vim_markdown_json_frontmatter = 1
 ```
 ```vim
 let g:vim_markdown_json_frontmatter = 1
 ```
index 05cf75106fa364daeba8d82ecedc0d030cf06864..186216efe7c3de2e99509593a398bb408f0c652c 100644 (file)
@@ -124,9 +124,13 @@ if get(g:, 'vim_markdown_toml_frontmatter', 0)
 endif
 
 if get(g:, 'vim_markdown_json_frontmatter', 0)
 endif
 
 if get(g:, 'vim_markdown_json_frontmatter', 0)
-  syn include @jsonTop syntax/json.vim
-  syn region Comment matchgroup=mkdDelimiter start="\%^{$" end="^}$" contains=@jsonTop
-  unlet! b:current_syntax
+  try
+    syn include @jsonTop syntax/json.vim
+    syn region Comment matchgroup=mkdDelimiter start="\%^{$" end="^}$" contains=@jsonTop
+    unlet! b:current_syntax
+  catch /E484/
+    syn region Comment matchgroup=mkdDelimiter start="\%^{$" end="^}$"
+  endtry
 endif
 
 if get(g:, 'vim_markdown_math', 0)
 endif
 
 if get(g:, 'vim_markdown_math', 0)
index ba00fc01fca33157f22d7579325a0be755c9e618..5c9db06debb6207398c9a08effee54fb8ac1fecd 100755 (executable)
@@ -5,7 +5,7 @@ set -e
 
 cd "$( dirname "${BASH_SOURCE[0]}" )"
 
 
 cd "$( dirname "${BASH_SOURCE[0]}" )"
 
-for dep in ../build/tabular ../build/vim-toml ../build/vader.vim; do
+for dep in ../build/tabular ../build/vim-toml ../build/vim-json ../build/vader.vim; do
   if [[ ! -d $dep ]]; then
     echo "Missing dependency: $dep"
     echo "You may just want to use 'make test'."
   if [[ ! -d $dep ]]; then
     echo "Missing dependency: $dep"
     echo "You may just want to use 'make test'."
index 015febfe148d22907bc17190f765933558dca613..463cbd8f552f0c056304f3b56ba91e8ddf40a44a 100644 (file)
@@ -2,6 +2,7 @@ set nocompatible
 set rtp+=../
 set rtp+=../build/tabular/
 set rtp+=../build/vim-toml/
 set rtp+=../
 set rtp+=../build/tabular/
 set rtp+=../build/vim-toml/
+set rtp+=../build/vim-json/
 set rtp+=../build/vader.vim/
 let $LANG='en_US'
 filetype on
 set rtp+=../build/vader.vim/
 let $LANG='en_US'
 filetype on