emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] electric-pair, autopair, smartparens, etc in org-mode


From: Roland Everaert
Subject: Re: [O] electric-pair, autopair, smartparens, etc in org-mode
Date: Wed, 24 Oct 2018 12:38:27 +0200
User-agent: mu4e 1.1.0; emacs 26.1

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 <address@hidden> 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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]