Closed Bug 941725 Opened 11 years ago Closed 10 years ago

Add emacs and vim key bindings to source editor

Categories

(DevTools :: Source Editor, defect, P3)

x86
macOS
defect

Tracking

(Not tracked)

RESOLVED FIXED
Firefox 29

People

(Reporter: fitzgen, Assigned: anton)

References

(Blocks 1 open bug)

Details

Attachments

(1 file, 3 obsolete files)

Would be cool if we had a dropdown in the options panel to choose different keybinding styles for inside the source editor. Specifically, one of those should be emacs style keybindings. Should be easy since there's a mode/plugin/something for code mirror, right?
Priority: -- → P2
This is not P2 at all.
Assignee: anton → nobody
Priority: P2 → P3
(In reply to Anton Kovalyov (:anton, @valueof) from comment #1)
> This is not P2 at all.

It is assigned, therefore P2. And you said it would take like five minutes last night.
Priority: P3 → P2
Assignee: nobody → anton
Assignee: anton → nobody
Priority: P2 → P3
Assignee: nobody → gabriel.luong
Assignee: gabriel.luong → nobody
Assignee: nobody → anton
Summary: Add emacs key bindings to source editor → Add emacs and vim key bindings to source editor
Attached patch WIP 1 (obsolete) — Splinter Review
This patch adds Emacs and VIM keymaps to our source editor. Since CodeMirror architecture is obviously different from both Emacs and VIM, the support is approximate.

I also added a new event, save, that is triggered whenever a save command is called. In VIM mode it is with :w so you get this kind of interaction: http://vimeo.com/83533549

Reviews: benvie for scratchpad, mihai for sourceeditor and harth for styleeditor changes.
Attachment #8356249 - Flags: review?(mihai.sucan)
Attachment #8356249 - Flags: review?(fayearthur)
Attachment #8356249 - Flags: review?(bbenvie)
Comment on attachment 8356249 [details] [diff] [review]
WIP 1

Review of attachment 8356249 [details] [diff] [review]:
-----------------------------------------------------------------

r=me for style editor change.
Attachment #8356249 - Flags: review?(fayearthur) → review+
Attached patch WIP 2 (obsolete) — Splinter Review
Rebased with the current fx-team and added keymap/ files to codemirror/README. Carrying over harth's r+.
Attachment #8356249 - Attachment is obsolete: true
Attachment #8356249 - Flags: review?(mihai.sucan)
Attachment #8356249 - Flags: review?(bbenvie)
Attachment #8356268 - Flags: review?(mihai.sucan)
Attachment #8356268 - Flags: review?(bbenvie)
Comment on attachment 8356268 [details] [diff] [review]
WIP 2

Review of attachment 8356268 [details] [diff] [review]:
-----------------------------------------------------------------

Scratchpad changes LGTM.
Attachment #8356268 - Flags: review?(bbenvie) → review+
Comment on attachment 8356268 [details] [diff] [review]
WIP 2

Review of attachment 8356268 [details] [diff] [review]:
-----------------------------------------------------------------

LGTM and I am glad to see vim mode. I like that - it seems good enough.
Attachment #8356268 - Flags: review?(mihai.sucan) → review+
Do you plan to add some tests for these new key maps?
> Do you plan to add some tests for these new key maps?

Good point. CodeMirror has its own tests for both VIM and Emacs bindings. I will add them to this patch and then will figure out the way to integration test this.
Attached patch WIP 3 (obsolete) — Splinter Review
Added CM tests for both Emacs and VIM mode. Since this adds a lot of new tests, running a Try to make sure we're not timing out on Linux machines: https://tbpl.mozilla.org/?tree=Try&rev=4a9d3d89279a

Carrying over r+ from harth, benvie and msucan.
Attachment #8356268 - Attachment is obsolete: true
Attachment #8356693 - Flags: review+
Will this feature also be available in Nightly for windows?
Or it's for Mac OS X only?
It is available on all platforms.
This was landed in m-c by the way.
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Actually, I can't find it in m-c. Was it ever merged or backed out?
Status: RESOLVED → REOPENED
Flags: needinfo?(kwierso)
Resolution: FIXED → ---
Nvm, seems like it was backed out here: https://github.com/mozilla/gecko-dev/commit/43291099f8264f6782f42a25fc5208c036e695f7
Flags: needinfo?(kwierso)
Yeah, looks like this was backed out in https://hg.mozilla.org/integration/fx-team/rev/ad44a7aa67e1 but that comment never ended up here.
Whiteboard: [fixed-in-fx-team]
Landing again, with VIM/Emacs addon tests disabled: https://hg.mozilla.org/integration/fx-team/rev/c15cacb7efd6 They will be re-enabled once we split codemirror.html into multiples. (At this point we have to.)
Whiteboard: [fixed-in-fx-team]
Sorry, backed out because of CodeMirror test failures again:
https://hg.mozilla.org/integration/fx-team/rev/31f20a54082f

https://tbpl.mozilla.org/?tree=Fx-Team&rev=c15cacb7efd6
Whiteboard: [fixed-in-fx-team]
Attached patch vim.patchSplinter Review
So, I split CodeMirror test suite into two: one for all basic tests, another for VIM/Emacs modes only. It seems to be running well on my machine, pushing to Try and if it's green going to land this tomorrow. Again.

https://tbpl.mozilla.org/?tree=Try&rev=b11f1947ca30
Attachment #8356693 - Attachment is obsolete: true
Attachment #8360174 - Flags: review+
Ok, third attempt. Try seemed to be green.

https://hg.mozilla.org/integration/fx-team/rev/fd0dafa0e8db
Whiteboard: [fixed-in-fx-team]
https://hg.mozilla.org/mozilla-central/rev/fd0dafa0e8db
Status: REOPENED → RESOLVED
Closed: 10 years ago10 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Whiteboard: [fixed-in-fx-team]
Target Milestone: --- → Firefox 29
Blocks: 972534
See Also: → 981707
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: