Skip to content

Persistent editor settings and customizable keybindings #803

@FlipFlopszzz

Description

@FlipFlopszzz

Hello maintainers,

I've gone through the existing issues and PRs, and it seems there's no concrete plan yet for two features I'd find really useful: persistent editor settings and customizable keybindings.

Before I start writing any code, I'd like to propose an approach and hear the team's thoughts.

Feature 1: Persistent Editor Settings

The project already has a settings.json system (settings.rs) with cross-platform path resolution. I'd like to extend it to also persist buffer-level editor states.

Proposed new fields:

{
"editor.autopairs": true,
"editor.wordWrap": true,
"editor.useSpaces": true,
"editor.tabSize": 4,
"editor.newlineStyle": "lf"
}

  • No new dependencies: reuse the existing json parser and settings.json infrastructure.
  • If a field is missing, behavior falls back to current defaults.
  • The binary size will not increase by much, and this is a lightweight functional addition.

Feature 2: Customizable Keybindings

Currently, shortcuts like Ctrl+R(replace) are hardcoded in main.rs. I propose allowing users to override these via settings.json, so that users can use other shortcuts like Ctrl+H to replace.

Proposed new field:

{
"keybindings": {
"editor.action.newFile": "ctrl+n",
"editor.action.openFile": "ctrl+o",
"editor.action.save": "ctrl+s",
"editor.action.wordWrap": "alt+z"
}
}

Also no new dependencies, all settings are optional, and the binary size can be well controlled.

Proposed Next Steps

I'd be happy to implement these if the direction looks good.

Specifically, I would like feedback on:

  • Is the team open to these being implemented incrementally (persistence layer first, without waiting for the full settings page UI from Add a settings page #22)?
  • Is it okay to reuse the existing settings.json for editor settings, or do you prefer a dedicated file like keybindings.json for keybindings?

Looking forward to your thoughts!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions