1347
you are viewing a single comment's thread
view the rest of the comments
[-] fmstrat@lemmy.nowsci.com 24 points 2 years ago
[-] bjornsno@lemm.ee 12 points 2 years ago

Except if it's a single line file, only god can help you then. (Or running prettier -w on it before opening it or whatever.)

[-] xavier666@lemm.ee 9 points 2 years ago

cat file.json | jq also works

[-] expr@programming.dev 4 points 2 years ago* (last edited 2 years ago)

https://porkmail.org/era/unix/award#cat

jq < file.json

cat is for concatenating multiple files, not redirecting single files.

[-] jimbolauski@lemm.ee 4 points 2 years ago

Render Media works the best

rm file.json

[-] xavier666@lemm.ee 3 points 2 years ago

Yes, Render Media is the best. It's hard to believe that not many people know about this tool. It's also natively installed in all Linux distros.

[-] fl42v@lemmy.ml 7 points 2 years ago

4.2 megs on one line? Vim probably can handle it fine, although syntax won't be highlighted past a certain point

[-] bjornsno@lemm.ee 5 points 2 years ago

I've accidentally opened enormous single line json files more than once. Could be lsp config or treesitter or any number of things but trying to do any operations after opening such a file is not a good time.

[-] fl42v@lemmy.ml 1 points 2 years ago

Yeah, very well may be. LSPs always slow down opening big files, so I usually inspect those with an empty/different config

[-] BaldProphet@kbin.social 4 points 2 years ago

Technically every JSON file is a single line, with line break characters here and there

[-] expr@programming.dev 3 points 2 years ago

:syntax off and it works just fine.

this post was submitted on 14 May 2024
1347 points (100.0% liked)

Programmer Humor

39226 readers
71 users here now

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

founded 6 years ago
MODERATORS