Open Bug 972534 Opened 7 years ago Updated 2 years ago

CodeMirror vim / emacs keybindings should not trigger other DevTools shortcuts

Categories

(DevTools :: Source Editor, defect)

defect
Not set
normal

Tracking

(Not tracked)

People

(Reporter: bgrins, Unassigned)

References

()

Details

(Keywords: DevAdvocacy, Whiteboard: [DevRel:P3])

As reported in hacks post (see URL), the vim keybindings conflict with some devtools keys:

* Escape while editing HTML in the inspector leaves the HTML edit mode instead of Vim’s insert mode
* Ctrl+] shortcut to switch between panels is swallowed by the Style Editor.

I'm thinking the escape key in 'edit as html' situation could be solved by stopping propagation of an event if the special keybindings have handled it.  Not sure if the Ctrl+] is not being handled by the keybindings, or if somehow the panel switching is overriding it.
In vim mode it's also hard to do cut/copy/paste operations...
Duplicate of this bug: 1119191
Duplicate of this bug: 1173056
The editor is basically unusable while this bug exists, at least for the vim bindings.

Should we hide and ignore the pref until this bug is resolved?
Keywords: DevAdvocacy
Whiteboard: [DevRel:P3]
(In reply to Brian Grinstead [:bgrins] from comment #0)
> As reported in hacks post (see URL), the vim keybindings conflict with some
> devtools keys:
> 
> * Escape while editing HTML in the inspector leaves the HTML edit mode
> instead of Vim’s insert mode
> * Ctrl+] shortcut to switch between panels is swallowed by the Style Editor.
> 
> I'm thinking the escape key in 'edit as html' situation could be solved by
> stopping propagation of an event if the special keybindings have handled it.
> Not sure if the Ctrl+] is not being handled by the keybindings, or if
> somehow the panel switching is overriding it.

In the Style Editor, you can use Ctrl+C to exit Insert mode, in both the Linux and OS X versions. Ctrl+[ does indeed break out of Insert mode on the OS X version (as it uses uses Cmd+[ for switching panels, not Ctrl).
(In reply to Mihai Sucan [:msucan] from comment #1)
> In vim mode it's also hard to do cut/copy/paste operations...

Standard shortcuts – such as copy/paste and Scratchpad's Run/Inspect/Display/Pretty Print etc do indeed work in Insert mode. Would we want them to work in Normal mode? I would expect conflicts to arise easily. 

However, the Debugger's shortcuts override Vim keybindings, making it nearly unusable in Normal mode even.
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.