processing / processing/p5.js-web-editor
Feature Request: Vim Mode
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 1.7k
- Forks
- 1.7k
- Avg merge
- 3d 4h
- Merged PRs (30d)
- 8
Description
Nature of issue?
- New feature request
New feature details:
This feature request together with a working implementation proposes a new user preference to enable Vim Mode on p5 Codemirror editor.
I did some search about any discussion related to Vim on p5 web editor, but I couldn't find any, so I ended up with a working implementation which wasn't that difficult as I thought, since Codemirror already supports Vim Keymap, I just had to change the Keymap from codemirror/keymap/sublime to codemirror/keymap/vim and add a preference option to the UI.
One small concern is the slightly increase on the bundle size, since codemirror/keymap/vim is about 220 KB, (although I ended up with 4.2MB on my app.[hash].js on my local build and 4.1MB without keymap/vim, but on the live p5 editor is just 1.1MB, I am a bit confused 🧐).
Another concern to keep in mind is with underlying issues with Codemirror Vim Keymap implementation itself, which apparently does not have an active maintainer, although I didn't had any problems.
I am not sure if this is a such demanded feature, but would love to hear some feedback.
Code: https://github.com/cesardeazevedo/p5.js-web-editor/commit/03fe75b3d60c5f52375758993e565441929ebfa7
Implementation: https://p5-vim.herokuapp.com/ (I don't know how to fix the PREVIEW_URL)
Codemirror vim issues: https://github.com/codemirror/codemirror/issues?q=is%3Aissue+is%3Aopen+label%3Avim
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing the p5 CodeMirror editor's current codemirror/keymap/sublime import and the UI that stores editor preferences. Compare the proposed codemirror/keymap/vim integration and verify that the preference switches the editor keymap without breaking the existing editor or causing an unacceptable bundle-size increase.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- frontend
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100