[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Orgmode] Re: shortcut keys for mark ups
From: |
Richard Riley |
Subject: |
Re: [Orgmode] Re: shortcut keys for mark ups |
Date: |
Tue, 06 Jan 2009 20:25:25 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) |
Or use the org-mode map rather than global key
(define-key org-mode-map (kbd "C-<f9>") '(lambda()(interactive)(insert
"#+BEGIN_EXAMPLE\n\n#+END_EXAMPLE")(previous-line)))
Xin Shi <address@hidden> writes:
> Hi Bernt,
>
> Thanks for your reply! That's what I was trying to do. But I think
> Carsten's suggestion of using the "org-structure-template-alist" is
> more appealing to general user.
>
> Xin
>
>
> Bernt Hansen wrote:
>> Xin Shi <address@hidden> writes:
>>
>>
>>> In org mode, are there any shortcut keys for typing the following mark-ups?
>>>
>>> #+BEGIN_EXAMPLE
>>> #+END_EXAMPLE
>>>
>>
>> Not that I'm aware of. You can use a function like the following to
>> achieve this - or maybe you can use yasnippets (I've never tried that
>> yet)
>>
>> ------------------------------------------------------------------------
>> (defun bth-begin-example ()
>> (interactive)
>> (save-excursion
>> (beginning-of-line)
>> (insert "#+BEGIN_EXAMPLE\n")
>> (end-of-line)
>> (insert "\n#+END_EXAMPLE")))
>>
>>
>> (global-set-key (kbd "<f9> e") 'bth-begin-example)
>> ------------------------------------------------------------------------
>>
>> Then you can just type <f9> e while on a line and it'll put the EXAMPLE
>> block around the current line.
>>
>> HTH,
>>
>> -Bernt
>>
>
>
>
> _______________________________________________
> Emacs-orgmode mailing list
> Remember: use `Reply All' to send replies to the list.
> address@hidden
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode
--
important and urgent problems of the technology of today are no longer the
satisfactions of the primary needs or of archetypal wishes, but the reparation
of the evils and damages by the technology of yesterday. ~Dennis Gabor,
Innovations: Scientific, Technological and Social, 1970