0

I hate it when prelude auto adds the ending } when I type { (this is ruby mode)

This is very common, for example typing ( auto adds a ) This is really annoying when trying to edit code, or a lot of copy/pasting.

I want emacs/prelude to permanently not do this kind of thing. I have started customizing ~/.emacs.d/personal/personal.el for other things, but not sure how I should go about getting this done.

  • 3
    Could you be more specific in the title of the issue? Something like "Prelude: do not add closing pair", for instance. – Manuel Uberti Nov 24 '17 at 14:40
  • You could try (smartparens-global-mode -1) in your personal configuration. – Tobias Nov 24 '17 at 14:43
  • You are, or Prelude is perhaps, imposing this hair shirt on yourself. Emacs does not do that by default. You might consider just using show-paren-mode and foregoing the eager insertion of balanced delimiters. (That's a holdover from non-/pre-Emacs 1980s "structured editing", IMHO. The idea was to never let you do anything in an editor that would at any moment allow code to have invalid syntax. Some XML editors still impose this, but they usually give you a way to opt out, either by config or on the fly.) – Drew Nov 24 '17 at 18:23
  • 1
    Please change the title of the question to something informative about the content of the post. A rant in place of an informative question title is counterproductive. – Dan Nov 24 '17 at 19:21
1

thanks tobias

(smartparens-global-mode -1)

does the trick

Update: This doesn't work. ( I checked the next day) Still looking for an answer.

I can manually do M-x smarparens-mode after opening each file, which is cumbersome

  • Where did you put (smartparens-global-mode -1)? – Tobias Dec 1 '17 at 2:01
  • its the last line in ~/.emacs.d/personal/personal.el – american-ninja-warrior Dec 1 '17 at 14:15
  • I have reinstalled emacs and also restarted the brew emacs service – american-ninja-warrior Dec 1 '17 at 14:16
  • the problem appears sometimes. not always. – american-ninja-warrior Dec 1 '17 at 14:22
0

Try this too

(add-hook 'ruby-mode-hook 'turn-off-smartparens-mode)
  • Why only in ruby-mode? – Stefan Dec 11 '17 at 13:29

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.