[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Emacs keybindings according to file type
From: |
Christopher Dimech |
Subject: |
Re: Emacs keybindings according to file type |
Date: |
Wed, 23 Sep 2020 08:33:16 +0200 |
Dear Compeers,
I wrote the following code to swap line for org files.
Did not work after trying it. I need to have the thing work for
org files and other files on whicn I call M-x org-mode.
( defun Transpose-Org-Line ()
"Binds up and down keys to org-drag-line* commands"
(local-set-key (kbd "C-t l f") 'org-drag-line-forwarrd)
(local-set-key (kbd "C-t l b") 'org-drag-line-backward)
)
( add-hook 'org-mode-hook 'Transpose-Org-Line )
---------------------
Christopher Dimech
Chief Administrator - Naiad Informatics - GNU Project (Geocomputation)
- Geophysical Simulation
- Geological Subsurface Mapping
- Disaster Preparedness and Mitigation
- Natural Resource Exploration and Production
- Free Software Advocacy
> Sent: Monday, September 21, 2020 at 2:16 PM
> From: "Eli Zaretskii" <eliz@gnu.org>
> To: help-gnu-emacs@gnu.org
> Subject: Re: Emacs keybindings according to file type
>
> > From: Christopher Dimech <dimech@gmx.com>
> > Date: Mon, 21 Sep 2020 08:46:02 +0200
> >
> > I want to set different keybinding according to the type of file I load
> > into a buffer. I wonder how I can do that.
>
> The usual way of doing this is use local-set-key in a mode hook. Then
> the key bindings will only affect the mode of that file.
>
>
- Emacs keybindings according to file type, Christopher Dimech, 2020/09/21
- Re: Emacs keybindings according to file type, Eli Zaretskii, 2020/09/21
- Re: Emacs keybindings according to file type, Christopher Dimech, 2020/09/21
- Re: Emacs keybindings according to file type,
Christopher Dimech <=
- Re: Emacs keybindings according to file type, Yuri Khan, 2020/09/23
- Re: Emacs keybindings according to file type, Christopher Dimech, 2020/09/23
- Re: Emacs keybindings according to file type, Yuri Khan, 2020/09/23
- Re: Emacs keybindings according to file type, Christopher Dimech, 2020/09/23
- Re: Emacs keybindings according to file type, Marcin Borkowski, 2020/09/23
- Re: Emacs keybindings according to file type, Emanuel Berg, 2020/09/23