Show an initial empty keymap (#14609)
Release Notes: - Added default content for the user keymap file.
This commit is contained in:
parent
cf92b83c04
commit
2cdfae9ce3
4 changed files with 28 additions and 3 deletions
21
assets/keymaps/initial.json
Normal file
21
assets/keymaps/initial.json
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
// Zed keymap
|
||||||
|
//
|
||||||
|
// For information on binding keys, see the Zed
|
||||||
|
// documentation: https://zed.dev/docs/key-bindings
|
||||||
|
//
|
||||||
|
// To see the default key bindings run `zed: Open Default Keymap`
|
||||||
|
// from the command palette.
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"context": "Workspace",
|
||||||
|
"bindings": {
|
||||||
|
// "shift shift": "file_finder::Toggle"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"context": "Editor",
|
||||||
|
"bindings": {
|
||||||
|
// "j k": ["workspace::SendKeystrokes", "escape"]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
|
@ -4,8 +4,8 @@
|
||||||
// documentation: https://zed.dev/docs/configuring-zed
|
// documentation: https://zed.dev/docs/configuring-zed
|
||||||
//
|
//
|
||||||
// To see all of Zed's default settings without changing your
|
// To see all of Zed's default settings without changing your
|
||||||
// custom settings, run the `open default settings` command
|
// custom settings, run the `zed: Open Default Settings` command
|
||||||
// from the command palette or from `Zed` application menu.
|
// from the command palette
|
||||||
{
|
{
|
||||||
"ui_font_size": 16,
|
"ui_font_size": 16,
|
||||||
"buffer_font_size": 16,
|
"buffer_font_size": 16,
|
||||||
|
|
|
@ -54,6 +54,10 @@ pub fn initial_local_settings_content() -> Cow<'static, str> {
|
||||||
asset_str::<SettingsAssets>("settings/initial_local_settings.json")
|
asset_str::<SettingsAssets>("settings/initial_local_settings.json")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn initial_keymap_content() -> Cow<'static, str> {
|
||||||
|
asset_str::<SettingsAssets>("keymaps/initial.json")
|
||||||
|
}
|
||||||
|
|
||||||
pub fn initial_tasks_content() -> Cow<'static, str> {
|
pub fn initial_tasks_content() -> Cow<'static, str> {
|
||||||
asset_str::<SettingsAssets>("settings/initial_tasks.json")
|
asset_str::<SettingsAssets>("settings/initial_tasks.json")
|
||||||
}
|
}
|
||||||
|
|
|
@ -372,7 +372,7 @@ pub fn initialize_workspace(app_state: Arc<AppState>, cx: &mut AppContext) {
|
||||||
move |_: &mut Workspace,
|
move |_: &mut Workspace,
|
||||||
_: &zed_actions::OpenKeymap,
|
_: &zed_actions::OpenKeymap,
|
||||||
cx: &mut ViewContext<Workspace>| {
|
cx: &mut ViewContext<Workspace>| {
|
||||||
open_settings_file(&paths::keymap_file(), Rope::default, cx);
|
open_settings_file(&paths::keymap_file(), || settings::initial_keymap_content().as_ref().into(), cx);
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
.register_action(
|
.register_action(
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue