VSpaceCode / VSpaceCode

Spacemacs like keybindings for Visual Studio Code
https://vspacecode.github.io/
MIT License
1.41k stars 133 forks source link

Project's direction #1

Closed StreakyCobra closed 4 years ago

StreakyCobra commented 7 years ago

The VSpaceCode project is young, and for now it only consists of people sharing their configurations manually.

While being a good starting point, this solution is far from ideal. So the idea is to gather around this project all the people wanting to participate in making VSCode works with Spacemacs' key bindings, and to find together the best solution to achieve this goal.

This issue is for discussing the project direction, to decide in which way the project should be oriented, like just as a shared configuration file or as a VSCode extension.


Solutions imagined so far:

ghost commented 7 years ago

Hi @StreakyCobra,

First of all, thanks for creating this project.

I think we can gather people's config. first and see if there are certain features which are not possible to be achieved solely on "Keybinding Re-mapping".

If there are many features cannot be done via "Re-mapping" approach then we can consider to create an extension or alternatively build upon VSCodeVim.

The thing I am not so sure about is that what make Spacemacs really shine is its community-based configurable layers and its "mnemonic" keybinding is just a side-effect. If we could not convince new user for its "mnemonic" keybinding (for example, we do not have which-key implementation inside VSCode), then this project will only be interested in user who has experience in Spacemacs (hard-core user I would say) and whom will likely stay with Spacemacs anyway.

I am also not so sure about whether I will stay with VSCode or not. I just think it's a good idea to have Spacemacs keybinding to keep my productivity in VSCode.

Thanks again for your time and efforts.

StreakyCobra commented 7 years ago

Hi @li-xinyang,

Thanks for joining :-)

I think we can gather people's config. first and see if there are certain features which are not possible to be achieved solely on "Keybinding Re-mapping".

For sure, merging configurations is the good start, but I think in the long term this will be a little bit annoying to do manual updates, it is why I opened this thread to find solutions. I'm not really into VSCode development/extensions so any idea or intel about the possibilities is welcome!

If there are many features cannot be done via "Re-mapping" approach then we can consider to create an extension or alternatively build upon VSCodeVim.

Building upon VSCodeVIme is another idea that I will put in the summary.

then this project will only be interested in user who has experience in Spacemacs (hard-core user I would say) and whom will likely stay with Spacemacs anyway.

Indeed, at the beginning this will only be interesting for existing Spacemacs users. A mix between VSCode, Spacemacs, Which-key and Magit would be the dream editor for me and may interest new users. But this is far out of my capabilities and availability. The best we can hope for this project is that it evolves into this :smile:

I am also not so sure about whether I will stay with VSCode or not. I just think it's a good idea to have Spacemacs keybinding to keep my productivity in VSCode.

Kind of the same here. I only use VSCode from time to time, and I need this kind of configuration to keep up with my productivity and muscle memory. So let's hope we will find the right contributor, experienced with javascript/VSCode and interested by helping us!

ghost commented 7 years ago

I am proficiency with JavaScript and love working with VSCode so far (except its extensibility) and I would love to contribute to this project and see what I can do to make it a nice alternative for Spacemacs.

Let's make a config file build-tool first and possible keybinding config generator or alike (which may reset extension's default keybinding and auto-generate documentation for Spacemacs version keybinding as well).

We also need to think about extension dependencies management as well because certain functionality depends on extensions other than VSCodeVim.

StreakyCobra commented 7 years ago

So this is a proposal:

  1. Creating a script that takes VSCode settings and add the missing keybindings in it.
  2. Making a webpage (and eventually an API) for making it simple to use for the users
  3. Extending the webpage with a keybinding config generator in order to let user choose what keybindings they want to be merged in their settings, and also to add/customize bindings.
  4. Making a VSCode extension that let users do it right from their VSCode editor.
  5. Hopping to get contributors to think about the future :-)

I can probably do 1 and 2 in Python pretty easily, 3 and 4 will require javascript skills. I may do some javascript, but I will need some lead on this side.

What do you think?

ghost commented 7 years ago
  1. Creating a script that takes VSCode settings and add the missing keybindings in it.

For this part, my suggestion is to separate the setting into different files based on the key.

For example, we can have SPC_f.json to store keybinding related to files and SPC_p.json to store keybinding related to projects.

