I installed the json-mode package, then added this to my .emacs:

(require 'json-mode)
(add-hook 'json-mode-hook 'hs-minor-mode)

After opening a json file, I used Describe-variable on hs-minor-mode and found it was set to true.

But when I try to use any of the keybindings listed on Hide Show they don't work.

If I try C-c C-c for example, it says it is undefined. If I try C-c ESC C-h as shown in the example, the help window opens. How do I make this work.


So I realized my mistake shortly after submitting my question, and rather than deleting it I thought I'd answer in case someone else ends up here.

Many of the keybindings on the Hide Show page are written in the form

C-<something> @ C-<something>

I took the @ to simply be a delimiter between the two chained commands, but it turns out it's literally an @ sign (silly me...). So to execute the toggle hide/show command ( C-c @ C-c ), for example, you need to type C-c followed by @ (holding the shift key of course) followed by C-c. D'oh...

| improve this answer | |
  • Glad you found the problem. If you plan to use hs a lot, you can always rebind those commands to more convenient keys. – Dan Sep 1 '15 at 15:05
  • Time will tell how much time I'm spending in the Json, but yea the @ key is a bit out of the way haha – Kittenmittons Sep 1 '15 at 15:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.