Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to install #52

Closed
aisthesis opened this issue Apr 14, 2015 · 17 comments
Closed

How to install #52

aisthesis opened this issue Apr 14, 2015 · 17 comments

Comments

@aisthesis
Copy link

This looks like exactly what I want--if only I didn't have to scrape the web to figure out how to install it.

@karambita
Copy link

Just copy everything under ~/.vim
open the file with json extension
$ vim test.json
That's it!

@aisthesis
Copy link
Author

Are you saying this:

$ cd ~/.vim
$ git clone [email protected]:elzr/vim-json.git
$ ls -a
.otherstuff      vim-json

Now just use vim, and the configuration gets picked up when you use a file with .json extension? How about it my .vimrc has filetype specifications? Do I need to comment them out? Or will the above override the configurations in my .vimrc?

@karambita
Copy link

~$ mkdir -p ~/.vim/autoload ~/.vim/bundle;
~$ curl -LSso ~/.vim/autoload/pathogen.vim https://tpo.pe/pathogen.vim

~$ sudo gedit ~/.vimrc
just copy paste the below data into the file and save the file

" contents of minimal .vimrc
execute pathogen#infect()
syntax on
filetype plugin indent on

~$ cd ~/.vim/bundle
~$ git clone [email protected]:elzr/vim-json.git

@mrquincle
Copy link

@karambita Thanks. Would be great if added to the README. 👍

@elzr
Copy link
Owner

elzr commented May 10, 2015

Added link to here in the README for the manual install instructions. Thanks @karambita! :)

@elzr elzr closed this as completed May 10, 2015
@aisthesis
Copy link
Author

Looking through the README.md, I didn't see the link. It in any case should be in a much more prominent spot--like right at the first. As is, the README is nice advertising, but it's very mysterious as to how to actually get the product.

@elzr
Copy link
Owner

elzr commented May 10, 2015

This is the first time in the almost 3 years that this script has been online that this issue has come up. Mysteriousness is not at all deliberate, Pathogen is an inmensely popular installation method. ;) The link back to here was added in the 3rd paragraph in the README: "(Or install it manually.)"

@sprive
Copy link

sprive commented Jun 2, 2015

Note that to get to the link for "manual install" instructions in the README, the user has already read past the Pathogen option. By clicking manual install link, they're expressing a clear request for manual installation instructions.

SO, is @karambita's post the "manual install" method?
Isn't it calling for installation of Pathogen?
Is there a way to manually install without Pathogen?

...As for folks never mentioning the problem before now, there was no issue posted - so nothing to point at and question. It's human nature that when people are alone with a problem, sometimes they may feel like giving up rather than persisting.

@sprive
Copy link

sprive commented Jun 2, 2015

Based on the endorsement of Pathogen (and not having any way to install vim-json without it) I went ahead with Pathogen.

Eventually I got Pathogen working, and vim-json after that was a piece of cake.

My comment to newbies: IGNORE all Pathogen instructions you find in Google results or at vim-scripts site, unless it matches what you see in the Pathogen README. I think some blog posts are out of date (they instruct you to to 'call' pathogen functions in your .vimrc which will fail).

The README for the current release of Pathogen is is clear what you need to do; it's just 3 lines in your .vimrc. Then use git to grab the code (or unzip the download) in your bundle dir.

@zvrablik
Copy link

zvrablik commented Dec 4, 2015

small typo in the git clone

there should be https://github.com/elzr/vim-json.git

@gcbw
Copy link

gcbw commented Jun 13, 2016

if I simply copy this syntax/json.vim to my ~/.vim/syntax/json.vim should it work? (i only need the colors, no fancy indent or syntax occlusion)

and obviously, i've already tested and it did not :) that's why i'm throwing it here to know if i it should work and i screwed something somewhere, or to know if i am missing something else and it was supposed not to work...

@ghost
Copy link

ghost commented Jul 13, 2016

@gcbw
You also need to cp ftplugin/json.vim to ~/.vim/ftplugin/json.vim.
works for me.

@davaya
Copy link

davaya commented Jul 6, 2018

The pathogen documentation notes its own demise - Vim 8 includes native support for package management. See https://shapeshed.com/vim-packages/.

And thanks for creating vim-json - it's exactly what we need.

@ghost
Copy link

ghost commented May 16, 2021

Issues are not really documentation. It would be nice to have proper instructions in the README. Just because only one person has spoken up about the problem it doesn't mean they're the only person who has the problem.

@ruffin--
Copy link

ruffin-- commented Jan 21, 2022

Okay, I'd agree that this was a little discombobulated.

Manual installation instructions (20220121)

This is one version that works.

  1. Download the repo as a zip file (current link).
  2. Access its contents somehow (unzip it, use an app to view contents, whatever)
  3. Find the folder of your VIm install and note it.
    • eg, on Windows, it might be: C:\Program Files (x86)\Vim\vim81\
  4. Copy json.vim from vim-json-master\syntax to your VIm install's syntax folder, which is found in the root level of your install. (hat tip)
  5. Copy json.vim from vim-json-master\ftplugin to your VIm install's ftplugin folder, which is also found in the root level of your install. (hat tip)
  6. Close and reopen your *.json file if it was already open.

For 4. and 5., if you already had a json.vim file, you can replace it with the one you're moving from the repo zip's contents.

If you see errors like the below, you likely have completed step 4. but haven't completed step 5.

lots of vim errors in vim on opening a file


BONUS POINTS:

In the interest of brevity, quotes in your JSON for key names and string values are removed ("concealed") until you put your cursor on a row of json. That makes it very difficult to, eg, distinguish when a numeric value is an number or a string.

{ 
    IsThisAnInt: 15,
    OrIsItAString: 15
}

(One of those is a string.)

To remedy this, add the following line to your .vimrc file:

let g:vim_json_syntax_conceal = 0

This requires VIm 7.3 , apparently. NOTE: If you need help finding your .vimrc, see this.

Now you will see the "full" text, but still with better coloring than the default:

{ 
    "IsThisAnInt": 15,
    "OrIsItAString": "15"
}

Fin


PS: Yes, karambita's instructions, though they might appear to be manual instructions, use Pathogen (grabbing it with curl), which is now apparently obsolete.

@chrisco23
Copy link

I'm using vim for decades (but with minimal customization) and now trying out neovim, so I want it for both for now.
I'm running Arch Linux with sway and waybar, both of whose config files do not have a ".json" extension. Should that matter?

I have copied json.vim now to these folders:

/usr/share/vim/vim91/syntax/
/usr/share/vim/vim91/ftplugin/
/usr/share/nvim/runtime/syntax/
/usr/share/nvim/runtime/ftplugin/

Still getting wall of white text. What am I doing wrong?

I am making many small quick changes to sway and waybar config and it's insane to be running vscodium for this.

@ZsBT
Copy link

ZsBT commented Oct 16, 2024

Any news on this subject?
Readme still does not describe how to install. Things described here does not help.
(Other plugins, e.g. NERDtree works by simply copying to .vim/pack/vendor/start/nerdtree)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests