user
user

Reputation: 18569

Using Sublime Text 2 key bindings in PyCharm

I would like to use the Sublime Text 2 key bindings in Pycharm. I know how to edit it one by one. Is there a way to override the entire keymap in one shot?

Something like

Pycharm has some pre-configured keymaps. If there's a text / XML / JSON file where these maps are stored, I can try to convert it myself.

enter image description here

Upvotes: 24

Views: 6632

Answers (4)

myusuf
myusuf

Reputation: 12250

PyCharm now has Sublime Text keymap inbuilt as an alternative to Default Keymap.

Go to Setting -> Keymap and select Sublime Text from Keymap dropdown.

enter image description here

Hope that helps.

Upvotes: 24

sajal garg
sajal garg

Reputation: 139

(Less popular) keymaps that can be used with JetBrains Rider but not included in the installation package. https://github.com/JetBrains/rider-non-bundled-keymaps

Intalling keymaps

In releases, get the sublime-text-keymap.jar file for the desired keymap.

In your IDE, choose File | Import Settings... from the menu and select the sublime-text-keymap.jar file.

Upvotes: 0

Ben Creasy
Ben Creasy

Reputation: 4146

There is an IntelliJ request for this in their Youtrack tracker: IDEA-111333 Provide Sublime Text keymap.

From that thread, I found a repository for another remapping project. The keybinding file that imitates most of Sublime text can be found at in the directory PHPStorm-SpacePeacock/win_linux-keymaps-only/keymaps/Default for GNOME copy.xml. From the README:

The key mapping has been updated to better fit Sublime Text conventions. Because I didn't think that ctrl + shift + alt + t is a reasonable key combination for something as frequently used as Refactor This.

Additionally, "search everywhere" HAD to be changed because double-tapping left-shift is a two stroke trigger. This is a problem because as you're working the IDE will be busy with analyzing, indexing, and all of the things that IDEs do. If it's busy when you try to hit the first left-shift, then the second left-shift won't pop up the window. As far as user interfaces go, you should never have any lack of confidence that an action will trigger the appropriate response. Once you have that, you have to visually check each operation which is slow and creates cognitive overhead. Consequently, this was changed to ctrl + p (also to match Sublime Text) which completely removes this problem.

ctrl + p search everywhere

ctrl + r search methods in current file

ctrl + alt + p change projects

ctrl + shift + enter complete current statement

ctrl + alt + enter refactor this

alt + enter show intended actions (intentions are one of my favorite part JetBrains software)

ctrl + n new thing dialog

ctrl + shift + f format code

ctrl + d select word at cursor, or if a word is selected the select the next occurrence of the word (multiple-cursors)

ctrl + t run tests

ctrl + alt + h show local history

ctrl + alt + r git conflict merge tool

Upvotes: 3

user
user

Reputation: 18569

After poking around, I feel there's no easy way to do this.

If you change the default bindings, PyCharm creates a file in user space that shows the format of keymap. Theoretically, one could override all the fields in this file. But the problem is, there's no standard way of describing the action performed by a shortcut. Someone will have to do it manually, for each macro, to establish a correspondence between the actions performed by PyCharm & Sublime Text.

Upvotes: 6

Related Questions