Three reasons,

  1. Easy to maintenance
  2. Easy for web page or API construction
  3. Possible which-key alike behavior in future (layman's version by outputting formatted version of keybinding file for each key)

Then we could merge all keybindings together at the build and of course, we could provide a merged setting file for people would like to copy-paste but it eventually should be replaced with an extension instead (if we have enough people interested in this project).

  1. Extending the webpage with a keybinding config generator in order to let user choose what keybindings they want to be merged in their settings, and also to add/customize bindings.

This can also be achieved via a cli tool for now.

  1. Making a VSCode extension that let users do it right from their VSCode editor.

I see what I can help with this one 🤞

StreakyCobra commented 7 years ago

Three reasons,

  1. Easy to maintenance
  2. Easy for web page or API construction
  3. Possible which-key alike behavior in future (layman's version by outputting formatted version of keybinding file for each key)

I agree that for 1) it would be useful. But for 2) and 3) having different files don't really change anything. It's all JSON files at the end, they will have to be parsed and analysed anyway, so having one file would even be simpler than having to select the correct file first then analyzing it :smile: But for maintenance I agree that separate files would help.

I'll start making some first steps in this direction then, as a basis for future discussions. Let me know if you want/need write access to this repo inbetwen to start experimenting with VSCode extension, I mean if you plan of doing so.

ghost commented 7 years ago

Sure, that make sense to me. I will try to explore the extension option first and made a proof of concept thing first before making a PR.

Not sure how serious I can commit to this project yet, but I will try my best to find time to do this. 🕺

StreakyCobra commented 7 years ago

Not sure how serious I can commit to this project yet, but I will try my best to find time to do this. 

Same here, don't worry, we do what we can and see where it goes. Maybe we will just let a config.json file in a few weeks saying that is ok ^^

ghost commented 7 years ago

Do you have the ownership of organization VSpaceCode? I am thinking to fork Vim extension and build on top of it.

StreakyCobra commented 7 years ago

Yes :-) You have access now!

StreakyCobra commented 7 years ago

I also moved this repository there.

ghost commented 7 years ago

I made a quick logo for the organization.

StreakyCobra commented 7 years ago

:+1: updated

ghost commented 7 years ago

A new version and choice the one you prefer.

ghost commented 7 years ago

I have tried simply creating an extension and try to change the contributes setting (https://code.visualstudio.com/docs/extensionAPI/extension-points) inside package.json the file and it does not work. It seems that the extension can only invoke editor commands not commands from other extensions.

    "contributes": {
        "keybindings": [
            {
                "key": "ctrl+f",
                "command": "extension.vim_right",
                "when": "editorFocus && vim.active && vim.mode == 'Insert'"
            }
        ],
        "configurationDefaults": {
            "[markdown]": {
                "editor.wordWrap": "off",
                "editor.quickSuggestions": false,
                "vim.otherModesKeyBindingsNonRecursive": [
                    {
                        "before": [
                            "<leader>",
                            "<space>"
                        ],
                        "after": [],
                        "commands": [
                            {
                                "command": "workbench.action.showCommands",
                                "args": []
                            }
                        ]
                    }
                ]
            }
        }
    },

For the keybinding setting, the editor cannot recognize vim.active and for the configurationDefaults setting, it just complains vim.otherModesKeyBindingsNonRecursive is unknown config setting.

I think it leave us no choice but create a customized version of VSCodeVim.

StreakyCobra commented 7 years ago

extension can only invoke editor commands not commands from other extensions.

This seems to make sense because there is no dependency system for extensions yet.

I think it leave us no choice but create a customized version of VSCodeVim.

Ok, it is sad, but it is a fact, we will have to deal with it.

Keeping a fork of VSCodeVim up to date with upstream will be kind of complicated in the long term, so it may be worth to discuss with upstream about our project first, to see if they may see a collaboration:

Immortalin commented 7 years ago

@StreakyCobra @li-xinyang any way to obtain the which-key mnemonics popup?

StreakyCobra commented 7 years ago

@Immortalin Developing it? :smile:

aislanmaia commented 7 years ago

Take a look for inspiration at Proton

StreakyCobra commented 7 years ago

@aislanmaia Thanks, I tried Proton at its beginning, back in time when I was a Spacemacs' collaborator :older_man: This could be an inspiration, but for now I think it is quite obvious that neither @li-xinyang or myself have enough time to devote on this project for making it as advanced as Proton.

Also, @Immortalin, concerning the which-key like interface, I read a comment yesterday that let me think it would not be possible to implement this in VSCode as an extension: it seems that extensions are not allowed to have an UI.

Any development help and competencies would be welcome :-)

clayrisser commented 7 years ago

