Skip to content

Conversation

felipeochoa
Copy link
Contributor

This PR adds a few keybindings that automate some common JSON edition operations:

  • C-c C-t: Toggle between true and false at point

    1. before: "options": {"alwaysInclude": |true, ...}
      after: "options": {"alwaysInclude": |false, ...}
    2. before: "options": {"alwaysInclude": |false, ...}
      after: "options": {"alwaysInclude": |true, ...}
  • C-c C-k: Replace the sexp at point with null

    1. before: "options": {|"alwaysInclude": true, ...}
      after: "options": null|
    2. before: "question": {"number": |5, "type": "number"},
      after: "question": {"number": null|, "type": "number"},
    3. before: "question": {"number": 5, "type": "nu|mber"},
      after: "question": {"number": null, "type": null|},
  • C-c C-i: Increment the number at point
    before: "question": {"number": |5, "type": "number"},
    after: "question": {"number": |6, "type": "number"},

  • C-c C-d: Decrement the number at point
    before: "question": {"number": |5, "type": "number"},
    after: "question": {"number": |4, "type": "number"},

felipeochoa and others added 2 commits July 19, 2017 11:19
- `C-c C-t`: Toggle between `true` and `false` at point
- `C-c C-k`: Replace the sexp at point with `null`
- `C-c C-i`: Increment the number at point
- `C-c C-d`: Decrement the number at point
@joshwnj joshwnj merged commit 32d5a9b into json-emacs:master Jul 20, 2017
@joshwnj
Copy link
Collaborator

joshwnj commented Jul 20, 2017

@felipeochoa thanks!

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

Successfully merging this pull request may close these issues.

2 participants