ffd8 / P5LIVE

p5.js collaborative live-coding vj environment!
https://p5live.org
GNU General Public License v3.0
226 stars 35 forks source link

vim mode #14

Closed osresearch closed 5 years ago

osresearch commented 5 years ago

Since the ACE editor supports both types of editors, this patch adds a checkbox for vi mode and hooks the :w command to force a recompile.

The hooking of the ex write command is probably suboptimal, although I don't know enough about how ace works internally to do this the right way.

osresearch commented 5 years ago

The cursor all-but-disappears in the default green on black theme in vi mode. As a workaround the pastel-on-dark theme looks fine. Haven't had a chance to figure out where it is set in the other themes.

ffd8 commented 5 years ago

Hey interesting idea. Since I'm using Sublime as my main editor now, didn't even think about the other key-bindings Ace offers. Nevertheless, I wouldn't make this an 'on/off' toggle switch, since then it's not clear what the default means, not to mention, emacs, might as well also be offered in the list if Vim should? It would make most sense to use an option/select and put it at the bottom of the settings after where one selects their theme. But would first have to check that those keybindings don't kill other shortcuts in P5LIVE?

ffd8 commented 3 years ago

FYI – PR #55 introduced a new settings panel option for setting the keyboard bindings, including Vim, Emacs, Sublime, VSCode, and default - Ace. IN the Vim mode, it auto-disables a bunch of the keyboard shortcuts to avoid issues.. nevertheless, since a while ago, you can custom set keyboard shortcuts, so any necessary ones can be reimplemented.