From c1073319f89d327fd42b8bca29546a91147036f1 Mon Sep 17 00:00:00 2001 From: hotoo Date: Wed, 21 Sep 2016 14:53:36 +0800 Subject: [PATCH] feat(json): support goto json file. --- README.md | 1 + plugin/jsgf.vim | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 47fd0e1..3336345 100644 --- a/README.md +++ b/README.md @@ -5,6 +5,7 @@ Imporved JavaScript `gf` command. Support: * CommonJS (node_modules, package.json:main, /index.js) +* JSON (*.json) * React (*.jsx) * TypeScript (*.ts, *.tsx) diff --git a/plugin/jsgf.vim b/plugin/jsgf.vim index 53ef39d..e12b3bf 100644 --- a/plugin/jsgf.vim +++ b/plugin/jsgf.vim @@ -8,7 +8,7 @@ endif let loaded_jsgf_plugin = 1 function! InitJSGF() - setlocal suffixesadd+=.js,.jsx,.ts,.tsx + setlocal suffixesadd+=.js,.json,.jsx,.ts,.tsx setlocal isfname+=@-@ " setlocal includeexpr=v:fname.'/index' let node_modules = finddir('node_modules', expand('%:p:h') . ';') @@ -22,6 +22,7 @@ function! FindFileOrDir(filename) let filenames = [ \ a:filename, \ a:filename . '.js', + \ a:filename . '.json', \ a:filename . '.jsx', \ a:filename . '.ts', \ a:filename . '.tsx'