Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

Can anyone tell me how to enable Emacs keybind on Chrome?

I found some links but they are either not clearly mentioning how to do so or not what I want (I don't want external tools to be run for this purpose).

share|improve this question
    
Your first link indicates the way. I would guess type gconftool-2 --set /desktop/gnome/interface/gtk_key_theme Emacs or maybe gconftool-2 --type string --set /desktop/gnome/interface/gtk_key_theme Emacs. –  Chan-Ho Suh Apr 24 '12 at 17:11
    
This does not seem to make any difference, I set the relevant configuration item and even restarted my whole system but Chrome does not recognise any Emacs keybindings for me... –  John J. Camilleri Nov 30 '12 at 15:20

3 Answers 3

If you're using gtk3 the settings are in the libgtk-3-common package in /usr/share/themes/Emacs/gtk-3.0/gtk-keys.css and you can enable them with:

gsettings set org.gnome.desktop.interface gtk-key-theme "Emacs"

And to switch back:

gsettings set org.gnome.desktop.interface gtk-key-theme "Default"

If you're using gtk2 the settings are in the libgtk2.0-common package in /usr/share/themes/Emacs/gtk-2.0-key/gtkrc and you can enable them with:

gconftool-2 --type=string --set /desktop/gnome/interface/gtk_key_theme Emacs

And if you want to customize the keybindings you can copy the settings into ~/.themes/ with cp -r /usr/share/themes/Emacs /tmp/.themes/

ps. so does this mean you've managed to win the battle against Unity to steal all your modify keys back for Emacs to use?! :)

share|improve this answer
    
Thx for the answer and i'm sorry to be responding late. Right now I have no need to achieve what I described so I can't test. But seems to be feasible solution so +1 –  IsaacS Jan 3 '13 at 22:46
1  
I managed to turn off key stealing from unity. Basically, in the Keyboard section of System Settings you go to the Shortcuts tab, Window section. Disable "Activate the window menu". In the Launchers section, Key to show the HUD, you should set it to RIGHT ALT (or something else). Problems gone! :) –  Syzygy Mar 8 '13 at 22:20
    
Thank you so much :) Kept doing the gtk2 conf, and it wasn't working... –  Jérémie Apr 14 '13 at 16:15
    
It is discussed here (stackoverflow.com/questions/126141/…) how to determine which gtk version is used. –  Marius Hofert Jun 3 '13 at 22:17
1  
Both methods doesn't work for chromium-browser, which is the only application on Ubuntu 14.04 that I found not obeying configured emacs-keybinding. Any hint? –  Zhang Weiwu May 13 at 10:22

Emacs keybindings for any gtk application except Google Chrome can be easily enabled, just follow the instruction you found.

Emacs keybinding for Google Chrome however was not working at the time of your question (Dec 2012). This is a bug from upstream https://code.google.com/p/chromium/issues/detail?id=11480. It is working now.

The bug has been solved in 2013. But the version of Chromium shipped with Ubuntu 14.04 still was bugged, you can do a security update which will include a version of chromium (v36) with this bug fixed (but as with any other software, total number of bug does not reduce, that is, new features introducing new bugs to replace fixed ones. For me life is harder since i upgrade, because ideographs stopped displaying in tab names).

It seems the other answer offered to you was not aware that your question is Chromium-specific and Emacs keybindings really did not work in Chromium for many years until 2014.

share|improve this answer

Cinnamon has its own settings:

gsettings set org.cinnamon.desktop.interface gtk-key-theme "Emacs" # use emacs
gsettings set org.cinnamon.desktop.interface gtk-key-theme "Default" # use default
share|improve this answer
    
This does not provide an answer to the question. To critique or request clarification from an author, leave a comment below their post - you can always comment on your own posts, and once you have sufficient reputation you will be able to comment on any post. –  David Foerster Nov 6 at 1:08
    
@DavidFoerster This looks like an answer to me. –  Seth Nov 6 at 1:55
    
@Seth: I think it should better be a comment or edit to the answer it tries to complete. –  David Foerster Nov 6 at 12:46
    
@David That is a valid opinion, but it is still an answer, even on its own –  Seth Nov 6 at 14:41

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.