How to change keybindings of atom

末鹿安然 提交于 2019-12-10 03:18:59

问题


I am looking to change keybindings of Atom text editor. I do use Android Studio to code Android application. I want to have similar kinda shortcut for shortcut functionality.

Does Atom allow us to customize key bindings?


回答1:


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.




回答2:


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

paste , save & exit. Restart atom , Done !



来源:https://stackoverflow.com/questions/43627165/how-to-change-keybindings-of-atom

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!