dakrone / es-mode

An Emacs major mode for interacting with Elasticsearch
GNU General Public License v3.0
195 stars 34 forks source link

Auto-format request JSON on es-execute-request-dwim #54

Open drewr opened 7 years ago

drewr commented 7 years ago

Given:

POST /_search
{"query":{"match":{"f":1}}}

It'd be great if upon C-c C-c, it would transform into:

POST /_search
{
  "query": {
    "match": {
      "f": 1
    }
  }
}
dakrone commented 6 years ago

I looked into this, I was thinking this might be better handled with json-mode, in fact, highlighting an expression and doing M-x json-mode-beautify does exactly what I think you want. Would that work for you? I can consider making json-mode an optional dependency and add a keybinding for it, if you think that would work.