graphql / graphql-playground

🎮 GraphQL IDE for better development workflows (GraphQL Subscriptions, interactive docs & collaboration)
MIT License
8.73k stars 730 forks source link

VIM mode would be very nice #794

Open arizonatribe opened 5 years ago

arizonatribe commented 5 years ago

This issue pertains to the following package(s):

What OS and OS version are you experiencing the issue(s) on?

Mac OSX High Sierra (v10.13.5)

What version of graphql-playground(-electron/-middleware) are you experiencing the issue(s) on?

1.6.0 ? (whatever is bundled in apollo-server-express)

What is the expected behavior?

Expecting to enable VIM mode somehow

What is the actual behavior?

No VIM mode :(

What steps may we take to reproduce the behavior?

n/a, but @nilan mentioned one should open an issue here to request it be re-added 🥇

Please provide a gif or image of the issue for a quicker response/fix.

christianrondeau commented 5 years ago

@marktani you said here that it was removed in an earlier refactor: https://www.prisma.io/forum/t/vim-in-graphql-playground-electron/3007

Can you let us know in which commit, and / or where in the code, or otherwise give some pointers so we don't reinvent the wheel?

Thanks!

mcabrams commented 5 years ago

@christianrondeau here's where it was added: https://github.com/prisma/graphql-playground/commit/0138105967e7f009dde79c49cc0a0a2beb33f29a - should be enough to get started/use some git fu to find where it was removed.

fandy commented 5 years ago

Any updates on adding this feature? Some basic Vim functionality would be Amazing.

christianrondeau commented 5 years ago

@fandy still on my todo list, but I didn't find time yet. If someone tackles it let us know, I'll reach out if I have something working in the future!

andweeb commented 5 years ago

Has anyone been able to make any progress on this? It was fairly simple to add an editor setting to enable vim as you can see from my changes here.

Instead of the explicit vim mode toggle in the linked commit in @mcabrams' comment, I introduce a generic "editor.keyMap" setting, which can have values "vim", "emacs", or the default "sublime".

It's usable (at least for me) but I wouldn't consider it complete, since for some reason the cursor doesn't appear in the light theme and pressing the escape key occasionally doesn't exit insert mode to normal mode (and I haven't really tested emacs mode).