I've been using spacemacs for years, but I'm changing to Visual Studio Code because of plugin support. I can't survive without my spacemacs keybindings. I'm definitely happy to help contribute to this.

StreakyCobra commented 7 years ago

@jamrizzi Nice to have you onboard :-)

As it seems that we (@li-xinyang and me) don't have a lot of time to invest in this project, if you are motivated to go further feel free to propose any idea you have.

JohnBloom commented 6 years ago

Love what you guys have done so far. I think that this will fix most of my workflow other than the lack of magit. I think what is lacking in vscode is the fact that shortcut keys should be context aware. I think that building that context aware functionality is what is difficult. I know you guys dont have time and neither do I but if someone got something started I would likely contribute.

joefiorini commented 6 years ago

Hey everyone, I started configuring some Spacemacs bindings in vscode this morning (after having searched unsuccessfully for an extension) and then came across this project. I copied all the shortcuts in, so we'll see how it goes. Just wanted to express my interest!

StreakyCobra commented 6 years ago

Hi @joefiorini, thanks for joining and showing your interest 😄 If you have ideas and motivation on how to move this project further, do not hesitate to open the discussion. The project has stalled a little bit.

fabrik42 commented 6 years ago

Hi! I used Spacemacs for some time, but had a look at VS Code this weekend. I would also be interested to have my favorite features/hotkeys from Spacemacs on VS Code as well.

Currently, I am collecting all missing features. I think some could be easily implemented, others might be worth a discussion. Would it be of any interest, if I publish them here?

StreakyCobra commented 6 years ago

Hi @fabrik42, glad to see you interested!

I would also be interested to have my favorite features/hotkeys from Spacemacs on VS Code as well. […] Would it be of any interest, if I publish them here?

Of course! As long as they are default Spacemacs bindings (i.e. not personalized shortcuts) they can benefit to everyone here! Don't hesitate to open a new issue to discuss the ones you think are worth a discussion.

fabrik42 commented 6 years ago

I think my main problem right now is that the custom keybindings only work in the code editor. I am really missing the consistency of Spacemacs when it comes to keybindings.

Example: SPC s p opens project search, but I can't go through the list with C-n/C-p and if I press ESC I will still stay in this view, instead of going back to the code view. I am a fan of helm and in this case, the mini buffer would just close and return focus to the previously active buffer.

Maybe I just lack some configuration. Would it be possible to to map C-n/C-p to up/down in the non-editor views of VSCode?

Besides this, I would propose the following additional keybindings:

SPC w 2 to cmd 2 (split into 2 columns) SPC w 3 to cmd 3 (split into 3 columns) SPC / alias to existing SPC s p (search project) SPC r s alias to existing SPC s p (resume search, VS Code keeps the results anyways)

If this is of general interest, I could create a PR.

Still trying to figure out how to live without helm and dired :)

StreakyCobra commented 6 years ago

Maybe I just lack some configuration. Would it be possible to to map C-n/C-p to up/down in the non-editor views of VSCode?

Up to my knowledge, VSCode is quite restrictive concerning what can be extended. It's not comparable to Emacs where anything can be hacked, so don't expect Spacemacs consistency for now :D You may have a look at extensions points to have an idea of what can be extended, and maybe at the when clause to define keybindings in a specific context.

If this is of general interest, I could create a PR.

Please proceed, this seems interesting to me at quick glance.

Still trying to figure out how to live without helm and dired :)

… and ranger.el , and magit ;-)

clayrisser commented 6 years ago

I still use Spacemacs. I still haven't found an editor as powerful as Spacemacs. However, Spacemacs is kind of a pain on Windows, which isn't too much of an issue because I stay away from Windows. However, the few times I need Windows, I find VSpaceCode to provide a bearable experience. I tried Proton first, but Atom is slow and heavy. In light of using VSpaceCode as a bearable alternative for Spacemacs on Windows, I hope it sticks to the Spacemacs key bindings as much as possible. People who use VSpaceCode still use Spacemacs quite heavily and like the semi-seamless transition between the two, at least in the area of the key bindings.

fabrik42 commented 6 years ago

I just added a PR for the the search keybindings mentioned above.

Regarding the layout bindings, it seems like it is not possible to recreate the behaviour in VS Code (yet).

danielpza commented 6 years ago

Hello I just found this repo and I think is really great, I made a PR with some changes https://github.com/VSpaceCode/VSpaceCode/pull/10 .

What's the current status of this project ?, I look https://github.com/VSpaceCode and see only 1 @li-xinyang there, so it makes me wonder if this project is still active

StreakyCobra commented 6 years ago

