Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does there exist an emacs intelligent parenthesis matching plugin/configuration?

Tags:

emacs

elisp

In emacs is there a mode where if I type ( it autocloses it like so (), but if I put it infront of a word like so (word it doesnt do ()word, but just intelligently stays like (word? I've tried smartparens and autopair to no avail, but maybe i haven't configured them correctly?

like image 817
bneil Avatar asked Mar 16 '23 04:03

bneil


1 Answers

Use the built-in (as of version 24.something) electric-pair-mode with conservative pairing:

(setq-default electric-pair-inhibit-predicate 'electric-pair-conservative-inhibit)
(electric-pair-mode 1)
like image 170
scottfrazer Avatar answered Apr 27 '23 18:04

scottfrazer