zed-industries / zed

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
https://zed.dev
Other
47.22k stars 2.73k forks source link

Ability to create different profiles. #7720

Open eznix86 opened 7 months ago

eznix86 commented 7 months ago

Check for existing issues

Describe the feature

Currently we have only 1 default setting. The problem arises for people working on different projects which needs different settings.

Example; We can have Rust Profile (which has all the settings for the best experience for Rust). Laravel Profile, Django Profile. Python profile etc. It doesn't need to be specific. But we just need to have the ability to have different profiles.

If applicable, add mockups / screenshots to help present your vision of the feature

We can have prebuilt profiles (for specific languages/frameworks) or we can have custom profiles. Those profiles can be exported, imported, deleted, extended.

jansol commented 7 months ago

IIRC there are already some per-language settings, but there definitely is more that could be done with that.

JosephTLyons commented 7 months ago

We also have local settings as well - which can kind of act as a bandaid in this case, though, it isn't ideal in the context of the original request.

ceopaludetto commented 5 months ago

Personally, I think this should follow something like tsconfig.json does. So I want to introduce two new concepts:

  1. The extends: string | string[] + name: string options, this will allow us to do:
{
  // The base profile
  "name": "base",

  "theme": "Catppuccin Mocha",
  "vim_mode": true,
}

And then:

{
  // The typescript profile
  "extends": ["base", ...],
  "name": "typescript",

  "languages": {
    "TypeScript": {
      "code_actions_on_format": {
        "source.fixAll.eslint": true
      }
    }
  }
}

Primitive options like string | number | boolean should be overwritten and object | array should be merged together

  1. The extensions: string[] (or maybe extensions: { include: string[], exclude: string[] }) option. We need to disable/enable some extensions in different profiles. Nowadays VSCode allow us to disable in UI, but personally, I prefer to disable via settings.json
{
  // The base profile
  "name": "base",

  "theme": "Catppuccin Mocha",
  "vim_mode": true,
}
{
  // The swift profile
  "extends": ["base", ...],
  "name": "swift",

  "extensions": ["zed:sourcekit-lsp-extension"]
}

Some people also like the ability to disable all extensions in the base profile and only enable on specific ones, I think all this possibilities should be supported.

What you think?

jansol commented 5 months ago

Hmm... Should the profile also specify the github account and e.g. git author info to use (once we have git commit support)? I.e. separate "work" and "personal" profiles.

Formatting etc options should really be done via local settings IMHO, since different repos have different policies for that.