Hi @danielpa9708, for now the project is limited to share a VSCodeVim configuration of common Spacemacs bindings. For this usage this is working well as it is right now, and people are welcome to add missing bindings as you did! But probably the most used ones are already provided, it's why there aren't a lot of new contributions.

Going further would require to build a VSCode extension or so, and it seems obvious now that nobody here as the time, motivation or competencies to do so. If you want to help on any side (extension, growing the community, …) please open an issue with your idea so we can discuss all of this :-) We can probably add you in the organization if you are willing to get engaged !

michaelgriscom commented 6 years ago

One of the things I missed most from spacemacs was the 'which-key' feature, as a holy-mode user though the Vim extension doesn't fit my needs so I wrote up a small extension for a standalone leadermode/which-key feature https://github.com/michaelgriscom/LeaderMode in case others fall into my camp. If anyone here wants to expand to an extension that more robustly emulates spacemacs I'd love to contribute 😊

StreakyCobra commented 6 years ago

Hi @michaelgriscom, your project seems nice! Thanks for the proposal to help for an extension. Hopefully someday someone will have time and competencies to implement a real Spacemacs emulation :smile:

StreakyCobra commented 4 years ago

It's becoming clear that I don't have enough time to maintain this project, it's not acceptable that simple PRs have to wait for months before being merged.

If anyone is interested to take over the project, or even want to have write access to merge some PR and show this project some love, please contact me by mail. I'm pretty sure you know where to find it with git :wink:

jamiehicks154 commented 4 years ago

Hey, I would be interested in taking over this project, I work as a JS developer and React developer and interested in gaining some experience working in the Open Source world, also a big vim fan, don't have really much experience with this kind of stuff but happy to learn and see if I can help.

Thanks, Jamie

StreakyCobra commented 4 years ago

@jamiehicks154 Any help is welcome :) I sent you an invite to collaborate!

pavkum commented 4 years ago

Hello @StreakyCobra @michaelgriscom @jamiehicks154 and others, I'm the author of https://github.com/pavkum/vscode-hydra extension with a similar goal. The extension works without vim. It would be great if we can collaborate in some way and keep the shortcuts consistent so that users can have more choices. Thanks, Pavan

MarcoIeni commented 4 years ago

Hi @StreakyCobra, I saw in the README that "THIS PROJECT IS LOOKING FOR A MAINTAINER". I am the author of Intellimacs and spaceclipse. If you like the work I did with those other two projects you can add me as a mainter. I would slowly try to bring most of these key bindings in this project.

I don't know if this is something you would like, because maybe you want to keep key bindings small. I would like to hear the opinion of the VSpaceCode community, too :)

StreakyCobra commented 4 years ago

Hi @pavkum, I don't know really know how to collaborate for now, but if you have ideas PR are welcome, and if the new managers have ideas on how to collaborate they know they can contact you :slightly_smiling_face:


Hi @MarcoIeni, I'm using your setup in intellij and it is working great. The project is not really alive for now, so any energy is welcome. I'm happy to give you maintainer access to this repository, I'm pretty sure you will do great use of it :)

The more keybindings the better IMHO. This can make the management of the settings file a bit more painful, but it is already the case now anyway. I still believe the future should be a plugin or at least a separate configuration file, if you have any idea to improve that they are welcome.

Feel free to drive this project in the direction you think is the best. I'll still keep an eye on it and I'm available if you want to discuss the direction :slightly_smiling_face:

MarcoIeni commented 4 years ago

Thank you @StreakyCobra :smile: I will do my best. Separate config files would be nice, we'll see :) Anyway now that me and @jamiehicks154 are on board maybe we could remove the message "THIS PROJECT IS LOOKING FOR A MAINTAINER" from the README.

@pavkum From what I see here looks like your project can emulate which key. Am i right? If you could open an issue/pull request where you provide us ideas on how to collaborate it would be great (don't answer here since this conversation is already really long).

StreakyCobra commented 4 years ago

Anyway now that me and @jamiehicks154 are on board maybe we could remove the message "THIS PROJECT IS LOOKING FOR A MAINTAINER" from the README.

Looks like a good first commit on the project ;)

MarcoIeni commented 4 years ago

I am closing this because I prefer to split the discussion in separate issues. Write a comment if you want to add more info or if I missed something.

Develop VSpaceCode as a settings builder

I opened #43

Build a custom extension upon VSCodeVim providing the Spacemacs-like experience out of the box.

See this issue in the VSCodeVim repository where they ask to develop the which-key plugin.