Join the discussion
Write your take first — we'll ask for email only when you're ready to publish.
- Hacker News
- I do a lot of this and `pbpaste | sed s/^ // | pbcopy` and things like that. It just fits my brain better. What's nice about raycast as a macOS pasteboard manager is that whatever you last selected via Cmd-Shift-V is the output of `pbpaste`. I'm not 100% sure how that is affected by copying images though.by 1-more
- I think kde plasma's clipboard tool is quite underrated for this type of thing too. you add something similar as an action, then you get a little popup format button whenever you copy any json. I use it for all sorts of similar things
- I have a similar alias for borkdude’s ‘jet’ tool.
The extra nice thing about jet is you can convert json into edn, then pipe it into an inline babashka repl where you can inspect the object with all the power of clojure. It is super duper nice for quickly looking through hunks (even huge hunks) of json. You can sum things up, filter through thousands of elements, generate a json schema with malli, whatever you want!
by chamomeal - A universal tool (well, since I use Windows, a Windows tool) to modify the clipboard would be cool.
So, copy text to clipboard, press a hotkey to popup the menu, and it'll offer options depending on the detected text. For example changing the clipboard contents to prettified (if it detects JSON, XML, HTML), or formatting a number back and forth (e.g. working with SSN's out of numerical DB entries when they prefer AAA-GG-SSSS).
by netsharc - Loved it! I made this version for `fish` and `wl-clipboard`:
By saving it to .config/fish/functions/clipboard-format-json.fish, it should immediately workfunction clipboard-format-json # Inspired by https://chris48s.github.io/blogmarks/posts/2021/jsontidy/ if set -l formatted "$(wl-paste | jq '.')" wl-copy $formatted end endby bilkow - There is also: - xq for xml - yq for yamlby dpflan
- Lovely little alias, but I much prefer fracjson[0] pretty printing to jq, so I might go with that instead!by OskarS
- I use similar approach for fixing up clipboard contents with
But also I switched to xsel at one point, as xclip doesn't seem to deal as well with unicode. It could be xclip has been fixed since then, though.tr '\n' ' ' | sed 's/\t/ /g; s/ */ /g'by _flux