Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change Atom Keybindings

I am looking to change keybindings of Atom text editor. I am familiar with Android Studio.

Does Atom allow us to customize key bindings?

like image 599
N Sharma Avatar asked Apr 26 '17 07:04

N Sharma


People also ask

How do I set up Keybindings?

Select the Start button, and then select Microsoft Mouse and Keyboard Center. From the displayed list of key names, select the key that you want to reassign. In the command list of the key that you want to reassign, select a command.

What is the shortcut for run in atom?

Use Script Package and then Ctrl+Shift+B to run the code. Output will be shown at bottom of ATOM.


2 Answers

You have to go to Edit -> Preferences -> Keybinding. In this tab you can see your actual binding and if you want to change it, you can access to the keymap file and overcharged configuration.

To access this file you can click on the link below the "Keybindings" title.

For example, if you want to replace the CtrlShiftK by CtrlShiftY, search it in the list, click on the copy icon to copy the configuration line, and put the line into the keymap file and replace the shortcut.

For this example the new line is

'atom-text-editor:not([mini])':
  'ctrl-shift-Y': 'editor:delete-line'

This line replace ctrl-shift-K by ctrl-shift-Y. You have to relaunch Atom to apply this change.

like image 56
Antoine Amara Avatar answered Oct 12 '22 03:10

Antoine Amara


To override existing atom keybindings, just paste the new keybinding in

~/.atom/keymap.cson

If you want emacs keybindings for atom, get all the keybindings from, https://github.com/dvorka/atom-editor-emacs-key-bindings/blob/master/keymap.cson

TO APPLY:

$ gedit ~/.atom/keymap.cson

gedit is the editor available in gnome, you can also use vi or emacs or even nano to edit.

$ vi ~/.atom/keymap.cson

$ emacs -nw ~/.atom/keymap.cson

$ nano ~/.atom/keymap.cson

modify, save & exit. Restart atom, Done!

like image 41
Attaullah Khan Avatar answered Oct 12 '22 03:10

Attaullah Khan