I will borrow your config for the emphasis symbols, but for all the paren-related symbols, I will keep the global mapping, so it will still work when writing codes and the like ;)
Pleased to see it was helpful. The funny thing is that I use that config for, maybe, 10 years and never think about changing it. stardiviner writes: > Roland Everaert <reveatw...@gmail.com> writes: > >> Hi, >> >> I use the following configuration: >> >> ;;;;;;;;;;;;;;;; parenthèses, accolades et brackets ;;;;;; >> (setq skeleton-pair t) >> (global-set-key "[" 'skeleton-pair-insert-maybe) >> (global-set-key "{" 'skeleton-pair-insert-maybe) >> (global-set-key "(" 'skeleton-pair-insert-maybe) >> (global-set-key "\"" 'skeleton-pair-insert-maybe) >> (global-set-key "'" 'skeleton-pair-insert-maybe) >> >> This will only close the defined characters. >> >> >> Hope this will help. >> >> Roland. >> > > This is really helpful for me, I use smartparens before, but it is a little > heavy. So I disabled it. I found your solution is simple and fast. I modified > a little: > > #+begin_src emacs-lisp > (require 'skeleton) > (setq skeleton-pair t) > > (define-key org-mode-map (kbd "~") 'skeleton-pair-insert-maybe) > (define-key org-mode-map (kbd "=") 'skeleton-pair-insert-maybe) > (define-key org-mode-map (kbd "*") 'skeleton-pair-insert-maybe) > (define-key org-mode-map (kbd "+") 'skeleton-pair-insert-maybe) > > (define-key org-mode-map (kbd "[") 'skeleton-pair-insert-maybe) > (define-key org-mode-map (kbd "{") 'skeleton-pair-insert-maybe) > (define-key org-mode-map (kbd "(") 'skeleton-pair-insert-maybe) > (define-key org-mode-map (kbd "\"") 'skeleton-pair-insert-maybe) > (define-key org-mode-map (kbd "'") 'skeleton-pair-insert-maybe) > #+end_src -- Luke, use the FOSS Sent from Emacs