conditional key binding base on focused view.

Answered

Is there any plan to improve key-binding mechanism base on focused view, like atom, vscode or spacemacs?

atom does like this

'atom-workspace.leader-mode, atom-workspace.leader-mode atom-text-editor:not(.mini)':
'0': 'tree-view:toggle-focus'
'1': 'window:focus-pane-on-left'
'2': 'window:focus-pane-on-right'

and vscode

{ "key": "shift+cmd+right", "command": "cursorEndSelect",
"when": "editorTextFocus" },
{ "key": "shift+end", "command": "cursorEndSelect",
"when": "editorTextFocus" },
{ "key": "cmd+left", "command": "cursorHome",
"when": "editorTextFocus" }

 

I can work with same key bindings no matter which editor just because of the binding capability, but not with the JetBrain IDEs.

It'll give us much more flexibility.

2
3 comments

There are actions in IDE that depend on where the focus is and the actions can be customized in Keymap settings.

To focus particular tool window Alt+(0-9) can be used; Esc key will navigate focus to opened Editor; Could you may be provide some specific examples in IDE that you would like to be able to configure differently? Thanks.

0
Avatar
Permanently deleted user

Thanks for the answer Andrey.

Where is the guide for that? I just couldn't find an article which you mentioned about.

 

As a spacemacs fan. for example

*on project tool window

- navigate files via j/k

- c for create a new file

- C for copy a file

- r for rename

- / for match file name

 

*on editor window

- let ideavim handle the keys

 

*on quick open, command palette

- ctrl-j/k to navigate down/up suggestions 

 

and so on.

 

you'll know what I want If you try to map spacemacs keys on jetbrain.

I can make almost every spacemacs keybindings work on atom, some on vscode, almost none of on jetbrain.

 

Thanks.

1

>As a spacemacs fan. for example

>*on project tool window

>- navigate files via j/k

Atm it is not possible to remap navigation keys for project tool window, one could vote and follow these requests:

https://youtrack.jetbrains.com/issue/IDEA-123918https://youtrack.jetbrains.com/issue/VIM-1071

 

> c for create a new file

> C for copy a file

>r for rename

There are

- Main menu | Code | Generate...

- Main menu | Refactor | Copy...

- Main menu | Refactor | Rename...

action in Settings(Preferences) | Keymap which you can remap shortcuts for. Does it help?

0

Please sign in to leave a comment.